Environment:
- CPU: Neoverse-N1 2GHz (Oracle Cloud Compute, VM.Standard.A1.Flex)
- Ubuntu 22.04 (linux 5.19.0)
- Rust 1.69.0
- criterion = "0.4"
- fast_image_resize = "2.7.1"
Other Rust libraries used to compare of resizing speed:
- image = "0.24.6" (https://crates.io/crates/image)
- resize = "0.7.4" (https://crates.io/crates/resize)
Resize algorithms:
- Nearest
- Convolution with Bilinear filter
- Convolution with CatmullRom filter
- Convolution with Lanczos3 filter
Pipeline:
src_image => resize => dst_image
- Source image nasa-4928x3279.png
- Numbers in table is mean duration of image resizing in milliseconds.
Nearest | Bilinear | CatmullRom | Lanczos3 | |
---|---|---|---|---|
image | 85.83 | 172.77 | 327.49 | 461.80 |
resize | - | 90.01 | 178.96 | 267.73 |
fir rust | 0.97 | 72.19 | 87.72 | 113.52 |
fir neon | - | 43.11 | 57.52 | 81.95 |
Pipeline:
src_image => multiply by alpha => resize => divide by alpha => dst_image
- Source image nasa-4928x3279-rgba.png
- Numbers in table is mean duration of image resizing in milliseconds.
- The
image
crate does not support multiplying and dividing by alpha channel.
Nearest | Bilinear | CatmullRom | Lanczos3 | |
---|---|---|---|---|
resize | - | 115.37 | 199.42 | 294.89 |
fir rust | 1.06 | 94.14 | 106.85 | 155.85 |
fir neon | - | 44.97 | 62.11 | 84.34 |
Pipeline:
src_image => resize => dst_image
- Source image nasa-4928x3279.png has converted into grayscale image with one byte per pixel.
- Numbers in table is mean duration of image resizing in milliseconds.
Nearest | Bilinear | CatmullRom | Lanczos3 | |
---|---|---|---|---|
image | 76.70 | 105.97 | 177.56 | 246.03 |
resize | - | 38.08 | 84.12 | 129.19 |
fir rust | 0.50 | 29.84 | 37.68 | 45.70 |
fir neon | - | 15.13 | 20.21 | 28.06 |
Pipeline:
src_image => multiply by alpha => resize => divide by alpha => dst_image
- Source image nasa-4928x3279-rgba.png has converted into grayscale image with alpha channel (two bytes per pixel).
- Numbers in table is mean duration of image resizing in milliseconds.
- The
image
crate does not support multiplying and dividing by alpha channel. - The
resize
crate does not support this pixel format.
Nearest | Bilinear | CatmullRom | Lanczos3 | |
---|---|---|---|---|
fir rust | 0.69 | 60.27 | 75.29 | 73.66 |
fir neon | - | 35.24 | 39.87 | 55.15 |
Pipeline:
src_image => resize => dst_image
- Source image nasa-4928x3279.png has converted into RGB16 image.
- Numbers in table is mean duration of image resizing in milliseconds.
Nearest | Bilinear | CatmullRom | Lanczos3 | |
---|---|---|---|---|
image | 86.76 | 167.74 | 333.95 | 483.54 |
resize | - | 90.74 | 181.57 | 270.82 |
fir rust | 1.57 | 147.41 | 276.09 | 394.25 |
fir neon | - | 74.86 | 93.61 | 129.32 |
Pipeline:
src_image => multiply by alpha => resize => divide by alpha => dst_image
- Source image nasa-4928x3279-rgba.png
- Numbers in table is mean duration of image resizing in milliseconds.
- The
image
crate does not support multiplying and dividing by alpha channel.
Nearest | Bilinear | CatmullRom | Lanczos3 | |
---|---|---|---|---|
resize | - | 120.12 | 205.34 | 304.43 |
fir rust | 1.66 | 204.22 | 369.08 | 523.95 |
fir neon | - | 79.02 | 119.04 | 161.24 |
Pipeline:
src_image => resize => dst_image
- Source image nasa-4928x3279.png has converted into grayscale image with two bytes per pixel.
- Numbers in table is mean duration of image resizing in milliseconds.
Nearest | Bilinear | CatmullRom | Lanczos3 | |
---|---|---|---|---|
image | 77.69 | 111.50 | 189.42 | 262.56 |
resize | - | 41.61 | 64.26 | 88.40 |
fir rust | 0.70 | 57.42 | 95.45 | 135.30 |
fir neon | - | 17.54 | 26.77 | 37.92 |
Pipeline:
src_image => multiply by alpha => resize => divide by alpha => dst_image
- Source image nasa-4928x3279-rgba.png has converted into grayscale image with alpha channel (four bytes per pixel).
- Numbers in table is mean duration of image resizing in milliseconds.
- The
image
crate does not support multiplying and dividing by alpha channel. - The
resize
crate does not support this pixel format.
Nearest | Bilinear | CatmullRom | Lanczos3 | |
---|---|---|---|---|
fir rust | 1.06 | 106.70 | 193.68 | 272.60 |
fir neon | - | 36.37 | 54.91 | 74.60 |