Posted 15 May 2016 - 08:46 PM
Working on a compressed image format for a bigger super secret project. Here are the current compression levels I am getting on simple "GUI" images. Do you think this is enough or should I keep working on pushing the compression farther?
For anyone who doesn't want to do the math the output is 73% smaller than the raw image. Advantage over just implementing real world file types is that I can store the text foreground and background all in one file.
It looks like Huffman was negatively impacting most images so now it only uses Huffman if it detects a gain in compression from it. Now 85% compression
raw file 2759 bytes
18 49
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
e11111111111111111111111111111111111111111111111e
e11111111111111111111111111111111111111111111111e
e74444444444444444444444444444444444444444444447e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77888888888888888888888888888888888888888888877e
e77777777777777777777777777777777777777777777777e
2222222222222222222222222222222222222222222222222
2111111111111111111111111111111111111111111111112
2111111111111111111111111111111111111111111111112
2744444444444444444444444444444444444444444444472
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
2777777777777777777777777777777777777777777777772
3333333333333333333333333333333333333333333333333
2222222222222222222222222222222222222222222222222
2111111111random words go here1111111111111111112
2111111111111111111111111111111111111111111111112
2744444444444444444444444444444444444444444444472
277Hello Worldffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277ffffffffffffffThis is a testfffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
277ffffthis is how tests workfffffffffffffffff772
277fffffffffffffffffffffffffffffffffffffffffff772
2777777777777777777777777777777777777777777777772
I can put text here even though theres no back
compressed file using huffman 732 bytes
V@ÁA ÁAAAAÂÂÂÁAÂABBBÂÁÂÂBBBÂBBBBBBBBÂBBBBBBBBBBBBB H¸ôñÂ9 ì°5ô8JaC¼1 ôC¨C". ~&°Só´7½c C)!úÆý|:ò> À8D# ¯&Å'îP¸¤CÁX]ØZ*\)ôè1[($^3yfÀCwðïè~v}ìÿ¨ð!
A¡PÃ(TtÀ]÷
~> O"©À¯ì²"¶ì1c5q7 Ã[ü·
Ù2Áý¥òúÃ%,(¦ d³üb1f¸À:Þ ,°ü÷ã ®ÞÞ¡Àä
¹}o4ÆlîÁìëS¯ï5c&maÀE¹[95%Ø#¤²µVENTBÃî>!¨ä )HAÂèZ#n±.ék+òî%üs»M6OT ·wÞ ¢Ö[üÆÆ[ÞPhéKñegïJAÆÖ5ä°"ØéÍ©0';ßhëj·üìÀTSñÁêILßêbj²ouÅ]ÁVjêC1êð
compressed file not using Huffman 404 bytes
r{@ØýUr
< äÀ À@ Iè>> 8 ¸ Àp Ø ¿
@ G À y ÀI¼ N Àð>> 3A pä
Z3X
s y
yd
x nuT
n\
t wcwvsq
qCs pocqg u)
It looks like Huffman was negatively impacting most images so now it only uses Huffman if it detects a gain in compression from it. Now 85% compression
Edited on 15 May 2016 - 08:18 PM