UncompressedPngEncoder class final Output and Comparison
Encodes a buffer of pixel data as an uncompressed RGBA PNG image with 8-bit color depth.
A singleton instance of this class is available as uncompressedPngEncoder.
This encoder is intentionally minimal and does not support all features of the PNG format. It's primary purpose is to provide a zero-dependency way to visualize and persist pixel data in a standard format, i.e. for debugging purposes, and it's recommended to use a dedicated library for more advanced use cases.
Limitations
While the produced image is a valid PNG file, consider the following:
- The maximum resolution supported is 8192x8192.
- No compression is performed.
- Interlacing is not supported.
- Only a single
IDAT
chunk is written. - Only 8-bit color depth is supported.
- Pixel formats are converted to abgr8888 before encoding.
- No additional metadata or chunks are supported.
Alternatives
- In Flutter, prefer
instantiateImageCodec
. - In the browser, prefer
HTMLCanvasElement toBlob
. - In the standalone Dart VM, consider using
package:image
.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bind(
Stream< Buffer< stream) → Stream<void> >Uint8List> -
Transforms the provided
stream
.inherited -
cast<
RS, RT> () → Converter< RS, RT> -
Provides a
Converter<RS, RT>
view of this stream transformer.inherited -
convert(
Buffer< void> input) → Uint8List -
Converts
input
and returns the result of the conversion.override -
fuse<
TT> (Converter< Uint8List, TT> other) → Converter<Buffer< void> , TT> -
Fuses
this
withother
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startChunkedConversion(
Sink< Uint8List> sink) → Sink<Buffer< void> > -
Starts a chunked conversion.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited