Well, here is several methods of compression images and several types (8 bits per pixel, 16 bits per pixel). 8 bpp is palette oriented images, but 16 bpp (used in A7, for example in SJ5000+) do not use palette.
I while not work with 8 bpp images, but i was able to decode 16 bpp images with compression method 3.
This si bitmaps.bin from Xiaomi Yi with 8 bpp images and compression method "0":
As you see i not decode colors correctly.
This is bitmaps.bin form SJ5000+ with 16 bpp images:
Here colors is decoded correctly. Note the compression method - here it is "3", not "0".
And there are the multi-frame images:
In general, I decided all the problems with compression.
May be you try apply palette to 16 bpp images, that do not need it?
В двух словах: я не занимался плотно 8-битными изображениями, меня интересовали 16-битные, с ними у меня и были проблемы сжатия. При этом моя же программа после сжатия читала их корректно, а камера сходила с ума. Сжатие 8-битных и 16-битных изображений отличаются, кстати. Кроме того, в 16-битных палитра не применяется, там цвет закодирован непосредственно.
А еще бывают многокадровые изображения. Принцип их упаковки я понял, но пока не стал возиться с их декодированием и выводом на экран.
В принципе, я свои проблемы со сжатием порешал, все работает