Zorba the Hutt (zorbathut) wrote,
Zorba the Hutt

My algorithm just informed me that it succeeded compressing an image with zero bits per pixel.

After some work I finally figured out what it was doing.

The image in question is entirely black. So it generated the palette and observed that there was a grand total of one item in it.

Well, the basic formula is "possible_items = 2^bits". If possible_items = 1, bits = 0.

So it concluded that it could encode all the visible data in zero bits per pixel.

The ironic thing is, it's *right*. If there's only one palette entry then it obviously doesn't need to branch to find out which it is - it *knows*. It's that palette entry! There's only one value that's *possible*!

End result . . . it encodes the picture with zero bits per pixel.

Plus the palette, of course.

(It makes sense . . . it's just kind of disturbing when you see it for the first time :P)

Incidentally, it's generally holding at under 2 bits per pixel overall, which isn't bad compression at all.
  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.