ditherit-v2 icon indicating copy to clipboard operation
ditherit-v2 copied to clipboard

Add Gamma Correction

Open alexharris opened this issue 4 years ago • 4 comments

from @farteryhr on twitter:

but here's my only one more wish, please add gamma correction.. for reference, see: http://entropymine.com/imageworsener/ https://bisqwit.iki.fi/story/howto/dither/jy/

alexharris avatar Nov 12 '20 17:11 alexharris

This is definitely something important to add. No dithering can really be considered "correct" unless it linearizes image values when doing numerical operations, only delinearizing (sRGB) for display or encoding purposes. Otherwise the operations won't affect different pixel values equally.

Here's a gradient dithered without gamma correction:

image

And with it:

image

Source: https://surma.dev/things/ditherpunk/

Make sure to view these images at 100% size.

makew0rld avatar Feb 08 '21 03:02 makew0rld

Hi, ok thanks for the 2nd. This is on the list, as you can see, just gotta figure out how to do it? Pull requests welcome ><

alexharris avatar Feb 08 '21 17:02 alexharris

Actually this would be something RgbQuant.js would have to do, isn't it? Maybe it already does this.

makew0rld avatar Feb 08 '21 18:02 makew0rld

It doesn't as far as I know. But yeah if I figured it out I would probably just submit a PR to RgbQuant.js

alexharris avatar Feb 08 '21 18:02 alexharris