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: red-green weakness, particularly green
- Protanopia: red-green weakness, particularly red
- Tritanopia: blue weakness
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.9.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for colorblind-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35c0dbdba062587c2666854910f69b3b84c606db3750d122c020adbfcbae94b4 |
|
MD5 | 15a4b849ebf6a87cc3578160ff3b988d |
|
BLAKE2b-256 | b77c6bff2cc11fe78ca81fadf979dbf281284420d8e7f1f75317a97e45136efa |