module

DataDungeon::TIFF

TIFF, through libtiff: a picture of any layout, compression or depth libtiff reads, decoded to 8-bit RGBA; and 8-bit pictures written in 64×64 tiles, deflate-compressed with horizontal prediction, the layout that keeps a small edit small on transfs (its chunk study: 2.6 MiB a small stroke over 37 pictures, against PNG's 32.7). Requiring this file links libtiff and adds image/tiff to what DataDungeon measures, converts to WebP and stores as (target_format: "tiff").

Constants

TILE = 64

Class methods

decode(data : Bytes) : Tuple(Int32, Int32, Bytes)

The first picture in these bytes as {width, height, RGBA pixels}, 8 bits a channel and straight (not premultiplied) alpha.

Source
encode(width : Int32, height : Int32, rgba : Bytes) : Bytes

These RGBA pixels as a TIFF in 64×64 deflate tiles, 8 bits a channel, with alpha only when a pixel isn't opaque. The same pixels always give the same bytes.

Source