Skip to content

Numpy fast implementation for converting RGB to HCY and HCY to RGB

Notifications You must be signed in to change notification settings

Mathux/HCY-Tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

HCY-Tools

Numpy implementation for converting RGB to HCY and HCY to RGB

Author

Mathis Petrovich

Usage

Import the functions

from hcy import rgb2hcy, hcy2rgb

Load an image (pixels have to be between 0 and 1)

import imageio
img = imageio.imread("lena.png") / 255.

Convert the image

hcy_img = rgb2hcy(img)
oimg = hcy2rgb(hcy_img)
assert np.max(np.abs(oimg - img)) < 10**(-13)

About

Numpy fast implementation for converting RGB to HCY and HCY to RGB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages