Re-exports

pub use crate::ffi::ColorType;
pub use crate::ffi::CompressSettings;
pub use crate::ffi::DecoderSettings;
pub use crate::ffi::DecompressSettings;
pub use crate::ffi::EncoderSettings;
pub use crate::ffi::ErrorCode;
pub use crate::ffi::FilterStrategy;
pub use crate::ffi::State;
pub use crate::ffi::Time;
pub use crate::ffi::ColorMode;
pub use crate::ffi::Info;

Modules

Structs

Low-level representation of an image

Reference to a chunk

Iterator of chunk metadata, returns ChunkRef which is like a slice of PNG metadata

Read an image with custom settings

Make an image with custom settings

Grayscale. Use .0 or * (deref) to access the value.

Grayscale with alpha. Use .0/.1 to access.

The RGB pixel

Enums

Position in the file section after…

Bitmap types.

Traits

Marker trait for “plain old data”.

Functions

Same as decode_memory, but always decodes to 24-bit RGB raw image

Same as decode_file, but always decodes to 24-bit RGB raw image

Same as decode_memory, but always decodes to 32-bit RGBA raw image

Same as decode_file, but always decodes to 32-bit RGBA raw image

Load PNG from disk, from file with given name. Same as the other decode functions, but instead takes a file path as input.

Converts PNG data in memory to raw pixel data.

Same as encode_memory, but always encodes from 24-bit RGB raw image

Same as encode_file, but always encodes from 24-bit RGB raw image

Same as encode_memory, but always encodes from 32-bit RGBA raw image

Same as encode_file, but always encodes from 32-bit RGBA raw image

Converts raw pixel data into a PNG file on disk. Same as the other encode functions, but instead takes a file path as output.

Converts raw pixel data into a PNG image in memory. The colortype and bitdepth of the output PNG image cannot be chosen, they are automatically determined by the colortype, bitdepth and content of the input pixel data.

Type Definitions

8-bit RGBA, alpha is last. 0 = transparent, 255 = opaque.