colorverse 0.5.1

color vision convertor
Documentation

Colorverse

Color vision convertor / simluator

crates.io Documentation Dependency Status Executable License

Based on Machado, Oliveira & Fernandes (2009) model. Customized with dynamic level parameter introduced and nonlinear easing of the level.

Usage

Executable

Executables on multiple platforms are found in Releases. Just run it without any installation.

$ # usage
$ ./colorverse -c ${color vision} -l ${level} -o ${output file path} ${input file path}

$ # for example
$ ./colorverse -c protanomaly -l 0.75 -o out.png in.png

$ # help
$ ./colorverse --help

Rust and cargo

Configure:

$ cargo add colorverse

Use:

use colorverse::convert;
use colorverse::core::color_vision::color_vision_type::ColorVisionType;

let color_vision_type = ColorVisionType::Protanomaly;
let level = 0.5;
let input_file_path = "tests/fixtures/input.png";
let output_file_path = format!("output-{}-{}.png", color_vision, level * 100.0);

convert(input_file_path, &color_vision, level)
    .unwrap()
    .save_as(output_file_path.as_str());
use colorverse::convert;
use colorverse::core::color_vision::color_vision_type::ColorVisionType;

let mut color_vision_type_iterator = ColorVisionTypeIterator::new(&ColorVisionType::Trichromacy);
while let Some(color_vision_type) = color_vision_type_iterator.next() {
    for level in [0.5, 1.0] {
        match convert("tests/fixtures/input.png", &color_vision_type, level) {
            Ok(x) => {
                let output_file_path = format!("output-{}-{}.png", &color_vision_type, level * 100.0);
                x.save_as(output_file_path.as_str());
            }
            Err(err) => eprintln!("{}", err),
        }
    }
}

Samples

Trichromacy

trichromacy

Protanomaly 50%

protanomaly

Protanomaly 100% (Protanopia)

protanopia

Deuteranomaly 50%

deuteranomaly

Deuteranomaly 100% (Deuteranopia)

deuteranopia

Tritanomaly 50%

tritanomaly

Tritanomaly 100% (Tritanopia)

tritanopia

Achromatomaly 50%

achromatomaly

Achromatomaly 100% (Achromatopsia)

achromatopsia


Open-source, with care

This project is lovingly built and maintained by volunteers.
We hope it helps streamline your work.
Please understand that the project has its own direction — while we welcome feedback, it might not fit every edge case 🌱

Acknowledgements

Depends on image / nalgebra. Also, on argh on CLI I/F.