Closed aldanor closed 2 years ago
Hmm, is that because the initial index load "spoils" the .a
field of the current pixel, and so it computes the hash of (22, 24, 17, 0)
instead of (22, 24, 17, 0xff)
? Btw, in my opinion it may not have been the best decision to zero-initialize the index array; filling it with (0, 0, 0, 0xff) would match the initial default pixel value and this would keep the alpha channel at 0xff for 3-channel images, always. And/or, for 3-channel images, alpha channel could have been ignored when decoding it from index - currently, QOI_OP_INDEX
is the only operation that could mess up the alpha channel in 3-channel decodes, zeroing it out.
(going to try and debug)
Yes, confirming it was an error on my side, loading a [0, 0, 0] from index in a 3-channel mode essentially zeroes out the 0xff alpha channel from the 'current' pixel.
I was digging through some test examples and found a weird one. Apologies in advance if it's something obvious.
Here's a brief example:
which outputs
Note that
@phoboslab any ideas perhaps?