-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathreport.html
305 lines (305 loc) · 14.5 KB
/
report.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="ReText 7.0.0">
<link rel="stylesheet" media="screen" href="style.css" type="text/css" />
<title>Report</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
extensions: ["MathMenu.js", "MathZoom.js"],
TeX: {
equationNumbers: {autoNumber: "AMS"}
}
});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script></head>
<body>
<h1>Image formats comparison</h1>
<h2>Introduction</h2>
<p>This study compares 8 differents image formats, AOM AV1, BPG, Daala, FLIF, JPEG XR, JPEG 2000, JPEG and WebP. We use five algorithms in order to compare each format:</p>
<ul>
<li>VMAF: Video Multi-Method Assessment Fusion: <a href="http://techblog.netflix.com/2016/06/toward-practical-perceptual-video.html">http://techblog.netflix.com/2016/06/toward-practical-perceptual-video.html</a></li>
<li>Y-SSIM: Structural Similarity algorithm applied to the luma channel</li>
<li>RGB-SSIM: Structural Similarity algorithm applied to the R, G and B channels</li>
<li>Y-MSSIM: Multi-Scale Structural Similarity algorithm applied to the luma channel</li>
<li>PSNR-HVS-M: Peak Signal to Noise Ratio taking into account Contrast Sensitivity Function (CSF) and between-coefficient contrast masking of DCT basis functions</li>
</ul>
<h2>Materials</h2>
<h3>Image set</h3>
<p>The image set is comprised of 50 images from <a href="https://wiki.xiph.org/Daala_Quickstart#Test_Media">the subset 1 and subset 2 maintened by Xiph</a>. All images are YCbCr 4:2:0 Y4M files.</p>
<h3>Codecs</h3>
<ul>
<li>Alliance for Open Media AV1: <code>https://aomedia.googlesource.com/aom/</code>. The versions used are built from GIT revision <code>02affd269df5d8abbfc75f5bdad0c080308e0ce1</code> (october 2016), <code>ce7272d2d00f224475849c1b1bca0a97b70ea0c4</code> (july 2017) and <code>7d3bd8daba6e51566f0458e3f842e246a559ea82</code> (february 2018).</li>
<li>Fabrice Bellard BPG: `https://github.com/mirrorer/libbpg. The version used is 0.9.7.</li>
<li>Xiph Daala: <code>https://git.xiph.org/?p=daala.git</code>. The version used is built from GIT revision <code>72783687ce4963478b8ab4d97809510f40c7c855</code>.</li>
<li>Jon Sneyers FLIF: <code>https://github.com/FLIF-hub/FLIF</code>. The version used is built from GIT revision <code>c17459bab5399ed5009c262e9954d474f275db7f</code>.</li>
<li>Microsoft JxrLib: <code>https://jxrlib.codeplex.com/</code>. The version used is built from GIT revision <code>e922fa50cdf9a58f40cad07553bcaa2883d3c5bf</code>.</li>
<li>Kakadu JPEG2000: <code>http://kakadusoftware.com/downloads/</code>. The version used is 7.10.2.</li>
<li>Mozilla JPEG Encoder: <code>https://github.com/mozilla/mozjpeg</code>. The version used is 3.3.1.</li>
<li>Google VP9: <code>https://chromium.googlesource.com/webm/libvpx</code>. The version used is 1.7.0.</li>
<li>Google WebP: <code>https://chromium.googlesource.com/webm/libwebp</code>. The version used is 0.6.1.</li>
<li>Google Pik: <code>https://github.com/google/pik</code>. The version used is built from GIT revision <code>52f2d45cc8e35e45278da54615bb8b11b5066f16</code>.</li>
</ul>
<h3>Metrics</h3>
<ul>
<li>
<p>The VMAF (Video Multi-Method Assessment Fusion) metric is computed using <code>vmafossexec</code>, provided by Netflix: <code>https://github.com/Netflix/vmaf</code>. The version used is built from GIT revision <code>7ebbde0c64493af978da66cb7ebe2946fb12dec2</code>.</p>
<p><code>vmafossexec</code> compares two YUV files, given their subsampling and dimensions.</p>
</li>
<li>
<p>Y-MSSIM, Y-SSIM, RGB-SSIM and PNSR-HVS-M are computed by the tools <code>dump_msssim</code>, <code>dump_ssim</code> and <code>dump_psnrhvs</code>, provided by the Daala repository: <code>https://git.xiph.org/?p=daala.git</code>. The version used is built from GIT revision <code>05243557bc3e59872fd043c99dc4c17ca33bcb1b</code>.</p>
<p>Each metric compares two Y4M files.</p>
</li>
</ul>
<h3>Tools</h3>
<ul>
<li><code>ffmpeg</code> is used for image formats conversion. The version used is ffmpeg 3.3.2.</li>
<li><code>gm identify</code> is used to determine the width and height of images. The version used is GraphicsMagick 1.3.25.</li>
<li>Python 3 timeit is used to mesure computing times.</li>
<li>Python 3 Pandas and Numpy are used to compute means.</li>
<li>Python 3 Matplot is used to plot graphs.</li>
</ul>
<h2>Methods</h2>
<h3>Image conversion</h3>
<p>Each Y4M image is exported to 4:2:0 PNG, YUV and PPM files with FFMPEG:</p>
<p><code>ffmpeg -loglevel quiet -y -i [input] -pix_fmt yuv420p [output]</code></p>
<h3>Image compression</h3>
<p>All images are compressed losslessly and over a range of qualities for each codec:</p>
<ul>
<li>
<p>BPG: </p>
<ul>
<li>lossless: <code>bpgenc -m 8 -f 420 -lossless -o [output] [input(PNG)]</code></li>
<li>between q=3 and q=45: <code>bpgenc -m 8 -f 420 -q $q -o [output] [input(PNG)]</code></li>
</ul>
</li>
<li>
<p>AV1:</p>
<ul>
<li>lossless: <code>aomenc --cpu-used=2 --tile-columns=4 --passes=2 --lossless=1 -o [output] [input(Y4M)]</code></li>
<li>between q=5 and q=63: <code>aomenc --cpu-used=2 --tile-columns=4 --passes=2 --end-usage=q --cq-level=$q -o [output] [input(Y4M)]</code></li>
</ul>
</li>
<li>
<p>Daala:</p>
<ul>
<li>lossless: <code>encoder_example -v 0 -o [output] [input(Y4M)]</code></li>
<li>between q=5 and q=85: <code>encoder_example -v $q -o [output] [input(Y4M)]</code></li>
</ul>
</li>
<li>
<p>FLIF:</p>
<ul>
<li>lossless: <code>flif -Q 100 [input(PNG)] [output]</code></li>
<li>between q=-329 and q=79, with a step of 12: <code>flif -Q $q [input(PNG)] [output]</code></li>
</ul>
</li>
<li>
<p>JPEG2000:</p>
<ul>
<li>lossless: <code>kdu_compress -no_info Creversible=yes -slope 0 -o [output] -i [input(PPM)]</code></li>
<li>between q=38912 and q=45056, with a step of 64: <code>kdu_compress -no_info -slope $q -o [output] -i [input(PPM)]</code></li>
</ul>
</li>
<li>
<p>JPEG XR:</p>
<ul>
<li>lossless: <code>JxrEncApp -d 1 -q 1 -o [output] -i [input(PPM)]</code></li>
<li>between q=5 and q=85: <code>JxrEncApp -d 1 -q $q -o [output] -i [input(PPM)]</code></li>
</ul>
</li>
<li>
<p>MozJPEG:</p>
<ul>
<li>lossless: <code>cjpeg -rgb -quality 100 [input(PNG)] > [output]</code></li>
<li>between q=5 and q=95: <code>cjpeg -quality $q [input(PNG)] > [output]</code></li>
</ul>
</li>
<li>
<p>Pik:</p>
<ul>
<li>between q=0.5 and q=3.0: <code>cpik [input(PNG)] [output] --distance $q</code></li>
</ul>
</li>
<li>
<p>VP9:</p>
<ul>
<li>lossless: <code>aomenc --cpu-used=2 --tile-columns=4 --passes=2 --lossless=1 -o [output] [input(Y4M)]</code></li>
<li>between q=5 and q=63: <code>aomenc --cpu-used=2 --tile-columns=4 --passes=2 --end-usage=q --cq-level=$q -o [output] [input(Y4M)]</code></li>
</ul>
</li>
<li>
<p>WebP:</p>
<ul>
<li>lossless: <code>cwebp -mt -z 9 -lossless -o [output] [input(PNG)]</code></li>
<li>between q=5 and q=95: <code>cwebp -mt -q $q -o [output] [input(PNG)]</code></li>
</ul>
</li>
</ul>
<p>The Python script used to generate the compressed images are available on <a href="https://github.com/WyohKnott/image-comparison-sources">the GIT repository</a>.</p>
<h3>Image selection</h3>
<p>The images which will be displayed on the website are then chosen among all compressed images, using the following criteria:</p>
<ul>
<li>The BPG file at quality 24 is chosen to be the reference filesize for <em>large</em> quality images.</li>
<li>The filesize for <em>medium</em> quality images is 60% of the <em>large</em> filesize.</li>
<li>The filesize for <em>small</em> quality images is 60% of the <em>medium</em> filesize.</li>
<li>The filesize for <em>tiny</em> quality images is 60% of the <em>small</em> filesize.</li>
</ul>
<p>The Python script used to select the compressed images are available on <a href="https://github.com/WyohKnott/image-comparison-sources">the GIT repository</a>.</p>
<h3>Encoding and decoding speeds:</h3>
<h4>Lossless compression and speed</h4>
<p>For each codec and image, the encoding and decoding speeds for lossless compression are sampled using Python <code>timeit</code>.
The arithmetic mean of encoding and decoding speeds are calculated over the entire image set. We then determine a <a href="https://en.wikipedia.org/wiki/Weissman_score">Weissman score</a> for each codec using the following formula:</p>
<p>
<script type="math/tex; mode=display">W = \alpha {r \over \overline{r}} {\log{\overline{T}} \over \log{T}}</script>
</p>
<p>where <code>r</code> is the compression ratio over PPM filesize, <code>T</code> the time required to compress, <code>̅r</code> and <code>̅T</code> the same metrics for the standard compressor, and alpha is a scaling constant.</p>
<p>The standard compressor used is the compression of a JPG image using mozjpeg.</p>
<h3>Lossy metrics</h3>
<p>For each codec and image, we apply the following metrics, Y-SSIM, RGB-SSIM, Y-MSSSIM, PSNR-HVS-M and VMAF, over 15 image samples of increasing quality. For VMAF, we use the trained model <code>nflxall_vmafv4.pkl</code> given by Netflix.</p>
<p>For each sample, we first decode the compressed image, then export the resulting file to 4:2:0 Y4M and YUV format using FFMPEG (<code>ffmpeg -loglevel quiet -y -i [input] -pix_fmt yuv420p [output]</code>). Finally we apply the metrics over each sample, comparing it to the original image.</p>
<p>For each codec, we calculate the arithmetic mean of each metric over the entire set of images, weighted by the area of the corresponding picture, for the 15 samples of increasing quality:</p>
<p>
<script type="math/tex; mode=display">\overline{metric}_{quality\ q} = \frac{ \sum\limits_{picture=1}^{50} metric_{qp} \times area_{p}}{\sum\limits_{p=1}^{50} area_{p}}</script>
</p>
<p>We also determine the average bits per pixel for each quality sample:</p>
<p>
<script type="math/tex; mode=display">\overline{bpp}_{quality\ q} = \frac{ \sum\limits_{picture=1}^{50} filesize_{qp}}{\sum\limits_{picture=1}^{50} area_{p}}</script>
</p>
<h2>Results</h2>
<h3>Raw data</h3>
<p>The following archives contain the raw data in csv format for subset1 and subset2:</p>
<ul>
<li><a href="subset1.tar.gz">Subset1</a> (updated February 2018)</li>
<li><a href="subset2.tar.gz">Subset2</a> (outdated)</li>
</ul>
<h3>Lossless compression ratio and Weissman score:</h3>
<table>
<thead>
<tr>
<th align="left">codec</th>
<th align="center">avg. compression ratio</th>
<th align="center">avg. space saving</th>
<th align="center">wavg. encode time</th>
<th align="center">wavg. decode time</th>
<th align="center">Weissman score</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">daala</td>
<td align="center">2.798</td>
<td align="center">64.26%</td>
<td align="center">0.8049</td>
<td align="center">0.7280</td>
<td align="center">3.3381</td>
</tr>
<tr>
<td align="left">vp9</td>
<td align="center">2.905</td>
<td align="center">65.58%</td>
<td align="center">3.9375</td>
<td align="center">0.4193</td>
<td align="center">2.8011</td>
</tr>
<tr>
<td align="left">av1-20160930</td>
<td align="center">2.912</td>
<td align="center">65.66%</td>
<td align="center">4.7511</td>
<td align="center">0.4838</td>
<td align="center">2.7455</td>
</tr>
<tr>
<td align="left">av1-20170809</td>
<td align="center">2.984</td>
<td align="center">66.49%</td>
<td align="center">20.4157</td>
<td align="center">0.6900</td>
<td align="center">2.4003</td>
</tr>
<tr>
<td align="left">kdu</td>
<td align="center">1.564</td>
<td align="center">36.06%</td>
<td align="center">0.3875</td>
<td align="center">0.2892</td>
<td align="center">2.0946</td>
</tr>
<tr>
<td align="left">jxr</td>
<td align="center">1.560</td>
<td align="center">35.89%</td>
<td align="center">0.4058</td>
<td align="center">0.3628</td>
<td align="center">2.0730</td>
</tr>
<tr>
<td align="left">av1-20180222</td>
<td align="center">2.943</td>
<td align="center">66.02%</td>
<td align="center">97.6492</td>
<td align="center">1.0156</td>
<td align="center">2.0444</td>
</tr>
<tr>
<td align="left">flif</td>
<td align="center">2.473</td>
<td align="center">59.57%</td>
<td align="center">22.1088</td>
<td align="center">4.3042</td>
<td align="center">1.9732</td>
</tr>
<tr>
<td align="left">openjpeg</td>
<td align="center">1.564</td>
<td align="center">36.06%</td>
<td align="center">2.1181</td>
<td align="center">1.3794</td>
<td align="center">1.6300</td>
</tr>
<tr>
<td align="left">webp</td>
<td align="center">2.124</td>
<td align="center">52.93%</td>
<td align="center">37.9675</td>
<td align="center">2.4799</td>
<td align="center">1.6079</td>
</tr>
<tr>
<td align="left">bpg</td>
<td align="center">1.150</td>
<td align="center">13.03%</td>
<td align="center">3.7503</td>
<td align="center">3.5251</td>
<td align="center">1.1151</td>
</tr>
<tr>
<td align="left">mozjpeg</td>
<td align="center">1.137</td>
<td align="center">12.05%</td>
<td align="center">8.7385</td>
<td align="center">0.4144</td>
<td align="center">1.0000</td>
</tr>
</tbody>
</table>
<h3>Lossy compression and speed</h3>
<p><img class="graph" alt="Encoding time in function of bits per pixel" src="subset1.encoding_time.(openjpeg,flif,vp9,daala,jxr,bpg,mozjpeg,webp,kdu,av1-20180222,pik).svg"></p>
<h3>Lossy metrics</h3>
<p>For each comparison algorithms, we plot the quality in dB in function of the mean bits per pixel on a logarithmic scale. We can then visualize which codec gives the best quality at a given bit per pixel (top left is better).</p>
<h4>Bits per pixel at equivalent quality according to VMAF</h4>
<p><img class="graph" alt="Bits per pixel at equivalent quality according to VMAF" src="subset1.vmaf.(openjpeg,flif,vp9,daala,jxr,bpg,mozjpeg,webp,kdu,av1-20180222,pik).svg"></p>
<h4>Bits per pixel at equivalent quality according to Y-PSNR-HVS-M</h4>
<p><img class="graph" alt="Bits per pixel at equivalent quality according to Y-PSNR-HVS-M" src="subset1.psnr-hvs-m.(openjpeg,flif,vp9,daala,jxr,bpg,mozjpeg,webp,kdu,av1-20180222,pik).svg"></p>
<h4>Bits per pixel at equivalent quality according to Y-MSSSIM</h4>
<p><img class="graph" alt="Bits per pixel at equivalent quality according to Y-MSSSIM" src="subset1.ms-ssim.(openjpeg,flif,vp9,daala,jxr,bpg,mozjpeg,webp,kdu,av1-20180222,pik).svg"></p>
<h4>Bits per pixel at equivalent quality according to Y-SSIM</h4>
<p><img class="graph" alt="Bits per pixel at equivalent quality according to Y-SSIM" src="subset1.y-ssim.(openjpeg,flif,vp9,daala,jxr,bpg,mozjpeg,webp,kdu,av1-20180222,pik).svg"></p>
<h4>Bits per pixel at equivalent quality according to RGB-SSIM</h4>
<p><img class="graph" alt="Bits per pixel at equivalent quality according to RGB-SSIM" src="subset1.rgb-ssim.(openjpeg,flif,vp9,daala,jxr,bpg,mozjpeg,webp,kdu,av1-20180222,pik).svg"></p>
</body>
</html>