The advantage of using this strategy would be the same as the advantage
of using Z_HUFFMAN_ONLY, in that it does not need a sliding window or a
hash table at all. Thus, it considerably reduces the memory requirements
of the encoder by approx. 128 KB. The memory is needed only to store the
Huffman buffer and to construct the Huffman trees. Regarding the execution
speed of Z_RLE, it should be comparable to that of Z_HUFFMAN_ONLY.
The execution speed is expected to be better for the strategy that produces
a smaller output.
We are working on providing a reliable Z_RLE implementation to be integrated
into the official zlib distribution.
This page reflects the current progress of the
Z_RLE implementation.
Given these results, I think Z_RLE is serious enough to
be considered for inclusion in the subsequent releases of zlib. It achieves
a better compression than Z_HUFFMAN_ONLY while maintaining the same complexity
level (no sliding window or hash table), and many times it achieves a better
compression than Z_BEST_SPEED+Z_FILTERED at an even higher speed and at
significantly lower memory requirements. Consequently, I propose to consider
Z_RLE as a replacement of Z_BEST_SPEED as the (default) heuristics, when
the highest compression speed is needed.
kodim01.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
732479
|
Level=3, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
737309
|
|
Z_HUFFMAN_ONLY |
811264
|
|
Z_RLE |
802033
|
|
Z_RLE_FILTERED |
806162
|
|
|
kodim02.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
617865
|
|
Z_BEST_SPEED, Z_FILTERED |
659840
|
|
Z_HUFFMAN_ONLY |
636898
|
|
Z_RLE |
631621
|
|
Z_RLE_FILTERED |
633880
|
|
|
kodim03.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
506794
|
Filter=1, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
595931
|
|
Z_HUFFMAN_ONLY |
582414
|
|
Z_RLE |
573748
|
|
Z_RLE_FILTERED |
578330
|
|
|
kodim04.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
637302
|
|
Z_BEST_SPEED, Z_FILTERED |
674590
|
|
Z_HUFFMAN_ONLY |
665420
|
|
Z_RLE |
659514
|
|
Z_RLE_FILTERED |
662747
|
|
|
kodim05.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
782790
|
Level=3, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
791803
|
|
Z_HUFFMAN_ONLY |
830739
|
|
Z_RLE |
823712
|
|
Z_RLE_FILTERED |
827763
|
|
|
kodim06.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
631753
|
Filter=1, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
688245
|
|
Z_HUFFMAN_ONLY |
715134
|
|
Z_RLE |
709775
|
|
Z_RLE_FILTERED |
713414
|
|
|
kodim07.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
558405
|
Filter=1
|
Z_BEST_SPEED, Z_FILTERED |
633007
|
|
Z_HUFFMAN_ONLY |
607587
|
|
Z_RLE |
598822
|
|
Z_RLE_FILTERED |
603083
|
|
|
kodim08.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
772010
|
Level=3, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
777854
|
|
Z_HUFFMAN_ONLY |
813056
|
|
Z_RLE |
804645
|
|
Z_RLE_FILTERED |
808533
|
|
|
kodim09.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
582769
|
|
Z_BEST_SPEED, Z_FILTERED |
626159
|
|
Z_HUFFMAN_ONLY |
618891
|
|
Z_RLE |
611683
|
|
Z_RLE_FILTERED |
616175
|
|
|
kodim10.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
593333
|
|
Z_BEST_SPEED, Z_FILTERED |
638947
|
|
Z_HUFFMAN_ONLY |
630399
|
|
Z_RLE |
622645
|
|
Z_RLE_FILTERED |
627057
|
|
|
kodim11.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
629756
|
Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
664488
|
|
Z_HUFFMAN_ONLY |
692514
|
|
Z_RLE |
680871
|
|
Z_RLE_FILTERED |
687324
|
|
|
kodim12.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
533892
|
Filter=1, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
614485
|
|
Z_HUFFMAN_ONLY |
608036
|
|
Z_RLE |
600097
|
|
Z_RLE_FILTERED |
604337
|
|
|
kodim13.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
825519
|
Level=2, Filter=1, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
831775
|
|
Z_HUFFMAN_ONLY |
901623
|
|
Z_RLE |
899707
|
|
Z_RLE |
897723
|
Non-lazy
|
Z_RLE_FILTERED |
899707
|
|
|
kodim14.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
703800
|
Filter=1, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
736728
|
|
Z_HUFFMAN_ONLY |
770736
|
|
Z_RLE |
762875
|
|
Z_RLE_FILTERED |
767461
|
|
|
kodim15.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
603229
|
Filter=2, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
662264
|
|
Z_HUFFMAN_ONLY |
651709
|
|
Z_RLE |
642043
|
|
Z_RLE_FILTERED |
645206
|
|
|
kodim16.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
541217
|
Filter=1, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
604958
|
|
Z_HUFFMAN_ONLY |
627751
|
|
Z_RLE |
619932
|
|
Z_RLE_FILTERED |
624553
|
|
|
kodim17.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
610346
|
Filter=1, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
653295
|
|
Z_HUFFMAN_ONLY |
654799
|
|
Z_RLE |
647901
|
|
Z_RLE_FILTERED |
652129
|
|
|
kodim18.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
772747
|
Level=3, Filter=3, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
780453
|
|
Z_HUFFMAN_ONLY |
787888
|
|
Z_RLE |
786328
|
|
Z_RLE_FILTERED |
787725
|
|
|
kodim19.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
667061
|
Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
684366
|
|
Z_HUFFMAN_ONLY |
685407
|
|
Z_RLE |
682900
|
|
Z_RLE_FILTERED |
685043
|
|
|
kodim20.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
498043
|
Filter=1, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
545036
|
|
Z_HUFFMAN_ONLY |
539409
|
|
Z_RLE |
528864
|
|
Z_RLE_FILTERED |
524956
|
|
|
kodim21.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
651536
|
Filter=1, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
689068
|
|
Z_HUFFMAN_ONLY |
698324
|
|
Z_RLE |
695215
|
|
Z_RLE_FILTERED |
697370
|
|
|
kodim22.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
701840
|
|
Z_BEST_SPEED, Z_FILTERED |
728751
|
|
Z_HUFFMAN_ONLY |
710112
|
|
Z_RLE |
708193
|
|
Z_RLE_FILTERED |
709290
|
|
|
kodim23.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
557466
|
|
Z_BEST_SPEED, Z_FILTERED |
616796
|
|
Z_HUFFMAN_ONLY |
572045
|
|
Z_RLE |
567744
|
|
Z_RLE_FILTERED |
569511
|
|
|
kodim24.png
|
Level+Strategy |
IDAT size |
Comments |
Best compression (pngcrushed) |
698106
|
Filter=2, Strategy=0
|
Z_BEST_SPEED, Z_FILTERED |
725410
|
|
Z_HUFFMAN_ONLY |
748763
|
|
Z_RLE |
728071
|
|
Z_RLE_FILTERED |
732744
|
|
|