Hello Color
A basic example:
from tinycio import TransferFunction, fsio
try:
# Linearize an image
im_srgb = fsio.load_image('my/srgb_image.png')
im_linear = TransferFunction.srgb_eotf(im_srgb)
fsio.save_image(im_linear, 'my/linear_image.png')
except Exception as e:
print(e) # your error handling here
This package is divided into four user modules:
tinycio
- for all main color-related features and typestinycio.fsio
- for loading from and saving to the file systemtinycio.util
- for miscellaneous color and non-color utility functionstinycio.numerics
- for base numeric vector data types
It also exposes a few (optional) high-level abstractions to cut out a lot of the tedium:
ColorImage
- 3-channel float32 color image typeColor
- 3-component float32 color typeChromaticity
- 2-component float32 CIE xy chromaticity type
Exceptions may occur at any point, but exception handling will be omitted from subsequent code snippets for brevity.