NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #2243 most downloaded on crates.io
Library for fast image resizing with using of SIMD instructions
Last release 2 months ago
21 Jul 2026
Release timing varies
gaps range from 1 weeks to 6 months
Nearly every release is documented
notes for 52 of 54 stable releases
5 versions withdrawn
withdrawn after publishing
5 years old
59 releases · first in 2021
One column per quarter.
Improved speed of AVX2 implementation for vertical convolution pass for pixel types based on u8 components.
AVX2 implementation for vertical convolution pass for pixel types based on u8 components.native implementation for vertical convolution pass for pixel types based on u16 components.rayon thread pool with only one thread to resize with ResizeAlg::Nearest algorithm.BREAKING : Added support of no_std environment ( #58 ). To use the crate in a such environment, you must disable default features and enabled the no_s
BREAKING: Added support of no_std
environment (#58).
To use the crate in a such environment, you must disable
default features and enabled the no_std feature.
If you already have default features disabled and want to continue
using the crate in std environment, you have to enable
the std feature.
BREAKING: Added support of no_std
environment (#58). To
use the crate in such an environment, you must disable default features and
enable the no_std feature.
If you already have default features disabled and want to continue using the
crate in std environment, you have to enable the std feature.
This version was yanked due to a backwards compatibility break - a new feature std was added to the list of default features.
This version was yanked due to a backwards compatibility break - a new feature std was added to the list of default features.
Added support of some variants of ImageBuffer type form the image crate ( #57 ).
ImageBuffer type form the image crate (#57).ImageBuffer type from the image crate
(#57).Added bytemuck feature and implemented some bytemuck traits for the Pixel type ( #56 ).
bytemuck feature and implemented some bytemuck traits for the Pixel type (#56).Added support for multi-thread image resizing using the ResizeAlg::Nearest algorithm ( #54 ).
ResizeAlg::Nearest algorithm (#54).Fixed a "divide by zero" error in case of using multithreading to resize images with particular sizes ( #55 ).
Added minimum supported Rust version (MSRV) into Cargo.toml .
Cargo.toml.Added support of DynamicImage::ImageRgb32F and DynamicImage::ImageRgba32F form the image crate ( #50 ).
DynamicImage::ImageRgb32F and DynamicImage::ImageRgba32F form the image crate (#50).Fixed SSE4.1 and AVX2 implementation for dividing image by alpha channel for images with U16x2 pixels.
SSE4.1 and AVX2 implementation for dividing image by alpha channel for images with U16x2 pixels.NEON implementation for dividing image by alpha channel for images with U16x2 and U16x4 pixels .Fixed error in NEON implementation of MulDiv::multiply_alpha() and MulDiv::multiply_alpha_inplace() for U8x2 pixels (#49).
Fixed the error in the implementation of ImageView::split_by_width(), ImageView::split_by_height(), ImageViewMut::split_by_width_mut() and ImageViewMu
ImageView::split_by_width(),
ImageView::split_by_height(),
ImageViewMut::split_by_width_mut() and ImageViewMut::split_by_height_mut()
(#46).Fixed the error in the implementation of ImageView::split_by_width(), ImageView::split_by_height(), ImageViewMut::split_by_width_mut() and ImageViewMu
ImageView::split_by_width(),
ImageView::split_by_height(),
ImageViewMut::split_by_width_mut() and ImageViewMut::split_by_height_mut()
(#43).Improved speed (about 9%) of SSE4.1 implementation for vertical convolution pass for pixel types based on u8 components.
SSE4.1 implementation for vertical convolution
pass for pixel types based on u8
components.is_aarch64_feature_detected() is used now in the
CpuExtensions::is_supported() method for aarch64 architecture.Added support for multi-thread image processing with the help of rayon crate. You should enable rayon feature to turn on this behavior.
Added support for multi-thread image processing with the help of rayon
crate. You should enable rayon feature to turn on this behavior.
Added methods to split the image in different directions:
ImageView::split_by_height()ImageView::split_by_width()ImageViewMut::split_by_height_mut()ImageViewMut::split_by_width_mut()These methods have the default implementation and are used for multi-thread image processing.
Send, Sync and Sized to the ImageView
trait.Fixed SSE4.1 and AVX2 implementation fo dividing image by alpha channel for images with U16x2 pixels.
SSE4.1 and AVX2 implementation fo dividing image by alpha channel
for images with U16x2 pixels.NEON implementation for dividing image by alpha channel for images
with U16x2 and U16x4 pixels.Nothing published for this version
Disabled default features of the image crate (#36).
image crate (#36).Added new resize algorithm ResizeAlg::Interpolation (#32).
Added new resize algorithm ResizeAlg::Interpolation (#32).
It is like ResizeAlg::Convolution but with a fixed kernel size. This
algorithm can be useful if you want to get a result similar to OpenCV
(except INTER_AREA interpolation).
Added support for optimization with the help of SSE4.1 and AVX2 for the F32 pixel type.
SSE4.1 and AVX2 for the
F32 pixel type.F32x2, F32x3 and F32x4 with
optimizations for SSE4.1 and AVX2 (#30).A lot of breaking changes have been done in this release:
PixelType::size() was made public.ImageRefTypedImageRefTypedImageTypedCroppedImageTypedCroppedImageMutCroppedImageCroppedImageMutA lot of breaking changes have been done in this release:
ImageView and ImageViewMut have been removed. They always did
unnecessary memory allocation to store references to image rows. Instead of
these structures, the ImageView and ImageViewMut traits have been added.
The crate accepts any image container that provides these traits.IntoImageView and IntoImageViewMut have been added. They
allow you to write runtime adapters to convert your particular image container
into something that provides ImageView/ImageViewMut trait.Resizer now has two methods for resize (dynamic and typed):
resize() accepts references to impl IntoImageView and
impl IntoImageViewMut;resize_typed() accepts references to impl ImageView and
impl ImageViewMut.options argument. With the help of this
argument, you can specify:
U8x2, U8x4, U16x2 and U16x4
pixels.resize_alg was removed from Resizer::new() method, use
options argument of methods to resize instead.MulDiv implementation has been changed in the same way as Resizer. It
now has two versions of each method:
dynamic and typed.NonZeroU32 into u32. Now
you can create and use zero-sized images.Image (embedded implementation of image container) moved from root of the
crate into module images.IntoImageView and IntoImageViewMut for the
DynamicImage type
from the image crate. This implementation allows you to use DynamicImage
instances as arguments for methods of this crate.Look at the difference between versions 3 and 4 on example of resizing RGBA8 image from given u8-buffer with pixels-data.
3.x version:
use fast_image_resize::{Image, MulDiv, PixelType, Resizer};
use std::num::NonZeroU32;
fn my_resize(
src_width: u32,
src_height: u32,
src_pixels: &mut [u8],
dst_width: u32,
dst_height: u32,
) -> Image {
let src_width = NonZeroU32::new(src_width).unwrap();
let src_height = NonZeroU32::new(src_height).unwrap();
let src_image = Image::from_slice_u8(
src_width,
src_height,
src_pixels,
PixelType::U8x4,
).unwrap();
// Multiple RGB channels of source image by alpha channel.
let alpha_mul_div = MulDiv::default();
let mut tmp_image = Image::new(
src_width,
src_height,
PixelType::U8x4,
);
alpha_mul_div
.multiply_alpha(
&src_image.view(),
&mut tmp_image.view_mut(),
).unwrap();
// Create container for data of destination image.
let dst_width = NonZeroU32::new(dst_width).unwrap();
let dst_height = NonZeroU32::new(dst_height).unwrap();
let mut dst_image = Image::new(
dst_width,
dst_height,
PixelType::U8x4,
);
// Get mutable view of destination image data.
let mut dst_view = dst_image.view_mut();
// Create Resizer instance and resize source image
// into buffer of destination image.
let mut resizer = Resizer::default();
resizer.resize(&tmp_image.view(), &mut dst_view).unwrap();
// Divide RGB channels of destination image by alpha.
alpha_mul_div.divide_alpha_inplace(&mut dst_view).unwrap();
dst_image
}
4.x version:
use fast_image_resize::images::{Image, ImageRef};
use fast_image_resize::{PixelType, Resizer};
fn my_resize(
src_width: u32,
src_height: u32,
src_pixels: &[u8],
dst_width: u32,
dst_height: u32,
) -> Image {
let src_image = ImageRef::new(
src_width,
src_height,
src_pixels,
PixelType::U8x4,
).unwrap();
// Create container for data of destination image.
let mut dst_image = Image::new(
dst_width,
dst_height,
PixelType::U8x4,
);
// Create Resizer instance and resize source image
// into buffer of destination image.
let mut resizer = Resizer::new();
// By default, Resizer multiplies and divides by alpha channel
// images with U8x2, U8x4, U16x2 and U16x4 pixels.
resizer.resize(&src_image, &mut dst_image, None).unwrap();
dst_image
}
Fixed the error with incorrect cropping of the source image.
Fixed version of num-traits in the Cargo.toml.
num-traits in the Cargo.toml.Added Custom variant for FilterType enum and corresponding Filter structure.
Custom variant for FilterType enum and corresponding Filter
structure.CropBoxError::WidthOrHeightLessOrEqualToZero.AVX2 implementation of Convolution
trait for U8x3 and U8x4 images.U8x4 structure. Now it is
[u8; 4] instead of u32.x86_64) speed of vertical convolution
pass implemented in native Rust for U8,
U8x2, U8x3 and U8x4 images.U8, U8x2, U8x3 and U8x4
images. Now a vertical pass is the first and a horizontal pass is the second.CropBox fields has been changed to f64. Now you
can use fractional size and position of crop box.centering argument of
ImageView::set_crop_box_to_fit_dst_size()
and DynamicImageView::set_crop_box_to_fit_dst_size() methods has been
changed to Optional<(f64, f64)>.crop_box argument of ImageViewMut::crop() and
DynamicImageViewMut::crop()
methods has been replaced with separate left, top, width and height
arguments.Nothing published for this version
Nothing published for this version
Fixed size of rows in cropped ImageViewMut created by ImageViewMut::crop method (#17).
ImageViewMut created by
ImageViewMut::crop method
(#17).Added using of (read|write)_unaligned for unaligned pointers on arm64 and wasm32 architectures. (#15).
arm64 and
wasm32 architectures.
(#15).Added using of (read|write)_unaligned for unaligned pointers on x86_64 architecture. (#16).
x86_64
architecture. (#16).Added method DynamicImageViewMut::crop() to create cropped version of DynamicImageViewMut (#13).
DynamicImageViewMut::crop() to create cropped version of
DynamicImageViewMut
(#13).ImageViewMut::crop() to create cropped version of
ImageViewMut.Slightly improved speed of Convolution implementation for U8x2 images and Wasm32 SIMD128 instructions.
Convolution implementation for U8x2 images and
Wasm32 SIMD128 instructions.Image::buffer_mut() was made public
(#14)Added support of optimisation with the help of Wasm32 SIMD128 for all types of images exclude I32 and F32 (thanks to @cdmurph32, #11).
Wasm32 SIMD128 for all types
of images exclude I32 and F32
(thanks to
@cdmurph32, #11).glassbench replaced by criterion.wasm32-wasi target.Slightly improved speed of MulDiv implementation for U8x2, U8x4, U16x2 and U16x4 images.
MulDiv implementation for U8x2, U8x4, U16x2
and U16x4 images.U16x2 images by MulDiv with helps of
NEON SIMD instructions.From trait to convert ImageViewMut into ImageView.From trait to convert DynamicImageViewMut into
DynamicImageView.Added support of optimisation with helps of NEON SIMD for convolution of U16 images.
NEON SIMD for convolution of
U16 images.NEON SIMD for convolution of
U16x2 images.NEON SIMD for convolution of
U16x3 images.NEON SIMD for U8
images.Added support of optimisation with helps of NEON SIMD for convolution of U8 images.
NEON SIMD for convolution of
U8 images.NEON SIMD for convolution of
U8x2 images.NEON SIMD for convolution of
U8x3 images.U8x2 images by MulDiv with helps of
NEON SIMD instructions.Added method CpuExtensions::is_supported(&self).
CpuExtensions::is_supported(&self).PixelComponentMapper changed to use heap to store its data.NEON SIMD for convolution of
U16x4 images.U16x4 images by MulDiv with helps of
NEON SIMD instructions.U8 images with helps of
SSE4.1 instructions.README.md file.MulDiv::divide_alpha() and
MulDiv::divide_alpha_inplace()
for U16x4 pixels with optimisation with helps of SSE4.1 and AVX2.MulDiv with helps of NEON SIMD for U8x4 pixels.Struct ImageView replaced by enum DynamicImageView.
ImageView replaced by enum DynamicImageView.ImageViewMut replaced by enum DynamicImageViewMut.Pixel renamed into PixelExt and some its internals changed:
ComponentsCount renamed into CountOfComponents.ComponentCountOfValues deleted.components_count renamed into
count_of_components.component_count_of_values renamed into
count_of_component_values.U8, U8x2, ...) replaced by type aliases for new
generic structure Pixel. Use method new()
to create instance of one pixel.PixelComponentMapper that holds tables for mapping values of
pixel's components in forward and backward directions.create_gamma_22_mapper() to create instance of
PixelComponentMapper
that converts images with gamma 2.2 to linear colorspace and back.create_srgb_mapper() to create instance of
PixelComponentMapper
that converts images from SRGB colorspace to linear RGB and back.ImageView and ImageViewMut.change_type_of_pixel_components and
change_type_of_pixel_components_dyn that change type of pixel's components
in whole image.IntoPixelComponent<Out: PixelComponent>.Pixel for create all types of pixels.SSE4.1 for convolution of
U8x3 images.NEON SIMD for convolution of
U8x4 images.U8x4 images by MulDiv with helps of
NEON SIMD instructions.--high_precision to use u16 as pixel components for
intermediate image representation.Added example of command line application "resizer".
Fixed resizing when the destination image has the same dimensions as the source image (#9).
Added support of new type of pixels PixelType::U16x4.
PixelType::U16x4.resizer
crate.image crate from benchmarks for resizing images with alpha.Image::copy(&self) -> Image<'static>.- Fixed README.md
Added support of new type of pixels PixelType::U16x2 (e.g. luma with alpha channel).
PixelType::U16x2
(e.g. luma with alpha channel).Added support of new type of pixels PixelType::U16.
PixelType::U16.Added optimisation for convolution of U8x2 images with helps of SSE4.1.
U8x2 images with helps of SSE4.1.Added optimisation for processing U8x2 images by MulDiv with helps of SSE4.1 and AVX2 instructions.
U8x2 images by MulDiv with helps of
SSE4.1 and AVX2 instructions.U16x2 images with helps of
AVX2 instructions.Added support of new type of pixels PixelType::U8x2.
PixelType::U8x2.MulDiv support of images with pixel type U8x2.Image::into_vec(self) -> Vec<u8>
(#7).Added optimisation for convolution of U16x3 images with helps of SSE4.1 and AVX2 instructions.
SSE4.1
and AVX2 instructions.SSE4.1 instructions.Image, ImageVew and ImageViewMut
from a buffer larger than necessary
(#5).Image::from_vec_u32(), Image::from_slice_u32().InvalidBufferSizeError.Added support of new type of pixels PixelType::U16x3.
PixelType::U16x3.U16x3 into the enum PixelType.Added optimisation of multiplying and dividing image by alpha channel with helps of SSE4.1 instructions.
SSE4.1 instructions.SSE2 from enum CpuExtensions.Added optimisation of convolution U8x3 images with helps of AVX2 instructions.
AVX2
instructions.SSE4.1
instructions.AVX2
instructions.Fixed compile errors on non-x86 architectures.
Fixed compile errors on non-x86 architectures.
Added support of new type of pixels PixelType::U8x3 (with auto-vectorization for SSE4.1).
PixelType::U8x3 (with auto-vectorization
for SSE4.1).fast_image_resize::pixels with types U8x3,
U8x4, F32, I32, U8 used as wrappers for represent type of one pixel of
image.U8x3 into the enum PixelType.ImageRows
and ImageRowsMut enums.Added optimisation of convolution grayscale images (U8) with helps of AVX2 instructions.
AVX2
instructions.Added support of new type of pixels PixelType::U8 (without forced SIMD).
PixelType::U8 (without forced SIMD).ImageData renamed into Image.SrcImageView and DstImageView replaced by ImageView
and ImageViewMut.Resizer.resize() now returns
Result<(), DifferentTypesOfPixelsError>.Added support of compilation for architectures other than x86_64.
Added method SrcImageView.set_crop_box_to_fit_dst_size().
SrcImageView.set_crop_box_to_fit_dst_size().ImageData.
from_vec_u32(), from_vec_u8(), from_slice_u32(),
from_slice_u8().from_buffer(), from_pixels().Fixed typo in name of CatmullRom filter type.
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →