+
Skip to content

A simple library for color conversions between xyz color rgb color and sigmoided polynomial spectral representations as outlined in https://www.pbrt.org/.

Notifications You must be signed in to change notification settings

kb9113/odin-color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Odin Color

Searchable documentation is available at https://calebmanning.net/odin-color/.

A simple library for color conversions between xyz color rgb color and sigmoided polynomial spectral representations as outlined in https://www.pbrt.org/. However I use the actual jacobian for gauss newton optimization since it gives a smaller error to the target color.

This library also provides conversions based on approximate color match functions and whitepoint functions which can be cheaper when you need to perform conversions back on the gpu.

This library is used by bonsai_rt my physically based renderer.

Example converting to sigmoided polynomial representations and back again

xyz := srgb_to_xyz(srgbu8_to_srgb(SRGBU8Color{34, 167, 89}))
spoly, err := xyz_d65_to_spoly(xyz)

xyz_or_spoly := spoly_to_xyz_d65(spoly)
assert(linalg.length(xyz_or_spoly - xyz) < 1e-3)

Example using approximations of the xyz color match functions and d65 white point

xyz := srgb_to_xyz(srgbu8_to_srgb(rgb))
spoly, err := approximate_xyz_d65_to_spoly(xyz)

xyz_or_spoly := approximate_spoly_to_xyz_d65(spoly)
assert(linalg.length(xyz_or_spoly - xyz) < 1e-3)

About

A simple library for color conversions between xyz color rgb color and sigmoided polynomial spectral representations as outlined in https://www.pbrt.org/.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载