phoboslab / qoi

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

Proposal to extend usage of [00 Index] OP-Code #232

Closed zelosos closed 2 years ago

zelosos commented 2 years ago

The OP_CODE_INDEX [00 index] is specified to only be used once. OP_CODE_RUN [11 run] should be used instead of OP_CODE_INDEX twice. This leaves the option [00 ????] [00 ????] unsed.

I propose if the OP_CODE_INDEX [00 index] index is used twice it should be interpreted as a longer version of the index: [00 Index1] [00 Index2] with total_index = Index1 + Index2 concatenated. Thus a second hashtable would be used for that.

As an alternative [00 Index] [00 dr dg db] could be used to combine OP_CODE_INDEX with OP_CODE_DIFF for a single pixel.

In both cases O(n) would still apply to the algorithm. Tests of the usefullness would be necassery.

shuckster commented 2 years ago

The spec is final. Check the README under the "Improvements..." header.

zelosos commented 2 years ago

ok i am closing this issue then.