]> gitweb.factorcode.org Git - factor.git/blob - basis/images/testing/png/suite/pngsuite.doc
merge project-euler.factor
[factor.git] / basis / images / testing / png / suite / pngsuite.doc
1         PNGSUITE
2 ----------------
3
4         testset for PNG-(de)coders
5         created by Willem van Schaik
6 ------------------------------------
7
8 This is a collection of graphics images created to test the png applications
9 like viewers, converters and editors. All (as far as that is possible)
10 formats supported by the PNG standard are represented.
11
12
13 1.      INTRODUCTION
14 --------------------
15
16 1.1     PNG capabilities
17 ------------------------
18
19 Supported color-types are:
20
21         -   grayscale
22         -   grayscale + alpha-channel
23         -   color palettes
24         -   rgb
25         -   rgb + alpha-channel
26
27 Allowed bitdepths are depending on the color-type, but are in the range
28 of 1-bit (grayscale, which is b&w) upto 16-bits.
29
30 Special features are:
31
32         -   interlacing (Adam-7)
33         -   gamma-support
34         -   transparency (a poor-man's alpha solution)
35
36
37 1.2     File naming
38 -------------------
39
40 Where possible, the testfiles are 32x32 bits icons. This results in a still
41 reasonable size of the suite even with a large number of tests. The name
42 of each test-file reflects thetype in the following way:
43
44         g04i2c08.png
45         || |||+---- bit-depth
46         || ||+----- color-type (descriptive)
47         || |+------ color-type (numerical)
48         || +------- interlaced or non-interlaced
49         |+--------- parameter of test (in this case gamma-value)
50         +---------- test feature (in this case gamma)
51
52
53 1.3     PNG formats
54 -------------------
55
56 color-type:
57         0g          -   grayscale
58         2c          -   rgb color
59         3p          -   paletted
60         4a          -   grayscale + alpha channel
61         6a          -   rgb color + alpha channel
62
63 bit-depth:
64         01          -   with color-type 0, 3
65         02          -   with color-type 0, 3
66         04          -   with color-type 0, 3
67         08          -   with color-type 0, 2, 3, 4, 6
68         16          -   with color-type 0, 2, 4, 6
69
70 interlacing:
71         n           -   non-interlaced
72         i           -   interlaced
73
74
75 2.      THE TESTS
76 -----------------
77
78 2.1     Sizes
79 -------------
80
81 These tests are there to check if your software handles pictures well, with
82 picture sizes that are not a multiple of 8. This is particularly important
83 with Adam-7 type interlacing. In the same way these tests check if pictures
84 size 1x1 and similar are ok.
85
86         s01         -   1x1 pixel picture
87         s02         -   2x2 pixel picture
88         s03         -   3x3 pixel picture
89         s04         -   4x4 pixel picture
90         s05         -   5x5 pixel picture
91         s06         -   6x6 pixel picture
92         s07         -   7x7 pixel picture
93         s08         -   8x8 pixel picture
94         s09         -   9x9 pixel picture
95         s32         -   32x32 pixel picture
96         s33         -   33x33 pixel picture
97         s34         -   34x34 pixel picture
98         s35         -   35x35 pixel picture
99         s36         -   36x36 pixel picture
100         s37         -   37x37 pixel picture
101         s38         -   38x38 pixel picture
102         s39         -   39x39 pixel picture
103         s40         -   40x40 pixel picture
104
105
106 2.2     Background
107 ------------------
108
109 When the PNG file contains a background chunck, this should be used for
110 pictures with alpha-channel or pictures with a transparency chunck. For
111 pictures without this background-chunk, but with alpha, this testset
112 assumes a black background.
113
114 For the images in this test, the left-side should be 100% the background
115 color, where moving to the right the color should gradually become the
116 image pattern.
117
118         bga         -   alpha + no background
119         bgw         -   alpha + white background
120         bgg         -   alpha + gray background
121         bgb         -   alpha + black background
122         bgy         -   alpha + yellow background
123
124
125 2.3     Transparency
126 --------------------
127
128 Transparency should be used together with a background chunk. To test the
129 combination of the two the latter 4 tests are there. How to handle pictures
130 with transparancy, but without a background, opinions can differ. Here we
131 use black, but especially in the case of paletted images, the normal color
132 would maybe even be better.
133
134         tp0         -   not transparent for reference
135         tp1         -   transparent, but no background chunk
136         tbw         -   transparent + white background
137         tbg         -   transparent + gray background
138         tbb         -   transparent + black background
139         tby         -   transparent + yellow background
140
141
142 2.4     Gamma
143 -------------
144
145 To test if your viewer handles gamma-correction, 6 testfiles are available.
146 They contain corrected color-ramps and a corresponding gamma-chunk with the
147 file-gamma value. These are created in such a way that when the viewer does
148 the gamma correction right, all 6 should be displayed identical.
149
150 If they are different, probably the gamma correction is omitted. In that
151 case, have a look at the two right coloumns in the 6 pictures. The image
152 where those two look the same (when looked from far) reflects the gamma of
153 your system. However, because of the limited size of the image, you should
154 do more elaborate tests to determine your display gamma.
155
156         g03         -   file-gamma = 0.35, for display with gamma = 2.8
157         g04         -   file-gamma = 0.45, for display with gamma = 2.2 (PC)
158         g05         -   file-gamma = 0.55, for display with gamma = 1.8 (Mac)
159         g07         -   file-gamma = 0.70, for display with gamma = 1.4
160         g10         -   file-gamma = 1.00, for display with gamma = 1.0 (NeXT)
161         g25         -   file-gamma = 2.50, for display with gamma = 0.4
162
163
164 2.5     Filtering
165 -----------------
166
167 PNG uses file-filtering, for optimal compression. Normally the type is of
168 filtering is adjusted to the contents of the picture, but here each file
169 has the same picture, with a different filtering.
170
171         f0          -   no filtering
172         f1          -   sub filtering
173         f2          -   up filtering
174         f3          -   average filtering
175         f4          -   paeth filtering
176
177
178 2.6     Additional palettes
179 ---------------------------
180
181 Besides the normal use of paletted images, palette chunks can in combination
182 with true-color (and other) images also be used to select color lookup-tables
183 when the video system is of limited capabilities. The suggested palette chunk
184 is specially created for this purpose.
185
186         pp          -   normal palette chunk
187         ps          -   suggested palette chunk
188
189
190 2.7     Ancillary chunks (under construction)
191 ------------------------
192
193 To test the correct decoding of ancillary chunks, these test-files contain
194 one or more examples of these chunkcs. Depending on the type of chunk, a
195 number of typical values are selected to test. Unluckily, the testset can
196 not contain all combinations, because that would be an endless set.
197
198 The significant bits are used in files with the next higher bit-depth. They
199 indicate howmany bits are valid.
200
201         cs3         -   3 significant bits
202         cs5         -   5 significant bits
203         cs8         -   8 significant bits (reference)
204         cs3         -   13 significant bits
205
206 For the physical pixel dimensions, the result of each decoding should be
207 a sqare picture. The first (cdf) image is an example of flat (horizontal)
208 pixels, where the pHYS chunk (x is 1 per unit, y = 4 per unit) must take
209 care of the correction. The second is just the other way round. The last
210 example uses the unit specifier, for 1000 pixels per meter. This should
211 result in a picture of 3.2 cm square.
212
213         cdf         -   physical pixel dimensions, 8x32 flat pixels
214         cdh         -   physical pixel dimensions, 32x8 high pixels
215         cds         -   physical pixel dimensions, 8x8 square pixels
216         cdu         -   physical pixel dimensions, with unit-specifier
217
218         ccw         -   primary chromaticities and white point
219
220         ch1         -   histogram 15 colors
221         ch2         -   histogram 256 colors
222
223         cm7         -   modification time, 01-jan-1970
224         cm9         -   modification time, 31-dec-1999
225         cm0         -   modification time, 01-jan-2000
226
227 In the textual chunk, a number of the standard, and some non-standard
228 text items are included.
229
230         ct0         -   no textual data
231         ct1         -   with textual data
232         ctz         -   with compressed textual data
233
234
235 2.8     Chunk ordering (still under construction)
236 ----------------------
237
238 These testfiles will test the obligatory ordering relations between various
239 chunk types (not yet) as well as the number of data chunks used for the image.
240
241         oi1         -   mother image with 1 idat-chunk
242         oi2         -   image with 2 idat-chunks
243         oi4         -   image with 4 unequal sized idat-chunks
244         oi9         -   all idat-chunks of length one
245
246
247 2.9     Compression level
248 -------------------------
249
250 Here you will find a set of images compressed by zlib, ranging from level 0 
251 for no compression at maximum speed upto level 9 for maximum compression.
252
253         z00         -   zlib compression level 0 - none
254         z03         -   zlib compression level 3
255         z06         -   zlib compression level 6 - default
256         z09         -   zlib compression level 9 - maximum
257
258
259 2.10     Corrupted files (under construction)
260 -----------------------
261
262 All these files are illegal. When decoding they should generate appropriate
263 error-messages.
264
265         x00         -   empty IDAT chunk
266         xcr         -   added cr bytes
267         xlf         -   added lf bytes
268         xc0         -   color type 0
269         xc9         -   color type 9
270         xd0         -   bit-depth 0
271         xd3         -   bit-depth 3
272         xd9         -   bit-depth 99
273         xcs         -   incorrect IDAT checksum
274
275
276 3.      TEST FILES
277 ------------------
278
279 For each of the tests listed above, one or more test-files are created. A
280 selection is made (for each test) for the color-type and bitdepth to be used
281 for the tests. Further for a number of tests, both a non-interlaced as well
282 as an interlaced version is available.
283
284
285 3.1     Basic format test files (non-interlaced)
286 ------------------------------------------------
287
288         basn0g01    -   black & white
289         basn0g02    -   2 bit (4 level) grayscale
290         basn0g04    -   4 bit (16 level) grayscale
291         basn0g08    -   8 bit (256 level) grayscale
292         basn0g16    -   16 bit (64k level) grayscale
293         basn2c08    -   3x8 bits rgb color
294         basn2c16    -   3x16 bits rgb color
295         basn3p01    -   1 bit (2 color) paletted
296         basn3p02    -   2 bit (4 color) paletted
297         basn3p04    -   4 bit (16 color) paletted
298         basn3p08    -   8 bit (256 color) paletted
299         basn4a08    -   8 bit grayscale + 8 bit alpha-channel
300         basn4a16    -   16 bit grayscale + 16 bit alpha-channel
301         basn6a08    -   3x8 bits rgb color + 8 bit alpha-channel
302         basn6a16    -   3x16 bits rgb color + 16 bit alpha-channel
303
304
305 3.2     Basic format test files (Adam-7 interlaced)
306 ---------------------------------------------------
307
308         basi0g01    -   black & white
309         basi0g02    -   2 bit (4 level) grayscale
310         basi0g04    -   4 bit (16 level) grayscale
311         basi0g08    -   8 bit (256 level) grayscale
312         basi0g16    -   16 bit (64k level) grayscale
313         basi2c08    -   3x8 bits rgb color
314         basi2c16    -   3x16 bits rgb color
315         basi3p01    -   1 bit (2 color) paletted
316         basi3p02    -   2 bit (4 color) paletted
317         basi3p04    -   4 bit (16 color) paletted
318         basi3p08    -   8 bit (256 color) paletted
319         basi4a08    -   8 bit grayscale + 8 bit alpha-channel
320         basi4a16    -   16 bit grayscale + 16 bit alpha-channel
321         basi6a08    -   3x8 bits rgb color + 8 bit alpha-channel
322         basi6a16    -   3x16 bits rgb color + 16 bit alpha-channel
323
324
325 3.3     Sizes test files
326 -----------------------
327
328         s01n3p01    -   1x1 paletted file, no interlacing
329         s02n3p01    -   2x2 paletted file, no interlacing
330         s03n3p01    -   3x3 paletted file, no interlacing
331         s04n3p01    -   4x4 paletted file, no interlacing
332         s05n3p02    -   5x5 paletted file, no interlacing
333         s06n3p02    -   6x6 paletted file, no interlacing
334         s07n3p02    -   7x7 paletted file, no interlacing
335         s08n3p02    -   8x8 paletted file, no interlacing
336         s09n3p02    -   9x9 paletted file, no interlacing
337         s32n3p04    -   32x32 paletted file, no interlacing
338         s33n3p04    -   33x33 paletted file, no interlacing
339         s34n3p04    -   34x34 paletted file, no interlacing
340         s35n3p04    -   35x35 paletted file, no interlacing
341         s36n3p04    -   36x36 paletted file, no interlacing
342         s37n3p04    -   37x37 paletted file, no interlacing
343         s38n3p04    -   38x38 paletted file, no interlacing
344         s39n3p04    -   39x39 paletted file, no interlacing
345         s40n3p04    -   40x40 paletted file, no interlacing
346
347         s01i3p01    -   1x1 paletted file, interlaced
348         s02i3p01    -   2x2 paletted file, interlaced
349         s03i3p01    -   3x3 paletted file, interlaced
350         s04i3p01    -   4x4 paletted file, interlaced
351         s05i3p02    -   5x5 paletted file, interlaced
352         s06i3p02    -   6x6 paletted file, interlaced
353         s07i3p02    -   7x7 paletted file, interlaced
354         s08i3p02    -   8x8 paletted file, interlaced
355         s09i3p02    -   9x9 paletted file, interlaced
356         s32i3p04    -   32x32 paletted file, interlaced
357         s33i3p04    -   33x33 paletted file, interlaced
358         s34i3p04    -   34x34 paletted file, interlaced
359         s35i3p04    -   35x35 paletted file, interlaced
360         s36i3p04    -   36x36 paletted file, interlaced
361         s37i3p04    -   37x37 paletted file, interlaced
362         s38i3p04    -   38x38 paletted file, interlaced
363         s39i3p04    -   39x39 paletted file, interlaced
364         s40i3p04    -   40x40 paletted file, interlaced
365
366
367 3.4     Background test files (with alpha)
368 ------------------------------------------
369
370         bgai4a08    -   8 bit grayscale, alpha, no background chunk, interlaced
371         bgai4a16    -   16 bit grayscale, alpha, no background chunk, interlaced
372         bgan6a08    -   3x8 bits rgb color, alpha, no background chunk
373         bgan6a16    -   3x16 bits rgb color, alpha, no background chunk
374
375         bgbn4a08    -   8 bit grayscale, alpha, black background chunk
376         bggn4a16    -   16 bit grayscale, alpha, gray background chunk
377         bgwn6a08    -   3x8 bits rgb color, alpha, white background chunk
378         bgyn6a16    -   3x16 bits rgb color, alpha, yellow background chunk
379
380
381 3.5     Transparency (and background) test files
382 ------------------------------------------------
383
384         tp0n1g08    -   not transparent for reference (logo on gray)
385         tbbn1g04    -   transparent, black background chunk
386         tbwn1g16    -   transparent, white background chunk
387         tp0n2c08    -   not transparent for reference (logo on gray)
388         tbrn2c08    -   transparent, red background chunk
389         tbgn2c16    -   transparent, green background chunk
390         tbbn2c16    -   transparent, blue background chunk
391         tp0n3p08    -   not transparent for reference (logo on gray)
392         tp1n3p08    -   transparent, but no background chunk
393         tbbn3p08    -   transparent, black background chunk
394         tbgn3p08    -   transparent, light-gray background chunk
395         tbwn3p08    -   transparent, white background chunk
396         tbyn3p08    -   transparent, yellow background chunk
397
398
399 3.6     Gamma test files
400 ------------------------
401
402         g03n0g16    -   grayscale, file-gamma = 0.35
403         g04n0g16    -   grayscale, file-gamma = 0.45
404         g05n0g16    -   grayscale, file-gamma = 0.55
405         g07n0g16    -   grayscale, file-gamma = 0.70
406         g10n0g16    -   grayscale, file-gamma = 1.00
407         g25n0g16    -   grayscale, file-gamma = 2.50
408         g03n2c08    -   color, file-gamma = 0.35
409         g04n2c08    -   color, file-gamma = 0.45
410         g05n2c08    -   color, file-gamma = 0.55
411         g07n2c08    -   color, file-gamma = 0.70
412         g10n2c08    -   color, file-gamma = 1.00
413         g25n2c08    -   color, file-gamma = 2.50
414         g03n3p04    -   paletted, file-gamma = 0.35
415         g04n3p04    -   paletted, file-gamma = 0.45
416         g05n3p04    -   paletted, file-gamma = 0.55
417         g07n3p04    -   paletted, file-gamma = 0.70
418         g10n3p04    -   paletted, file-gamma = 1.00
419         g25n3p04    -   paletted, file-gamma = 2.50
420
421
422 3.7     Filtering test files
423 ----------------------------
424
425         f00n0g08    -   grayscale, no interlacing, filter-type 0
426         f01n0g08    -   grayscale, no interlacing, filter-type 1
427         f02n0g08    -   grayscale, no interlacing, filter-type 2
428         f03n0g08    -   grayscale, no interlacing, filter-type 3
429         f04n0g08    -   grayscale, no interlacing, filter-type 4
430         f00n2c08    -   color, no interlacing, filter-type 0
431         f01n2c08    -   color, no interlacing, filter-type 1
432         f02n2c08    -   color, no interlacing, filter-type 2
433         f03n2c08    -   color, no interlacing, filter-type 3
434         f04n2c08    -   color, no interlacing, filter-type 4
435
436
437 3.8     Additional palette chunk test files
438 -------------------------------------------
439
440         pp0n2c16    -   six-cube palette-chunk in true-color image
441         pp0n6a08    -   six-cube palette-chunk in true-color+alpha image
442         ps1n0g08    -   six-cube suggested palette (1 byte) in grayscale image
443         ps1n2c16    -   six-cube suggested palette (1 byte) in true-color image
444         ps2n0g08    -   six-cube suggested palette (2 bytes) in grayscale image
445         ps2n2c16    -   six-cube suggested palette (2 bytes) in true-color image
446
447
448 3.9     Ancillary chunks test files
449 -----------------------------------
450
451         cs5n2c08    -   color, 5 significant bits
452         cs8n2c08    -   color, 8 significant bits (reference)
453         cs3n2c16    -   color, 13 significant bits
454         cs3n3p08    -   paletted, 3 significant bits
455         cs5n3p08    -   paletted, 5 significant bits
456         cs8n3p08    -   paletted, 8 significant bits (reference)
457
458         cdfn2c08    -   physical pixel dimensions, 8x32 flat pixels
459         cdhn2c08    -   physical pixel dimensions, 32x8 high pixels
460         cdsn2c08    -   physical pixel dimensions, 8x8 square pixels
461         cdun2c08    -   physical pixel dimensions, 1000 pixels per 1 meter
462
463         ccwn2c08    -   chroma chunk w:0.3127,0.3290 r:0.64,0.33 g:0.30,0.60 b:0.15,0.06
464         ccwn3p08    -   chroma chunk w:0.3127,0.3290 r:0.64,0.33 g:0.30,0.60 b:0.15,0.06
465
466         ch1n3p04    -   histogram 15 colors
467         ch2n3p08    -   histogram 256 colors
468
469         cm7n0g04    -   modification time, 01-jan-1970 00:00:00
470         cm9n0g04    -   modification time, 31-dec-1999 23:59:59
471         cm0n0g04    -   modification time, 01-jan-2000 12:34:56
472
473         ct0n0g04    -   no textual data
474         ct1n0g04    -   with textual data
475         ctzn0g04    -   with compressed textual data
476
477
478
479 3.10    Chunk ordering
480 ----------------------
481
482         oi1n0g16    -   grayscale mother image with 1 idat-chunk
483         oi2n0g16    -   grayscale image with 2 idat-chunks
484         oi4n0g16    -   grayscale image with 4 unequal sized idat-chunks
485         oi9n0g16    -   grayscale image with all idat-chunks length one
486         oi1n2c16    -   color mother image with 1 idat-chunk
487         oi2n2c16    -   color image with 2 idat-chunks
488         oi4n2c16    -   color image with 4 unequal sized idat-chunks
489         oi9n2c16    -   color image with all idat-chunks length one
490
491
492
493 3.11    Compression level
494 -------------------------
495
496         z00n2c08    -   color, no interlacing, compression level 0 (none)
497         z03n2c08    -   color, no interlacing, compression level 3
498         z06n2c08    -   color, no interlacing, compression level 6 (default)
499         z09n2c08    -   color, no interlacing, compression level 9 (maximum)
500
501
502
503 3.12     Currupted files
504 -----------------------
505
506         x00n0g01    -   empty 0x0 grayscale file
507         xcrn0g04    -   added cr bytes
508         xlfn0g04    -   added lf bytes
509         xc0n0c08    -   color type 0
510         xc9n0c08    -   color type 9
511         xd0n2c00    -   bit-depth 0
512         xd3n2c03    -   bit-depth 3
513         xd9n2c99    -   bit-depth 99
514         xcsn2c08    -   incorrect IDAT checksum
515
516
517 --------
518     (c) Willem van Schaik
519         willem@schaik.com
520         Singapore, October 1996