Encodes as an 8-bit PNG: gray, gray with alpha, RGB or RGBA (BGRA is written as RGBA). Each
row gets the filter whose output has the smallest sum of absolute values (read as signed
bytes): estimated from a sample of the row for levels 1 to 8, over the whole row at level 9, which is slower.
level is the deflate level, 0 to 9; 0 stores the rows unfiltered and uncompressed.
encode_png :: (image: Image, level: s32 = 6) -> [] u8
Encodes as an 8-bit PNG: gray, gray with alpha, RGB or RGBA (BGRA is written as RGBA). Each
row gets the filter whose output has the smallest sum of absolute values (read as signed
bytes): estimated from a sample of the row for levels 1 to 8, over the whole row at level 9, which is slower.
level is the deflate level, 0 to 9; 0 stores the rows unfiltered and uncompressed.
Parameters
- image: Image
- level: s32
Returns
- [] u8