Image is a Rust library for encoding and decoding images in various formats and performing basic image processing operations.
The library solves the problem of reading, writing, and manipulating images across multiple file formats in Rust. It provides a high-level API centered on the `ImageReader` type for loading images and `save` or `write_to` methods for storing them. Image processing functions operate on types implementing the `GenericImageView` and `GenericImage` traits and return an `ImageBuffer`. The library supports many common formats including AVIF, BMP, EXR, GIF, HDR, ICO, JPEG, PNG, PNM, QOI, TGA, TIFF, and WebP through its default feature set. Additional formats are available through the `image-extras` crate, and a plugin interface allows third-party crates to provide format implementations.
Developers should choose this library if they need straightforward image loading, saving, and basic processing in Rust without external dependencies for common formats. The `ImageBuffer` type provides direct pixel access for custom operations, while the `DynamicImage` enum handles runtime-determined image types and reimplements all processing functions for convenience. When publishing libraries that depend on image, the README recommends disabling default features and explicitly enabling only necessary format support to reduce the dependency tree and build time. This is particularly important for single-threaded environments like WebAssembly targets, where the default multithreading behavior via rayon may cause unexpected issues.
The project receives issues from both core maintainers and external users, indicating adoption beyond the core team without an overwhelming support burden. Maintainers typically respond to new issues and pull requests within a day. Work in the issue tracker centers on API design, image format support, and new feature development.