phoboslab / qoi

The “Quite OK Image Format” for fast, lossless image compression
MIT License
6.92k stars 330 forks source link

Specify that index entries get renewed #193

Closed Tiefseetauchner closed 2 years ago

Tiefseetauchner commented 2 years ago

I didn't see this pop up anywhere, but I just got messed up by me thinking that entries into the index array are final. I couldn't tell from the specs and deliberately didn't look at the given encoder.

Maybe clarify in the specs that the index array elements get overriden when a pixel with the same hash is found

ratchetfreak commented 2 years ago

It is specified in this sentence of the index array:

Each pixel that is seen by the encoder and decoder is put into this array at the position formed by a hash function of the color value.

I would interpret that as a continuously updating array even when all indices have been touched

Tiefseetauchner commented 2 years ago

Ok, after reading it four times, I can see it. It does say it, but not as explicitly as I'd have written it. Possibly worse for me cuz I'm not native and comparatively young and inexperienced with reading specs...

Thanks!