Code Monkey home page Code Monkey logo

jscolorblindsimulator's Introduction

jsColorblindSimulator

Simulate different kinds of color-blindness on images directly in your webbrowser. All the processing is done locally and the images do not leave your computer.

Try it here

About this project

This project is inspired by Coblis - the Color BLIndness Simulator. But instead of uploading the images to a server it does all the image processing locally in your webbrowser.

You can choose between 4 different Simulation Algorithms (The first two are not proven to produce good or realistic results!):

The ColorMatrix Algorithm

From http://www.colorjack.com/labs/colormatrix/ (web.archive).

But there is this comment which claims to be from the author:

You're right, the ColorMatrix version is very simplified, and not accurate. I created that color matrix one night (http://www.colorjack.com/labs/colormatrix/) and since then it's shown up many places... I should probably take that page down before it spreads more! Anyways, it gives you an idea of what it might look like, but for the real thing...

As far as a simple script to simulate color blindness, this one does the best job:

http://www.nofunc.com/Color_Blindness_Library/ — It uses "confusion lines" within the XYZ color space to calculate values (this one is in Javascript, and should be easy to convert to python).

There are a few other methods, and no one really knows exactly what it would look like... these are all generalizations of a small sample, set against the masses.

The HCIRN Color Blind Simulation function

From http://www.nofunc.com/Color_Blindness_Library/ (web.archive).

The Color Blind Simulation function is
copyright (c) 2000-2001 by Matthew Wickline and the
Human-Computer Interaction Resource Network ( http://hcirn.com/ ).

It is used with the permission of Matthew Wickline and HCIRN,
and is freely available for non-commercial use. For commercial use, please
contact the Human-Computer Interaction Resource Network ( http://hcirn.com/ ).
The Brettel, Viénot and Mollon Simulation function

This is an implementation of the research paper Computerized simulation of color appearance for dichromats by Brettel, H., Viénot, F., & Mollon, J. D. (1997). It has been adapted to modern sRGB monitors and should be pretty accurate, at least for full dichromacy. Of course it is still an approximation though, many factors make it imperfect, such as uncalibrated monitor, unknown lighting environment, and per-individual variations. In general it will tend to be accurate for small or thin objects (small dots, lines) and too strong for large bright areas, even for full dichromats.

Gustavo M. Machado, Manuel M. Oliveira, and Leandro A. F. Fernandes

Uses the matrizes published on https://www.inf.ufrgs.br/~oliveira/pubs_files/CVD_Simulation/CVD_Simulation.html from the paper

Gustavo M. Machado, Manuel M. Oliveira, and Leandro A. F. Fernandes "A Physiologically-based Model for Simulation of Color Vision Deficiency". IEEE Transactions on Visualization and Computer Graphics. Volume 15 (2009), Number 6, November/December 2009. pp. 1291-1298.

jscolorblindsimulator's People

Contributors

mapeper avatar nburrus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

jscolorblindsimulator's Issues

Redundant lines in HCIRN code?

Firstly, thanks a ton for hosting this code online. I have been searching for programmatic ways to generate colorblind images and this was the only useful code I found online!

I was parsing the javascript file, hcirn_colorblind_simulator.js and found the following few lines:

if (cu < rBlind[t].cpu) {
        clm = (rBlind[t].cpv - cv) / (rBlind[t].cpu - cu);    
} else {
        clm = (cv - rBlind[t].cpv) / (cu - rBlind[t].cpu); 
}

If I understand right, the two if-else expressions evaluate to the same value. Is this a code bug, or just redundant lines?

Regards.

Linear RGB for Machado et al method?

Hi there, thank you so much for this implementation. I was exploring adapting it for my own purposes, and found a potential issue: currently, when using the Machado et al method, the function does not convert the input color to linear rgb before performing the matrix computation. When looking at the original paper, I didn't see the author specify whether the input values should be linear rgb or srgb, but based on context I believe it should be linear rgb.

Do you have more direct evidence that the operation should be performed on srgb, as in your implementation, or linear rgb, like the brettel method?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.