NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #547 most downloaded on crates.io
Imaging library. Provides basic image processing and encoders/decoders for common image formats.
Last release 7 months ago
10 Mar 2026
Ships fairly regularly
a new release about every 3 months
Most releases are documented
notes for 41 of the last 60 stable releases
3 versions withdrawn
withdrawn after publishing
12 years old
118 releases · first in 2014
Added GenericImage::copy_from_samples that can be implemented for images that can be efficiently filled from a matrix-layout of samples. Its default i
Features:
GenericImage::copy_from_samples that can be implemented for imagescopy_from, consider implementing this ifGenericImageView::to_pixel_view that can be implemented to describeFlatSamples matrix layout, if applicable. ThisImageBuffer::from_raw_bgr{,a} to efficiently byte-swap images intoExtendedColorType::Rgb5x1 to represent 5-bit colors as from TGA (#2609).metadata::LoopCount and AnimationDecoder::loop_count to query ifload_from_memory now utilizes format detection hooks if any are applicable.Structural changes:
image on codegen byGenericImage::copy_from's default implementation tries copy_from_samplesto_pixel_view.<ImageBuffer as GenericImage>::copy_from is now must faster forImageBuffer when the source implements GenericImageView::to_pixel_view.<SubImage<_> as GenericImage>::copy_from inherits the previously mentionedto_pixel_view based on the inner type.ImageBuffer::as_flat_samples no longer requires AsRef<[P::Subpixel]> forDeref (#2777).Bug fixes:
Notable decoder changes:
tiff to 0.11, supporting planar layout images (#2743).ravif to 0.13, supporting EXIF (#2733).jpeg-encoder to 0.7 bringing SIMD acceleration (#2736).pnm decoder decodes binary data quicker with fewer allocations (#2797).tga decoder handles 5-bit data and colormaps correctly (#2608, #2609).Compatibility notes (new section):
1.88.One column per quarter.
Support extracting XMP metadata from PNG, JPEG, GIF, WebP and TIFF files ( #2567 , #2634 , #2644 )
Features:
Pixel in a generic way (#2638)Structural changes:
rayon feature is enabled (#2643)doc_auto_cfg with doc_cfg (#2637)Bug fixes:
Reverted a signature change to load_from_memory that lead to large scale type inference breakage despite being technically compatible.
Re-release of 0.25.7
Fixes:
load_from_memory that lead to large scaleFrom version 0.25.7 (yanked)
Features:
image (#2372)API improvements:
save, save_with_format, write_to and write_with_encoder methods on DynamicImage now automatically convert the pixel format when necessary instead of returning an error (#2501)DynamicImage::has_alpha() convenience methodTryFrom<ExtendedColorType> for ColorType (#2444)const HAS_ALPHA to trait Pixelhooks module to customize builtin behavior, register_format_detection_hook and register_decoding_hook for the determining format of a file and selecting an ImageDecoder implementation respectively. (#2372)Performance improvements:
Bug fixes:
Added an API for external image format implementations to register themselves as decoders for a specific format in image
Features:
image (#2372)API improvements:
save, save_with_format, write_to and write_with_encoder methods on DynamicImage now automatically convert the pixel format when necessary instead of returning an error (#2501)DynamicImage::has_alpha() convenience methodTryFrom<ExtendedColorType> for ColorType (#2444)const HAS_ALPHA to trait Pixelhooks module to customize builtin behavior, register_format_detection_hook and register_decoding_hook for the determining format of a file and selecting an ImageDecoder implementation respectively. (#2372)Performance improvements:
Bug fixes:
Release 0.25.6
Release 0.25.6 (#2441)
Added support for decoding 10-bit and 12-bit AVIF
Features:
Bug fixes:
rayon feature now correctly toggles the use of rayon when encoding AVIF. (Previously it would be either always on or always off depending on the version of the ravif crate in your dependency tree.)Propose wording for republishing as 0.25.4
Propose wording for republishing as 0.25.4
Features:
ImageDecoder::orientation() and implemented orientation metadata extraction for JPEG, WebP and TIFF formatsDynamicImage::apply_orientation() to apply the orientation to an imageImageDecoder::exif_metadata(), and implemented it for JPEG and WebP formatsImageEncoder::set_icc_profile() and implemented it for WebP format. Pull requests with implementations for other formats are welcome.DynamicImage::fast_blur() for a linear-time approximation of Gaussian blur, which is much faster at larger blur radiiBug fixes:
None instead of an error when the end of the animation is reachedMuch faster decoding of lossless WebP due to a variety of optimizations. Our benchmarks show 2x to 2.5x improvement.
Features:
ImageDecoder::orientation() and implemented orientation metadata extraction for JPEG, WebP and TIFF formatsDynamicImage::apply_orientation() to apply the orientation to an imageImageDecoder::exif_metadata(), and implemented it for JPEG and WebP formatsImageEncoder::set_icc_profile() and implemented it for WebP format. Pull requests with implementations for other formats are welcome.DynamicImage::fast_blur() for a linear-time approximation of Gaussian blur, which is much faster at larger blur radiiBug fixes:
None instead of an error when the end of the animation is reachedrayon feature now correctly toggles the use of rayon within ravif (AVIF encoder). Previously it would be either always on or always off, depending on the ravif version.Yanked! This version accidentally missed a commit that should have been
included with the release. The Orientation struct should be in the
appropriate module instead of the top-level. This release won't be supported.
Added the HDR encoder to supported formats in generic write methods with the hdr feature enabled. Supports 32-bit float RGB color only, for now.
Features:
hdr feature enabled. Supports 32-bit float RGB color only, for now.ImageBuffer, DynamicImage and Frame the existing bufferimage::ImageReader as an alias.ImageEncoder for HdrEncoder.Structural changes
byteorder to byteorder-lite, consolidating some castingbytemuck.DynamicImage and buffers gained #[must_use] indications.Bug fixes:
bmp decoder.exr feature now compiles in isolation.Release 0.25.1
Release 0.25.1 (#2187)
Bug fixes:
ImageFormat::{reading_enabled, writing_enabled}.Removed ImageOutputFormat, GenericImageView::bounds, and several other deprecated items.
Breaking changes:
BufRead + Seek bound on many decoders.ExtendedColorType instead of ColorType when encoding.ImageOutputFormat, GenericImageView::bounds, and several other
deprecated items.ImageDecoder so the trait
is object safe.repr(transparent) rather than repr(C).Structural changes:
Codec changes:
Nothing published for this version
Added offsets to SubImage to compensate for the now-deprecated bounds call from GenericImageView.
Structural changes:
New features:
Bug fixes:
Added pure-Rust lossless WebP encoding.
New features:
DynamicImage::new method.PngDecoder::gamma_value method.ImageFormat::{reading_enabled, writing_enabled, all}.rayon feature.From<DynamicImage> for all image types.Bug fixes:
GifDecoder::with_limits to raise an error when limits are exceeded.Added {ImageBuffer, DynamicImage}::write_with_encoder to simplify writing images with custom settings.
New features:
{ImageBuffer, DynamicImage}::write_with_encoder to simplify writing
images with custom settings.GenericImageViewsBug fixes:
ImageDecoders now expose ICC profiles on supported formats.
Upgraded the PNG image encoder to use the newer PngEncoder::write_image instead of the deprecated PngEncoder::encode which did not account for byte or…
Structural changes:
tiff crate to 0.8.0.jpeg crate to 0.3.0.Bug fixes:
as_rgb32f function of DynamicImage is now correctly documented.PngEncoder::write_image
instead of the deprecated PngEncoder::encode which did not account for byte
order and could result in images with incorrect colors.InsufficientMemory error when trying to decode a PNG image.Performance:
Encoding for webp is now available with the native library. This needs to be activate explicitly with the web-encoder feature.
New Features:
webp is now available with the native library. This needs to
be activate explicitly with the web-encoder feature.exr decoding has gained basic limit support.Bug fixes:
Iterator::size_hint implementation of pixel iterators has been fixed to
return the current length indicated by its ExactSizeIterator hint.Performance:
ImageBuffer::get_pixel{,_mut} is now marked inline.resize now short-circuits when image dimensions are unchanged.TiffDecoder now supports setting resource limits.
New Features:
TiffDecoder now supports setting resource limits.Bug fixes:
CI now runs cargo-deny, checking dependent crates to an OSS license list and against RUSTSEC advisories.
Structural changes:
cargo-deny, checking dependent crates to an OSS license list
and against RUSTSEC advisories.New Features:
VP8X header.DX10 headers.Bug fixes:
DynamicImage/ImageBuffer's methods write_to and save will now
work properly even if the backing container is larger than the image layout
requires. Only the relevant slice of pixel data is passed to the encoder.gif decoder.ImageBuffer::get_pixel_checked would sometimes return the incorrect pixel.
Bug Fixes:
Minimum Rust version is now 1.56 and may change in minor versions until further notice. It is now tracked in the library's Cargo.toml, instead, by the
Breaking changes
Structural changes:
1.56 and may change in minor versions until
further notice. It is now tracked in the library's Cargo.toml, instead, by
the standard [package.rust-version] field. Note: this applies to the
library itself. You may need different version resolutions for dependencies
when using a non-stable version of Rust.math::utils::{nq, utils} modules have been removed. These are better
served through the color_quant crate and the standard library respectively.image::codecs, no longer top-level.ExtendedColorType and DynamicImage have been made #[non_exhaustive],
providing more methods instead of exhaustive matching.io::Reader, as well as generic
convenience interfaces, now requires the underlying reader to be BufRead + Seek. This allows more efficient support more formats. Similarly, writing
now requires writers to be Write + Seek.Bgra* variants of buffers, which were only half-supported, have been
removed. The owning buffer types ImageBuffer and DynamicImage
fundamentally already make a choice in supported pixel representations. This
allows for more consistent internal behavior. Callers are expected to convert
formats when using those buffers, which they are required to do in any case
already, and which is routinely performed by decoders.Trait reworks:
Pixel trait is no longer implemented quite as liberally for structs
defined in the crate. Instead, it is now restricted to a set of known channel
which ensures accuracy in computations involving those channels.ImageDecoderExt trait has been renamed to ImageDecoderRect, according
to its actual functionality.Pixel trait and its Subpixel field no longer require (or provide) a
'static lifetime bound.Pixel trait no longer requires specifying an associated, constant
ColorType. This was of little relevance to computation but made it much
harder to implement and extend correctly. Instead, the private
PixelWithColorType extension is added for interfaces that require a
properly known variant.SubImage interacts with the GenericImage trait. It is now a
default implementation. Note that SubImage now has inherent methods that
avoid double-indirection, the trait's method will no longer avoid this.Primitive trait now requires implementations to provide a minimum and
maximum logical bound for the purpose of converting to other primitive
representations.Additions
Image formats:
jpeg decoder has been upgraded to Lossless JPEG.AvifEncoder now correctly handles alpha-less images. Some additional
color formats are converted to RGBA as well.Bmp codec now decodes more valid images. It can decode a raw image
without performing the palette mapping. It provides a method to access the
palette. The encoder provides the inverse capabilities.Tiff is now an output format.Buffers and Operations:
f32 is now supported. Currently only the
OpenEXR codec makes full use of it but this is expected to change.ImageBuffer::{get_pixel_checked, get_pixel_mut_checked} provide panic-free
access to pixels and channels by returning Option<&P> and Option<&mut P>.ImageBuffer::write_to has been added, encoding the buffer to a writer. This
method already existed on DynamicImage.DynamicImage now implements From<_> for all supported buffer types.DynamicImage now implements Default, an empty Rgba8 image.imageops::overlay now takes coordinates as i64.Limits:
Limits and LimitSupport, utilized in io::Reader. These can be
configured for rudimentary protection against resource exhaustion (images
pretending to require a very large buffer). These types are not yet
exhaustive by design, and more and stricter limits may be added in the
future.set_limits extension to ImageDecoder. Some strict limit are opt-in, which
may cause decoding to fail if not supported.Miscellaneous:
PNMSubtype has been renamed to PnmSubtype, by Rust's naming scheme.PNM* aliases have been removed.enum types that had previously used a hidden variant now use the
official #[non_exhaustive] attribute instead.Unified gif blending in different decode methods, fixing out-of-bounds checks in a number of weirdly positioned frames.
Unified gif blending in different decode methods, fixing out-of-bounds checks in a number of weirdly positioned frames.
Hardened TGA decoder against a number of malicious inputs.
Fix forward incompatible usage of the panic macro.
Fix load_rect for gif reaching unreachable!() code.
Added ExtendedColorType::A8.
Allow TGA to load alpha-only images.
Optimized load_rect to avoid unnecessary seeks.
Fix an inconsistency in supported formats of different methods for encoding an image.
Fix an inconsistency in supported formats of different methods for encoding an image.
Fix thumbnail choosing an empty image. It now always prefer non-empty image
dimensions.
Fix integer overflow in calculating requires bytes for decoded image buffers for farbfeld, hdr, and pnm decoders. These will now error early.
Fix a panic decoding certain jpeg image without frames or meta data.
Optimized the jpeg encoder.
Optimized GenericImage::copy_from default impl in various cases.
Add avif decoders. You must enable it explicitly and it is not covered by
our usual MSRV policy of Rust 1.34. Instead, only latest stable is supported.
Add ImageFormat::{can_read, can_write}
Add Frame::buffer_mut
Add speed and quality options on avif encoder.
Add speed parameter to gif encoder.
Expose control over sequence repeat to the gif encoder.
Add {contrast,brighten,huerotate}_in_place functions in imageproc.
Relax Default impl of ImageBuffer, removing the bound on the color type.
Derive Debug, Hash, PartialEq, Eq for DynamicImage
Fix a soundness issue affecting the impls of Pixel::from_slice_mut. This would previously reborrow the mutable input reference as a shared one but the
Fix a soundness issue affecting the impls of Pixel::from_slice_mut. This
would previously reborrow the mutable input reference as a shared one but
then proceed to construct the mutable result reference from it. While UB
according to Rust's memory model, we're fairly certain that no miscompilation
can happen with the LLVM codegen in practice.
See 5cbe1e6767d11aff3f14c7ad69a06b04e8d583c7 for more details.
Fix imageops::blur panicking when sigma = 0.0. It now defaults to 1.0
as all negative values.
Fix re-exporting png::{CompressionType, FilterType} to maintain SemVer
compatibility with the 0.23 releases.
Add ImageFormat::from_extension
Add copyless DynamicImage to byte slice/vec conversion.
Add bit-depth specific into_ and to_ DynamicImage conversion methods.
Deprecated the clamp function. Use num-traits instead.
NeuQuant implementation is now supplied by color_quant. Use of the
type defined by this library is discouraged.jpeg decoder can now downscale images that are decoded by 1,2,4,8.clamp function. Use num-traits instead.ImageOutputFormat for AVIFtiff to 0.6 with lzw performance improvements.Added AVIF encoding capabilities using the ravif crate. Please note that the feature targets the latest stable compiler and is not enabled by default.
ravif crate. Please note that
the feature targets the latest stable compiler and is not enabled by default.ImageBuffer::as_raw to inspect the underlying container.gif to 0.11 with large performance improvements.Introduced correctly capitalized aliases for some scream case types
imageops::{vertical_gradient, horizontal_gradient} for writing
simple color gradients into an image.Pixels, PixelsMut, etc. by using exact
chunks internally. This should auto-vectorize ImageBuffer::from_pixel.Clone impls of iterators to not require a bound on the pixel.Debug impls for iterators where the pixel's channel implements it.FilterTypeflat::Error now implements the standard Error trait
flat::Error now implements the standard Error traitMap has been relaxed to ?Sizedimageops::tile function that repeats one image across anotherIterators over immutable pixels of ImageBuffer can now be cloned
ImageBuffer can now be clonedtga encoderColorMap::lookup, an optional reversal of the mapEncodableLayout trait is now exportedAdded png::ApngDecoder, an adapter decoding the animation in an APNG.
png::ApngDecoder, an adapter decoding the animation in an APNG.jpeg encoding that would darken output colors.FlatSamples::with_monocolor.ImageBuffer::as_flat_samples_mut which is a mutable variant of the
existing ffi-helper ImageBuffer::as_flat_samples.The png encoder now allows configuring compression and filter type. The output is not part of stability guarantees, see its documentation.
png encoder now allows configuring compression and filter type. The
output is not part of stability guarantees, see its documentation.jpeg encoder now accepts any implementor of GenericImageView. This
allows images that are only partially present in memory to be encoded.ImageBuffer now derives Hash, PartialEq, Eq.Pixels/PixelsMut iterator no longer yields out-of-bounds pixels when
the underlying buffer is larger than required.pbm decoder correctly decodes ascii data again, fixing a regression
where it would use the sample value 1 as white instead of 255.gif frames.Rows/RowsMut iterator no longer panics when the image has
a width or height of 0.Improved the performance of decoding animated gifs
crop_imm which functions like crop but on a shared referenceDisposalMethod::Any is treated as Keep, consistent with browsersError::sourceAdded ColorType::has_alpha to facilitate lossless conversion
ColorType::has_alpha to facilitate lossless conversionfarbfeld formatImageBuffer methodsThe dependency on jpeg-decoder now reflects minimum requirements.
jpeg-decoder now reflects minimum requirements.Fix cmyk_to_rgb (jpeg) causing off by one rounding errors.
…decoding and encoding. This necessitated many breaking changes anyways so it was used to improve the compliance to the interface guidelines such as ou…
This major release intends to improve the interface with regards to handling of color format data and errors for both decoding and encoding. This necessitated many breaking changes anyways so it was used to improve the compliance to the interface guidelines such as outstanding renaming.
It is not yet perfect with regards to color spaces but it was designed mainly as an improvement over the current interface with regards to in-memory color formats, first. We'll get to color spaces in a later major version.
ColorType:
Sized and one can crate slices of channel
values).ExtendedColorType is used to express more generic color formats for
which the library has limited support but can be converted/scaled/mapped
into a ColorType buffer. This operation might be fallible but, for
example, includes sources with 1/2/4-bit components.8-bit RGB and 16-bit BGR
are instantiations of RGB color model.ImageError:
ImageFormat have also been considered.Error::source that can be downcast to an error from a
matching version of the underlying decoders. Note that the version is not
part of the stable interface guarantees, this should not be relied upon
for correctness and only be used as an optimization.ImageDecoder trait:
read_image takes an output buffer argument instead of allocating all
memory on its own.dimensions now aligns with GenericImage sizes.colortype method was renamed to color_type for conformity.ColorType, DynamicImage, imageops::FilterType, ImageFormat
no longer re-export all of their variants in the top-level of the crate. This
removes the growing pollution in the documentation and usage. You can still
insert the equivalent statement on your own:
use image::ImageFormat::{self, *};encode operations is now uniformly an ImageResult<()>.tiff, png, gif, jpeg types,
mainly such as error conversion. This allows upgrading the dependency across
major versions without a major release in image itself.gif encoder no longer takes a
gif::Frame but rather deals with image::Frame only. If you require to
specify the disposal method, transparency, etc. then you may want to wait
with upgrading but (see next change).gif encoder now errors on invalid dimensions or unsupported color
formats. It would previously silently reinterpret bytes as RGB/RGBA.ImageFormat and other enum variants has been
adjusted to adhere to the API guidelines. These variants are now spelled
Gif, Png, etc. The same change has been made to the name of types such as
HDRDecoder.Progress type has finally received public accessor method. Strange that
no one reported them missing.PixelDensity and PixelDensityUnit to store DPI information in
formats that support encoding this form of meta data (e.g. in jpeg).Nothing published for this version
Added GenericImage::copy_within, specialized for ImageBuffer
GenericImage::copy_within, specialized for ImageBuffergif filesIntoIterator in example codeRemoved deprecated implementations of Error::description
Error::descriptionDynamicImage::into_* which convert without an additional allocation.gif with save_buffer.Added a new module io containing a configurable Reader. It can replace the bunch of free functions: image::{load_*, open, image_dimensions} while enab
io containing a configurable Reader. It can replace
the bunch of free functions: image::{load_*, open, image_dimensions} while
enabling new combinations such as open but with format deduced from content
instead of file path.const_err lint in the macro expanded implementations of Pixel. This
can only affect your crate if image is used as a path dependency.Undeprecate unsafe trait accessors. Further evaluation showed that their deprecation should be delayed until trait impl specialization is available.
unsafe trait accessors. Further evaluation showed that their
deprecation should be delayed until trait impl specialization is available.tiff images.DynamicImage::from_decoder.PNGReader that caused an infinite loop.ColorType::{bits_per_pixel, num_components}.ImageFormat::from_path, same format deduction as the open method.gif to web browser implementations.gif.lzw dependency, an indirect dependency in tiff.Fixed build without no features enabled
Nothing published for this version
Nothing published for this version
Fixed a variety of crashes and opaque errors in webp
unsafe operations into safe alternativesA fairly important bugfix backport
ImageBuffer index calculation for very, very large imagesNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →