NativeOptimizer class

Provides native image optimization using bundled binaries.

Supports cwebp for WebP conversion and pngquant for PNG optimization. Automatically uses bundled binaries or falls back to system-installed tools.

Constructors

NativeOptimizer()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

availableTools → String
Returns a comma-separated list of available tools.
no setter
hasCwebp → bool
Whether cwebp is available for WebP conversion.
no setter
hasPngquant → bool
Whether pngquant is available for PNG optimization.
no setter

Static Methods

initialize() → Future<void>
Initializes the native optimizer by locating available tools.
optimizePng(File input, String outputPath) → Future<File?>
Optimizes a PNG file using pngquant.
toWebp(File input, String outputPath, {int quality = 80}) → Future<File?>
Converts an image to WebP format.