utils library
Functions
-
decodePng(
Uint8List bytes) → Future -
Decodes a PNG image from a byte array into an
Image
object. -
encodePng(
dynamic image) → Future< Uint8List> -
Encodes an
Image
object into a PNG format byte array. -
imgPixelmatch(
dynamic img1, dynamic img2, Map< String, dynamic> options) → Future<(double, Uint8List)> -
Compares two
Image
objects and calculates the number of differing pixels. -
imgToRgba(
dynamic image) → Future< Uint8List> -
Converts an
Image
object to raw RGBA bytes. -
readPng(
String path) → Future -
Reads a PNG file from the specified path and converts it to an
Image
object. -
resizeImage(
dynamic image, int width, int height) → Future -
Resizes an
Image
to the specified dimensions. -
resizeRawImage(
List< int> rawBytes, int width, int height) → Future<List< int> > - Resizes a raw image byte array to the specified dimensions.
-
rgbaToImg(
Uint8List rawRgba) → Future -
Creates an
Image
object from raw RGBA bytes. -
writePng(
String path, dynamic image) → Future< void> -
Writes an
Image
object to a PNG file at the specified path.