powturbo/Turbo-Run-Length-Encoding

Compress less than 1 byte symbol data

cevek opened this issue · 2 comments

cevek commented

Can I compress data with using less than 1 byte per symbol, for example 5bits?
I have some image data using only 32 colors - 5 bits per pixel, and so I need to compress it 🔢 :)
How can I do that? Or only 1 byte per pixel?

You'll get better results with byte aligned and uncompressed skewed data with lot of repetitions. For example BMP images. See the benchmark on the readme file.

cevek commented

So, I reduce colors to 16(4bits per pixel) and align 2pixels into 1 byte
Results is very different:

Original: 1024000
1 byte aligned: 
    TRLE: 115822
    LZ4:   89738
1 byte 2 pixels: 
    TRLE: 79861
    LZ4:  67699