Zune-image
An (opinionated) image library
This is the main library tying most of the zune- family of image
decoders, encoders and image processors and image libraries
Supported formats
| Format | Library | Decoding | Encoding |
|---|---|---|---|
| BMP | zune-bmp | Yes | - |
| Farbfeld | zune-farbfeld | Yes | Yes |
| HDR | zune-hdr | Yes | Yes |
| JPEG | zune-jpeg (decoder) , jpeg-encoder (encoder) | Yes | Yes |
| JPEG-XL | zune-jpegxl (encoder), jxl-oxide (decoder) | Yes | Lossless only |
| PNG | zune-png | Yes | Yes |
| PPM | zune-ppm | Yes | Yes |
| QOI | zune-qoi | Yes | Yes |
| WEBP | image-webp | Yes | Lossless VP8 Only |
Features
Image decoders and encoders
Each image decoder and encoder can be disabled or enabled by toggling it's feature, e.g to only include jpeg decoding and encoding, one can use
= { = "0.5", = false, = ["jpeg"] }
Other features
serde: Enable serde support for serializing image metadata, addsserdeas a dependencylog: Enable printing information vialogcratesimd: Enable SIMD support for certain image operations,- this just enables explicitly written simd code, not compiler autovectorization which may generate simd
threads: Enables support for running some operations in multiple threads, if this is disabled, the library can run in areas which lack support for threading e.gwasmimage-formats: Blanket feature to include all supported image formatsmetadata: Enable parsing of exif data, addskamadak-exifas a dependencyall: Enables all the above features
DecoderTrait, OperationsTrait and EncoderTrait
These traits encapsulate the main operations expected to be performed by an image library
DecoderTrait: Any item implementing this can decode an image into the library'sImagerepresentationOperationsTrait: Any item implementing this can manipulate anImagemodifying appropriate fields where necessaryEncoderTrait: Any item implementing this can take anImageand encode it to a desired function
Representation of images
All images are represented as an Image struct, this doesn't matter if the image is Grayscale, RGB, animated or
represented
by f32, this allows easy interoperability and simpler api at the cost of a slightly complex internal API
You can create images via the from_ methods or read an image file via Image.open
Examples
- Generating fractals, the same example as
imagecrate
use ColorSpace;