A small example package
Project description
Colorblind
Colorblind is a computer vision library that converts images into a colorblind friendly version depending on the type of colorblindness. The three supported types of colorblindness/color weakness are:
- Deuteranopia: green weakness
- Protanopia: red weakness
- Tritanopia: blue weakness (extremely rare)
So far we provide three algorithms to correct the images:
- Daltonization: Original method for generating colorblind-friendly images
- HSV Hue Shift: Shifts Hue based on green ratio or blue ratio (depending on colorblindness type)
- LAB Shift: Previous studies for this had to tune hyperparameters to get good results
Installation
pip install colorblind
Usage
# imports
import numpy as np
import cv2
from colorblind import colorblind
import matplotlib.pyplot as plt
# load image
img = cv2.imread('../images/seven.jpg')
img = img[..., ::-1]
# simulate protanopia
simulated_img = colorblind.simulate_colorblindness(img, colorblind_type='protanopia')
# correct using daltonization
daltonized_img = colorblind.daltonize_correct(img, colorblind_type='protanopia')
# correct using hsv correction
hsv_img = colorblind.hsv_color_correct(img, colorblind_type='protanopia')
Results
Deuteranopia
Type | Original | Daltonization | HSV Corrected |
---|---|---|---|
Full Color | |||
Simulated |
Protanopia
Type | Original | Daltonization | HSV Corrected |
---|---|---|---|
Full Color | |||
Simulated |
Tritanopia
Type | Original | Daltonization | HSV Corrected |
---|---|---|---|
Full Color | |||
Simulated |
Credits
Mostly inspired by a summary paper of algorithms applicable to making images color-blind friendly. Example: https://www.researchgate.net/publication/326626897_Smartphone_Based_Image_Color_Correction_for_Color_Blindness
Daltonization values came from https://github.com/joergdietrich/daltonize
Further information on color blindness is available at:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
colorblind-0.0.8.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for colorblind-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cf160d24d41b151d4d6767ebaccaaca0d911bdbea8b5533f4ea3f498965dc08 |
|
MD5 | 1155bf3eac5472a4ea310881048cb9b9 |
|
BLAKE2b-256 | 1ef0f421e915261576b6b5aec7ccc6a80f43c5145e4b22c4faee9abb0e466c1b |