codec: netpbm (pnm) format for completeness
[sheet.git] / codec.inc.pl
index 992c48869c83f7ae4d301daf090251835a345eef..92e17d5911cf9890641b1e9a32883f3a7c72053f 100644 (file)
@@ -33,15 +33,20 @@ codec => {
                name => 'JPEG XL',
                available => 2021,
        },
+       pnm => {
+               name => '<abbr title="Portable aNyMap">PNM</abbr>',
+               available => 1988,
+       },
 },
 feature => {
        default => {
-               children => [qw( quality_photo quality_art speed limits features royalties support )],
+               children => [qw( quality_photo quality_art speed limits features royalties overhead support )],
        },
        quality_photo => {
                name => 'compression (photo)',
                score => {
                        jpeg => 3,
+                       pnm  => 'n',
                        gif  => 1,
                        png  => 1,
                        jp2k => 4,
@@ -57,6 +62,7 @@ feature => {
                name => 'thumbnails',
                score => {
                        jpeg => 2,
+                       pnm  => 1,
                        gif  => 1,
                        png  => 1,
                        jp2k => 3,
@@ -71,6 +77,7 @@ feature => {
                name => 'medium fidelity',
                score => {
                        jpeg => 3,
+                       pnm  => 1,
                        gif  => 1,
                        png  => 1,
                        jp2k => 4,
@@ -85,6 +92,7 @@ feature => {
                name => 'high fidelity',
                score => {
                        jpeg => 3,
+                       pnm  => 1,
                        gif  => 1,
                        png  => 2,
                        jp2k => 4,
@@ -99,6 +107,7 @@ feature => {
                name => 'lossless',
                score => {
                        jpeg => 1,
+                       pnm  => 1,
                        gif  => 1,
                        png  => 2,
                        jp2k => 4,
@@ -112,6 +121,7 @@ feature => {
                name => 'compression (other images)',
                score => {
                        jpeg => 2,
+                       pnm  => 'n',
                        gif  => 1,
                        png  => 3,
                        jp2k => 2,
@@ -126,6 +136,7 @@ feature => {
                name => 'lossy non-photographic',
                score => {
                        jpeg => 2,
+                       pnm  => 1,
                        gif  => 2,
                        png  => 3,
                        jp2k => 2,
@@ -139,6 +150,7 @@ feature => {
                name => 'lossless non-photographic',
                score => {
                        jpeg => 1,
+                       pnm  => 1,
                        gif  => 1,
                        png  => 4,
                        jp2k => 2,
@@ -152,6 +164,7 @@ feature => {
                name => 'mixed photo/nonphoto',
                score => {
                        jpeg => 2,
+                       pnm  => 1,
                        gif  => 1,
                        png  => 2,
                        jp2k => 2,
@@ -164,6 +177,7 @@ feature => {
        speed => {
                score => {
                        jpeg => 5,
+                       pnm  => 5,
                        gif  => 4,
                        png  => 4,
                        jp2k => 3,
@@ -179,6 +193,7 @@ feature => {
                name => 'single-core encode',
                score => {
                        jpeg => 5,
+                       pnm  => 0,
                        gif  => 3, # palette conversion
                        png  => 3,
                        jp2k => 4,
@@ -193,6 +208,7 @@ feature => {
                name => 'single-core decode',
                score => {
                        jpeg => 5,
+                       pnm  => 0,
                        gif  => 5,
                        png  => 5,
                        jp2k => 4,
@@ -207,6 +223,7 @@ feature => {
                name => 'pararellizable',
                score => {
                        jpeg => 2,
+                       pnm  => 0,
                        gif  => 2,
                        png  => 2,
                        jp2k => 4,
@@ -219,6 +236,7 @@ feature => {
        limits => {
                score => {
                        jpeg => 3,
+                       pnm  => 3,
                        gif  => 2,
                        png  => 4,
                        jp2k => 5,
@@ -234,9 +252,10 @@ feature => {
                name => 'maximum image dimensions',
                score => {
                        jpeg => [3, '65k²'],   # 2**16
+                       pnm  => [5,    '∞'],
                        gif  => [3, '65k²'],   # 2**16
                        png  => [4,  '2G²'],   # 2**31
-                       jp2k => [5,  '4G²'],   # 2**32
+                       jp2k => [4,  '4G²'],   # 2**32
                        webp => [1, '16k²'],   # 2**14
                        heic => [2,'8k×4k+', 'tilable, only 512×512 on Apple'], # 8193x4320
                        avif => [3, '65k²+', 'tilable, 7680×4320 with Advanced profile'], # 2**16
@@ -248,6 +267,7 @@ feature => {
                name => 'precision (max. bit depth)',
                score => {
                        jpeg => [2,  8],
+                       pnm  => [2,  8, 'unofficial PFM extension for 32-bit'],
                        gif  => [1,  8, '256 colour palette per frame'],
                        png  => [4, 16],
                        jp2k => [5, 38],
@@ -262,6 +282,7 @@ feature => {
                name => 'chroma subsampling',
                score => {
                        jpeg => ['y', undef, '4:2:0, 4:2:2, 4:4:4'],
+                       pnm  => [4, '✘'],
                        gif  => [4, '✘'],
                        png  => [4, '✘'],
                        jp2k => 'y',
@@ -276,6 +297,7 @@ feature => {
                name => 'wide gamut/HDR',
                score => {
                        jpeg => 'n',
+                       pnm  => 'n',
                        gif  => 'n',
                        png  => 'y',
                        jp2k => 'y',
@@ -290,6 +312,7 @@ feature => {
                name => 'maximum number of channels',
                score => {
                        jpeg => [3, 4, 'RGB or CMYK'],
+                       pnm  => [3, 3, 'RGB'],
                        gif  => [3, 3, 'RGB palette'],
                        png  => [3, 4, 'RGBA'],
                        jp2k => [5, 2**15],
@@ -302,6 +325,7 @@ feature => {
        features => {
                score => {
                        jpeg => 2,
+                       pnm  => [2, undef, 'great for simplicity and ASCII storage'],
                        gif  => 2,
                        png  => 3,
                        jp2k => 4,
@@ -317,6 +341,7 @@ feature => {
                name => 'supports animation',
                score => {
                        jpeg => [2, 'MJPEG'],
+                       pnm  => 'n',
                        gif  => 'y',
                        png  => [4, 'APNG', 'later backwards-compatible extension'],
                        jp2k => [2, 'MJP2'],
@@ -331,6 +356,7 @@ feature => {
                name => 'progressive decoding',
                score => {
                        jpeg => 4,
+                       pnm  => 'n',
                        gif  => 2,
                        png  => 2,
                        jp2k => 5,
@@ -345,6 +371,7 @@ feature => {
                name => 'alpha transparency',
                score => {
                        jpeg => 'n',
+                       pnm  => ['n', undef, 'PAM extension'],
                        gif  => [3, '1 bit'],
                        png  => 'y',
                        jp2k => 'y',
@@ -359,6 +386,7 @@ feature => {
                name => 'depth map',
                score => {
                        jpeg => 'n',
+                       pnm  => 'n',
                        gif  => 'n',
                        png  => 'n',
                        jp2k => 'n',
@@ -373,6 +401,7 @@ feature => {
                name => 'overlays (layers)',
                score => {
                        jpeg => 'n',
+                       pnm  => 'n',
                        gif  => 'y',
                        png  => 'n',
                        jp2k => 'n',
@@ -387,6 +416,7 @@ feature => {
                name => 'authoring workflow suitability',
                score => {
                        jpeg => 2,
+                       pnm  => 2,
                        gif  => 2,
                        png  => 3,
                        jp2k => 3,
@@ -401,6 +431,7 @@ feature => {
                name => 'generation loss resilience',
                score => {
                        jpeg => 4,
+                       pnm  => 0,
                        png  => 0,
                        gif  => 0,
                        jp2k => 3,
@@ -415,6 +446,7 @@ feature => {
                name => 'lossless JPEG recompression',
                score => {
                        jpeg => 0,
+                       pnm  => 'n',
                        gif  => 'n',
                        png  => 'n',
                        jp2k => 'n',
@@ -428,6 +460,7 @@ feature => {
                name => 'royalty-free',
                score => {
                        jpeg => 5,
+                       pnm  => 5,
                        gif  => [5, undef, 'patented before 2003'],
                        png  => 5,
                        jp2k => [3, undef, 'ISO specification not freely available'],
@@ -441,6 +474,7 @@ feature => {
        support => {
                score => {
                        jpeg => 5,
+                       pnm  => [2, undef],
                        gif  => 5,
                        png  => 5,
                        jp2k => [2, undef, 'Apple only'],
@@ -450,5 +484,21 @@ feature => {
                        jxl  => [2, undef, 'upcoming in most browsers'],
                },
        },
+       overhead => {
+               name => 'container overhead (file size)',
+               score => {
+                       png  => [3,  67, 'upto 70 bytes for specific RGBA'],
+                       jpeg => [2, 160, '159 bytes minimum for gray, 288 for specific colours'],
+                       gif  => [4,  35, '43 bytes for transparent'],
+                       webp => [4,  34, 'black or transparent lossless; 44-92 bytes lossy'],
+                       bpg  => [4,  31, 'lossy 29-62 bytes, lossless 37-160'],
+                       flif => [5,  14, 'black or transparent; 20 bytes for specific RGBA'],
+                       pnm  => [5,   8, 'monochrome text PBM; 12 bytes PPM; 69 bytes PAM'],
+                       jxl  => [5,  12, '512×256 black pixels'],
+                       avif => [1, 282, 'container overhead; 457 bytes with alpha'],
+                       jp2k => [2, 123, 'experimental results, likely not optimal'],
+                       heic => [1, 386],
+               },
+       },
 },
 }