Add more GIF benchmarks

The existing benchmarks decoded realistic photos. The new benchmarks
also decode artificially generated images, which compress better.

Also adjust script/extract-giflzw.go to optionally analyze and print a
histogram of LZW code emission lengths. "Compresses better" is highly
correlated with "a lower proportion of literal (1 length) codes".
This commit is contained in:
Nigel Tao committed 2018-10-21 11:46:37 +11:00
1 parent 6945bdc75c
commit 8d7bd36179
19 files changed
+521 -40

No files matched your search

+8 -2
View File
@@ -41,11 +41,17 @@ hat.\* are various encodings of a photo of "Self-Portrait with a Straw Hat
Museum of art. `http://www.metmuseum.org/art/collection/search/436532` lists
that image as in the public domain.
hibiscus.\* are various encodings of a photo of "Hibiscus and Parrots" by Louis
Comfort Tiffany, held by the Metropolitan Museum of Art.
hibiscus.regular.\* are various encodings of a photo of "Hibiscus and Parrots"
by Louis Comfort Tiffany, held by the Metropolitan Museum of Art.
`http://www.metmuseum.org/art/collection/search/13503` lists that image as in
the public domain.
hibiscus.primitive.\* is the result of running the hibiscus.regular.png image
through `github.com/fogleman/primitive` and other programs:
- `primitive -i hibiscus.regular.png -o hibiscus.primitive.svg -s 442 -n 32`
- `inkscape -z -e hibiscus.primitive.png hibiscus.primitive.svg`
- Various invocations of `convert` and `cwebp`
hippopotamus.\* are various encodings of a cropping of a photo of "Hippopotamus
(William)", held by the Metropolitan Museum of Art.
`http://www.metmuseum.org/art/collection/search/544227` lists that image as in
@@ -0,0 +1,227 @@
# To reproduce this analysis:
#
# cd ..
# go run ../../script/extract-giflzw.go -histogram -allframes *.gif > analysis/giflzw-emission-lengths.txt
animated-red-blue.gif (all frames)
Percent Count Emission_Length_Bucket
49.23 542 1 (Literal Code)
5.27 58 2
6.36 70 3
5.99 66 4
4.18 46 5
3.54 39 6
2.45 27 7
1.73 19 8
9.36 103 9 .. 16
7.18 79 17 .. 32
4.72 52 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
bricks-dither.gif (all frames)
Percent Count Emission_Length_Bucket
45.58 4853 1 (Literal Code)
35.89 3821 2
13.23 1409 3
3.82 407 4
1.04 111 5
0.31 33 6
0.08 9 7
0.02 2 8
0.02 2 9 .. 16
0.00 0 17 .. 32
0.00 0 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
bricks-gray.gif (all frames)
Percent Count Emission_Length_Bucket
47.34 4980 1 (Literal Code)
31.91 3357 2
14.30 1504 3
4.53 476 4
1.34 141 5
0.42 44 6
0.14 15 7
0.02 2 8
0.00 0 9 .. 16
0.00 0 17 .. 32
0.00 0 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
bricks-nodither.gif (all frames)
Percent Count Emission_Length_Bucket
41.39 3982 1 (Literal Code)
32.93 3168 2
16.13 1552 3
5.93 570 4
2.21 213 5
0.95 91 6
0.31 30 7
0.09 9 8
0.05 5 9 .. 16
0.00 0 17 .. 32
0.00 0 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
gifplayer-muybridge.gif (all frames)
Warning: frame #60: block data is not valid LZW: unexpected EOF
Warning: frame #89: block data is not valid LZW: unexpected EOF
Percent Count Emission_Length_Bucket
12.78 34658 1 (Literal Code)
14.05 38106 2
13.25 35937 3
10.59 28707 4
7.85 21286 5
6.08 16481 6
4.85 13156 7
3.60 9764 8
9.34 25318 9 .. 16
4.89 13257 17 .. 32
4.78 12954 33 .. 64
4.72 12806 65 .. 128
3.02 8190 127 .. 256
0.20 550 256+
harvesters.gif (all frames)
Percent Count Emission_Length_Bucket
46.73 269145 1 (Literal Code)
39.51 227566 2
10.13 58353 3
2.39 13766 4
0.71 4106 5
0.26 1509 6
0.11 622 7
0.05 291 8
0.08 485 9 .. 16
0.02 100 17 .. 32
0.01 57 33 .. 64
0.00 1 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
hat.gif (all frames)
Percent Count Emission_Length_Bucket
80.52 6758 1 (Literal Code)
19.03 1597 2
0.39 33 3
0.01 1 4
0.01 1 5
0.01 1 6
0.02 2 7
0.00 0 8
0.00 0 9 .. 16
0.00 0 17 .. 32
0.00 0 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
hibiscus.primitive.gif (all frames)
Percent Count Emission_Length_Bucket
25.86 5566 1 (Literal Code)
19.05 4100 2
11.30 2433 3
7.30 1571 4
5.43 1168 5
4.34 934 6
3.23 695 7
2.55 548 8
11.13 2396 9 .. 16
6.81 1466 17 .. 32
2.89 623 33 .. 64
0.10 22 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
hibiscus.regular.gif (all frames)
Percent Count Emission_Length_Bucket
47.48 37363 1 (Literal Code)
36.43 28663 2
11.91 9370 3
2.94 2311 4
0.81 637 5
0.22 177 6
0.09 74 7
0.04 31 8
0.06 50 9 .. 16
0.02 14 17 .. 32
0.00 0 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
hippopotamus.interlaced.gif (all frames)
Percent Count Emission_Length_Bucket
82.56 672 1 (Literal Code)
13.02 106 2
3.19 26 3
0.74 6 4
0.25 2 5
0.25 2 6
0.00 0 7
0.00 0 8
0.00 0 9 .. 16
0.00 0 17 .. 32
0.00 0 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
hippopotamus.regular.gif (all frames)
Percent Count Emission_Length_Bucket
82.66 672 1 (Literal Code)
13.04 106 2
2.83 23 3
0.86 7 4
0.37 3 5
0.25 2 6
0.00 0 7
0.00 0 8
0.00 0 9 .. 16
0.00 0 17 .. 32
0.00 0 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
muybridge.gif (all frames)
Percent Count Emission_Length_Bucket
80.23 5863 1 (Literal Code)
16.80 1228 2
2.63 192 3
0.27 20 4
0.07 5 5
0.00 0 6
0.00 0 7
0.00 0 8
0.00 0 9 .. 16
0.00 0 17 .. 32
0.00 0 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
pjw-thumbnail.gif (all frames)
Percent Count Emission_Length_Bucket
2.80 4 1 (Literal Code)
5.59 8 2
8.39 12 3
11.19 16 4
10.49 15 5
9.09 13 6
9.79 14 7
8.39 12 8
32.17 46 9 .. 16
2.10 3 17 .. 32
0.00 0 33 .. 64
0.00 0 65 .. 128
0.00 0 127 .. 256
0.00 0 256+
Binary file not shown.

