Skip to content
io
png
encode_png

encode_png

Mojo function 🡭

encode_png

fn def encode_png(canvas: Canvas, level: PngLevel = PngLevel.DEFAULT) -> List[UInt8]

The PNG file write_png would write, as bytes: for embedding a raster in an SVG’s data URI, sending over a socket, or hashing, without a file in between.

Args:

  • canvas (Canvas): Canvas to encode.
  • level (PngLevel): How hard to work at making the file small, as for write_png.

Returns:

List[UInt8]: The complete file, signature through IEND.

Raises: