struct

PNG::Header

Inherits Struct / Value / Object

Constructors

new(width : UInt32, height : UInt32, bit_depth : UInt8 = 8_u8, color_type : PNG::ColorType = ColorType::TrueColor, compression_method : PNG::CompressionMethod = CompressionMethod::Deflate, filter_type : PNG::FilterType = FilterType::Adaptive, interlacing : PNG::Interlacing = Interlacing::None)
Source

Class methods

parse(io : IO)
Source

Instance methods

bit_depth
Source
bit_depth=(bit_depth : UInt8)
Source
bits_per_pixel

Number of bits to represent a pixel. Ex: 4bits @ rgb color would be 4 * 3 = 12

Source
byte_size

Total bytesize including row padding, not including filter bytes

Source
bytes_per_pixel

Number of bytes to represent a pixel. Ex: 4bits @ rgb color would be ceil((4 * 3) / 8) = 2 This includes extra padding.

Source
bytes_per_row(width : Int = @width)

Row size including padding where bit depth doesn't align to bytes. Not including filter byte.

Source
channels(*args, **options)
Source
channels(*args, **options, &)
Source
color_type
Source
color_type=(color_type : ColorType)
Source
colorize(colors : Indexable(UInt8), palette : Palette | Nil = nil)

Convert bytes into a color struct

Source
compression_method
Source
compression_method=(compression_method : CompressionMethod)
Source
filter_type
Source
filter_type=(filter_type : FilterType)
Source
height
Source
height=(height : UInt32)
Source
interlacing
Source
interlacing=(interlacing : Interlacing)
Source
width
Source
width=(width : UInt32)
Source
write(io : IO)
Source