PNG and APNG features
The following features
are supported for PNG
and APNG
:
Headers
The "headers"
feature for PNG
and APNG
exports all data from the
header chunks (all chunks which are not IDAT
or fdAT
).
Each type of chunk exports an object with the name of its tag
.
For chunks that may appear multiple times, an Array
is exported
instead of an object.
I won’t go into detail for each field in each header.
You should read the PNG
specification for that.
TODO: number
TODO: string
TODO: an Array
with 3 numbers: [ red, green, blue ]
TODO: an Array
of numbers with the histogram
TODO: an Array
with 5 numbers: [ red, green, blue, alpha, frequency ]
TODO: depending on IHDR.color_type
:
0
or4
: anObject
with 1 number:"grey"
2
or6
: anObject
with 3 numbers:"red"
,"green"
, and"blue"
3
: anArray
with numbers
TODO: depending on IHDR.color_type
:
0
: anObject
with 1 number:"grey"
2
or3
: anObject
with 3 numbers:"red"
,"green"
, and"blue"
4
: anObject
with 2 numbers:"grey"
and"alpha"
6
: anObject
with 4 numbers:"red"
,"green"
,"blue"
, and"alpha"
TODO: depending on IHDR.color_type
:
0
: anObject
with 1 number:"grey"
2
: anObject
with 3 numbers:"red"
,"green"
, and"blue"
3
: anArray
with numbers
TODO: an Array
of bytes with custom (decompressed) zlib
data
TODO: a string
(possibly decompressed zlib
data, depending on the flag
field)
Image Data
The "idat"
feature for PNG
and APNG
exports all image data
(IDAT
and fdAT
chunks).
NOTE
: interlaced
PNG
images will have a "passes"
array instead of "rows"
.
It works differently, using Adam7
interlacing.
Each pass has a different number of bytes in the row (TODO
: describe).
TODO: row
:
- Each
row
of image data is anArray
with numbers. - The first value in the
Array
is thefilter_type
, which can be0
: None1
: Sub2
: Up3
: Average4
: Paeth
- All subsequent values in the
Array
are numbers that represent the image data compressed with thefilter_type
above.
TODO: number
:
- The
"compression_level"
field will instructFFglitch
on what compression level to use in thezlib
library to compress the data. Default is-1
, and values may go from0
(no compression) to9
(best compression).
TODO: number
:
fdAT
chunks have an extrasequence_number
field.