After

Width:  |  Height:  |  Size: 539 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

+37
View File
@@ -0,0 +1,37 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="312" height="442">
<rect x="0" y="0" width="312" height="442" fill="#7a754d" />
<g transform="scale(1.726562) translate(0.5 0.5)">
<polygon fill="#fbe59c" fill-opacity="0.501961" points="16,11 131,15 13,174" />
<polygon fill="#fff1c2" fill-opacity="0.501961" points="164,201 169,63 74,173" />
<polygon fill="#121f15" fill-opacity="0.501961" points="44,141 190,271 -16,253" />
<polygon fill="#001b35" fill-opacity="0.501961" points="148,158 98,71 48,98" />
<polygon fill="#000000" fill-opacity="0.501961" points="196,110 168,199 171,11" />
<polygon fill="#000000" fill-opacity="0.501961" points="-16,111 11,205 11,23" />
<polygon fill="#4b3c00" fill-opacity="0.501961" points="-16,39 93,79 7,-16" />
<polygon fill="#000000" fill-opacity="0.501961" points="52,-16 -16,13 147,8" />
<polygon fill="#000000" fill-opacity="0.501961" points="171,128 196,230 167,271" />
<polygon fill="#c6c320" fill-opacity="0.501961" points="116,11 168,10 168,133" />
<polygon fill="#f3e4d2" fill-opacity="0.501961" points="11,67 55,55 25,181" />
<polygon fill="#f9f2ec" fill-opacity="0.501961" points="77,12 135,26 71,61" />
<polygon fill="#f1d8bc" fill-opacity="0.501961" points="87,195 159,151 80,146" />
<polygon fill="#9b9036" fill-opacity="0.501961" points="13,205 15,242 141,240" />
<polygon fill="#fff2e2" fill-opacity="0.501961" points="115,106 155,97 155,151" />
<polygon fill="#000000" fill-opacity="0.501961" points="111,-1 184,-16 196,19" />
<polygon fill="#000003" fill-opacity="0.501961" points="-16,234 144,249 18,271" />
<polygon fill="#f3e06b" fill-opacity="0.501961" points="100,133 48,138 52,105" />
<polygon fill="#00000c" fill-opacity="0.501961" points="10,143 -16,174 11,271" />
<polygon fill="#00213f" fill-opacity="0.501961" points="23,171 64,141 97,239" />
<polygon fill="#ffe610" fill-opacity="0.501961" points="116,107 171,87 108,90" />
<polygon fill="#cfb32e" fill-opacity="0.501961" points="8,11 92,12 60,47" />
<polygon fill="#002250" fill-opacity="0.501961" points="95,71 74,95 154,85" />
<polygon fill="#707625" fill-opacity="0.501961" points="78,241 160,243 170,173" />
<polygon fill="#2b4a4b" fill-opacity="0.501961" points="138,136 65,55 118,159" />
<polygon fill="#100016" fill-opacity="0.501961" points="10,132 -16,31 12,-16" />
<polygon fill="#fcebec" fill-opacity="0.501961" points="143,198 122,174 161,169" />
<polygon fill="#1b0611" fill-opacity="0.501961" points="196,76 170,166 172,-16" />
<polygon fill="#9fa041" fill-opacity="0.501961" points="40,208 13,197 24,152" />
<polygon fill="#889023" fill-opacity="0.501961" points="159,52 52,57 175,90" />
<polygon fill="#826815" fill-opacity="0.501961" points="103,149 35,122 36,147" />
<polygon fill="#b19c5d" fill-opacity="0.501961" points="125,157 75,181 93,198" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 404 KiB

After

Width:  |  Height:  |  Size: 404 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 109 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 201 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 246 KiB

After

Width:  |  Height:  |  Size: 246 KiB

File renamed without changes.