Struct png::Encoder [−][src]
pub struct Encoder<W: Write> { /* fields omitted */ }
Expand description
PNG Encoder
Implementations
Set the color of the encoded image.
These correspond to the color types in the png IHDR data that will be written. The length of the image data that is later supplied must match the color type, otherwise an error will be emitted.
Set compression parameters.
Accepts a Compression
or any type that can transform into a Compression
. Notably deflate::Compression
and
deflate::CompressionOptions
which “just work”.
Set the used filter type.
The default filter is FilterType::Sub
which provides a basic prediction algorithm for
sample values based on the previous. For a potentially better compression ratio, at the
cost of more complex processing, try out FilterType::Paeth
.