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
Built Distribution
File details
Details for the file colorblind-0.0.9.tar.gz
.
File metadata
- Download URL: colorblind-0.0.9.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71899d3bf14a6be74f5408aed8ba0ef938230e90d850e49ef0e46e9eef3fc7a5 |
|
MD5 | f55848125819ab39aa44a81d45830dd9 |
|
BLAKE2b-256 | 0718a6d246954973e88104a1b0776f081aa394f8e031912b43d7ff0d8b9d4b1f |
File details
Details for the file colorblind-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: colorblind-0.0.9-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35c0dbdba062587c2666854910f69b3b84c606db3750d122c020adbfcbae94b4 |
|
MD5 | 15a4b849ebf6a87cc3578160ff3b988d |
|
BLAKE2b-256 | b77c6bff2cc11fe78ca81fadf979dbf281284420d8e7f1f75317a97e45136efa |