Incorrect image from my Quite OK Image (.qoi) decoder,stumped for hours

https://snap.berkeley.edu/snap/snap.html#present:Username=gnlp&ProjectName=Quite%20OK%20Image%20codec
I'm implementing a decoder for https://qoiformat.org/qoi-specification.pdf that takes a list of numbers in 0..255. https://piglinpotatoes.github.io/testcard_rgba.qoi is decoding as:


Here's ImageMagick displaying that image:

Good work so far :slight_smile:

I love trying to implement things like this from just the specification :slight_smile:

I did an animated GIF one

Every chunk must be decoded to full RGBA.
QOI_OP_RGB, DIFF, LUMA must recreate the last used A value.


I've not done it; I just found that the output is not a square RGBA matrix.

@dardoro I just came here to say that :slight_smile: my current progress as not quite there yet

Closer but still no coconut :slight_smile:

Success :slight_smile:

As well as the missing alphas, the QOI_OP_LUMA code was missing a mod 256

https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=Quite%20OK%20Image%20codec&editMode

Thanks cymplecy and dardoro. There's a shorter way to keep the previous pixel's alpha in DIFF and LUMA: adding the previous pixel to a list where the fourth item is 0 after going through surrounding operators.

Shift :gear: Live coding ... makes this script 10 time faster i.e. 4 compared to 40 s

i tried my hand at speeding it up. lots of cursed hyperblocks but worth it for the lower block count

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.