TinyVG / specification

The specification for TinyVG. This is the central authority for the file system
https://tinyvg.tech/
MIT License
246 stars 7 forks source link

Clarify that gradients are interpolated in linear color space #14

Closed ikskuh closed 2 years ago

ikskuh commented 2 years ago

person on lobste.rs wrote: Gradients are implicitly in sRGB’s pseudo-gamma space, therefore incorrect. See reference rendering.

ikskuh commented 2 years ago

It should be specified in which color space and color format the interpolation should happen:

http://scanline.ca/gradients/

The most widespread one is probably "linear RGB interpolation", so this would be a good choice here.

ikskuh commented 2 years ago

The math for gradient blending is fairly easy and i've implemented a verification shader on shadertoy.com.

Colors need to be interpolated in linear color space and require gamma application after that:

NOTE: This image must be viewed without any scaling! Otherwise the bayer dithering won't work properly

ikskuh commented 2 years ago

Fixed.