3 ms·
Some people want to work exclusively with classic 8-bit-color-depth SRGB. And other people need the HDR and color space stuff. Combining both use cases into o
by Dwedit 2y ago
Some people want to work exclusively with classic 8-bit-color-depth SRGB. And other people need the HDR and color space stuff.
Combining both use cases into one format makes the API more complicated. There are some footguns in the compression API for people trying to do the most basic task (SRGB to YCbCr Lossy VarDCT), where if you specify the wrong value in a struct somewhere (I think it was the "Use Original Profile" flag), you get poor quality compression, as it stores the image as RGB rather than going to YCbCr first. Yes, I know I used the API incorrectly.
WEBP had a much simpler API. You just call a few functions to get the dimensions of the image, then you allocate a 24-bit or 32-bit buffer (either RGB or BGR byte order) to load the image into.