This Python script uses the daltonlens library to simulate different types of color vision deficiencies (CVD) on an input image. The app provides a user-friendly way to visualize how images appear to individuals with various forms of color blindness.
- Opens a file dialog for easy image selection
- Simulates three types of color vision deficiencies:
- Protanopia (red-blind)
- Deuteranopia (green-blind)
- Tritanopia (blue-blind)
- Saves simulated images with timestamps
- Creates a grayscale version of the original image
- Utilizes the Brettel 1997 algorithm for simulation (easily changeable to other algorithms)
- daltonlens
- PIL (Python Imaging Library)
- numpy
- tkinter
- Run the script
- Select an image file through the opened file dialog
- The script will process the image and save four new images:
- Protanopia simulation
- Deuteranopia simulation
- Tritanopia simulation
- Grayscale version of the original image
All output images are saved with a timestamp in the filename.
The script currently uses the Brettel 1997 algorithm for CVD simulation. You can easily switch to other algorithms by uncommenting the desired simulator:
# simulator = simulate.Simulator_Vienot1999()
# simulator = simulate.Simulator_Machado2009()
simulator = simulate.Simulator_Brettel1997()
# simulator = simulate.Simulator_Vischeck()
# simulator = simulate.Simulator_AutoSelect()
You can also adjust the severity of the color vision deficiency by changing the severity
parameter (range 0.0 to 1.0):
severity=0.8
The script generates four output images:
protan_image_[timestamp].jpg
: Simulates protanopiadeutan_image_[timestamp].jpg
: Simulates deuteranopiatritan_image_[timestamp].jpg
: Simulates tritanopiabw_image_[timestamp].jpg
: Grayscale version of the original image
This tool is intended for educational and design purposes. It provides an approximation of how images may appear to individuals with color vision deficiencies, but may not be 100% accurate for all individuals due to the varying nature of color blindness.