3 intro => 'Comparison of image encoding formats, based on <a href="https://cloudinary.com/blog/one_pixel_is_worth_three_thousand_words">Cloudinary</a> research.',
6 name => '<abbr title="Joint Photographic Experts Group">JPEG</abbr>',
11 name => '<abbr title="Graphics Interchange Format">GIF</abbr>',
16 name => '<abbr title="Portable Network Graphics">PNG</abbr>',
31 name => '<abbr title="High Efficiency Image Container (HEVC in HEIF)">HEIC</abbr>',
36 name => '<abbr title="AV1 Image File Format">AVIF</abbr>',
46 name => '<abbr title="Portable aNyMap">PNM</abbr>',
53 children => [qw( quality_photo quality_art speed limits features royalties overhead support )],
56 name => 'compression (photo)',
68 children => [qw( quality_photo_1 quality_photo_2 quality_photo_3 quality_photo_ll )],
71 parent => 'quality_photo',
86 parent => 'quality_photo',
87 name => 'medium fidelity',
101 parent => 'quality_photo',
102 name => 'high fidelity',
115 quality_photo_ll => {
116 parent => 'quality_photo',
131 name => 'compression (other images)',
143 children => [qw( quality_art_2 quality_art_ll quality_art_mixed )],
146 name => 'lossy non-photographic',
160 name => 'lossless non-photographic',
173 quality_art_mixed => {
174 name => 'mixed photo/nonphoto',
199 children => [qw( speed_encode speed_decode speed_parallel )],
203 name => 'single-core encode',
207 gif => 3, # palette conversion
218 name => 'single-core decode',
233 name => 'pararellizable',
258 children => [qw( max_dimensions max_bitdepth color_444 hdr max_channels )],
262 name => 'maximum image dimensions',
264 jpeg => [3, '65k²'], # 2**16
266 gif => [3, '65k²'], # 2**16
267 png => [4, '2G²'], # 2**31
268 jp2k => [4, '4G²'], # 2**32
269 webp => [1, '16k²'], # 2**14
270 heic => [2,'8k×4k+', 'tilable, only 512×512 on Apple'], # 8193x4320
271 avif => [3, '65k²+', 'tilable, 7680×4320 with Advanced profile'], # 2**16
272 jxl => [4, '1G²'], # 2**30
277 name => 'precision (max. bit depth)',
280 pnm => [2, 8, 'unofficial PFM extension for 32-bit'],
281 gif => [1, 8, '256 colour palette per frame'],
285 heic => [3, 10], #TODO 16?
286 avif => [3, 12, '8, 10, 12 bit'],
287 jxl => [5, 32, '24-bit integer or 32-bit float'],
292 name => 'chroma subsampling',
294 jpeg => ['y', undef, '4:2:0, 4:2:2, 4:4:4'],
299 webp => [1, '4:2:0'],
300 heic => [1, '4:2:0'],
301 avif => ['y', undef, '4:2:0, 4:2:2, 4:4:4'],
302 jxl => ['y', undef, 'for JPEG compatibility'],
307 name => 'wide gamut/HDR',
322 name => 'maximum number of channels',
324 jpeg => [3, 4, 'RGB or CMYK'],
325 pnm => [3, 3, 'RGB'],
326 gif => [3, 3, 'RGB palette'],
327 png => [3, 4, 'RGBA'],
329 webp => [3, 4, 'RGBA'],
330 heic => [3, 3, 'RGB, separate alpha and depth'],
331 avif => [3, 3, 'RGB, separate alpha and depth'],
332 jxl => [4, 4099, 'native XYB'],
338 pnm => [2, undef, 'great for simplicity and ASCII storage'],
347 children => [qw( animation progressive alpha depthmap overlays authoring reencode compat_jpeg )],
350 parent => 'features',
351 name => 'supports animation',
353 jpeg => [2, 'MJPEG'],
356 png => [4, 'APNG', 'later backwards-compatible extension'],
365 parent => 'features',
366 name => 'progressive decoding',
380 parent => 'features',
381 name => 'alpha transparency',
384 pnm => ['n', undef, 'PAM extension'],
395 parent => 'features',
410 parent => 'features',
411 name => 'overlays (layers)',
425 parent => 'features',
426 name => 'authoring workflow suitability',
440 parent => 'features',
441 name => 'generation loss resilience',
455 parent => 'features',
456 name => 'lossless JPEG recompression',
470 name => 'royalty-free',
474 gif => [5, undef, 'patented before 2003'],
476 jp2k => [3, undef, 'ISO specification not freely available'],
477 webp => [4, undef, 'free format, low remaining risk of patent trolls'],
478 heic => ['n', undef, 'heavily patented'],
479 avif => [4, undef, 'free format, risk of patent trolls'],
480 jxl => [4, undef, 'free format, risk of patent trolls'],
490 jp2k => [2, undef, 'Apple only'],
491 webp => [4, undef, 'modern browsers'],
492 heic => [1, undef, 'stored by latest cameras, no browser support'],
493 avif => [3, undef, 'all modern browsers except Safari and Edge'],
494 jxl => [2, undef, 'upcoming in most browsers'],
498 name => 'container overhead (file size)',
500 png => [3, 67, 'upto 70 bytes for specific RGBA'],
501 jpeg => [2, 160, '159 bytes minimum for gray, 288 for specific colours'],
502 gif => [4, 35, '43 bytes for transparent'],
503 webp => [4, 34, 'black or transparent lossless; 44-92 bytes lossy'],
504 bpg => [4, 31, 'lossy 29-62 bytes, lossless 37-160'],
505 flif => [5, 14, 'black or transparent; 20 bytes for specific RGBA'],
506 pnm => [5, 8, 'monochrome text PBM; 12 bytes PPM; 69 bytes PAM'],
507 jxl => [5, 12, '512×256 black pixels'],
508 avif => [1, 282, 'container overhead; 457 bytes with alpha'],
509 jp2k => [2, 123, 'experimental results, likely not optimal'],