module

CrImage::PNG

PNG module implements Reader and Writer. The PNG specification is at https://www.w3.org/TR/PNG/.

Constants

PNG_HEADER = "\x89PNG\r\n\u001A\n".to_slice

Class methods

filter_paeth(cdat : Bytes, pdat : Bytes, bytes_per_pixel : Int32)

applies the Paeth filter to the cdat slice. cdat is the current row's data, pdat is the previous row's data :nodoc

Source
paeth(a : UInt8, b : UInt8, c : UInt8) : UInt8

This file implements the Paeth predictor filter used in PNG compression. The Paeth filter predicts pixel values based on neighboring pixels. implements the Paeth filter function, as per the PNG specification

Source
read(path : String) : CrImage::Image

read and decode the entire image

Source
read(io : IO) : CrImage::Image
Source
read_config(path : String) : CrImage::Config

read and decode the configurations like color model, dimensions and does not decode entire image. This returns CrImage::Config instead.

Source
read_config(io : IO) : CrImage::Config
Source
write(path : String, image : CrImage::Image, level = CompressionLevel::Default) : Nil

write the Image to file in PNG format

Source
write(io : IO, image : CrImage::Image, level = CompressionLevel::Default) : Nil

write the Image to IO in PNG format

Source

Nested types