fast_image_resize 5.2.0

Library for fast image resizing with using of SIMD instructions
Documentation
<!-- introduction start -->

## Benchmarks of fast_image_resize crate for arm64 architecture

Environment:

- CPU: Neoverse-N1 2GHz (Oracle Cloud Compute, VM.Standard.A1.Flex)
- Ubuntu 24.04 (linux 6.11.0)
- Rust 1.87.0
- criterion = "0.5.1"
- fast_image_resize = "5.1.4"

Other libraries used to compare of resizing speed:

- image = "0.25.6" (<https://crates.io/crates/image>)
- resize = "0.8.8" (<https://crates.io/crates/resize>, single-threaded mode)
- libvips = "8.15.1" (single-threaded mode)

Resize algorithms:

- Nearest
- Box - convolution with minimal kernel size 1x1 px
- Bilinear - convolution with minimal kernel size 2x2 px
- Bicubic (CatmullRom) - convolution with minimal kernel size 4x4 px
- Lanczos3 - convolution with minimal kernel size 6x6 px

<!-- introduction end -->

<!-- bench_compare_rgb start -->

### Resize RGB8 image (U8x3) 4928x3279 => 852x567

Pipeline:

`src_image => resize => dst_image`

- Source image [nasa-4928x3279.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png
- Numbers in the table mean a duration of image resizing in milliseconds.

|          | Nearest |  Box   | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:------:|:--------:|:-------:|:--------:|
| image    |  83.12  |   -    |  170.54  | 305.90  |  433.80  |
| resize   |  30.38  | 59.92  |  101.62  | 183.87  |  273.82  |
| libvips  |  9.59   | 137.52 |  26.91   |  66.06  |  88.65   |
| fir rust |  0.92   | 19.25  |  32.19   |  82.86  |  110.04  |
| fir neon |  0.92   | 16.46  |  23.75   |  42.43  |  62.16   |

<!-- bench_compare_rgb end -->

<!-- bench_compare_rgba start -->

### Resize RGBA8 image (U8x4) 4928x3279 => 852x567

Pipeline:

`src_image => multiply by alpha => resize => divide by alpha => dst_image`

- Source image
  [nasa-4928x3279-rgba.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png
- Numbers in the table mean a duration of image resizing in milliseconds.
- The `image` crate does not support multiplying and dividing by alpha channel.

|          | Nearest |  Box   | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:------:|:--------:|:-------:|:--------:|
| resize   |  20.69  | 73.58  |  113.62  | 195.21  |  291.60  |
| libvips  |  13.87  | 326.93 |  234.51  | 471.17  |  599.71  |
| fir rust |  0.92   | 44.76  |  58.95   | 126.45  |  165.50  |
| fir neon |  0.92   | 29.08  |  40.81   |  64.57  |  90.29   |

<!-- bench_compare_rgba end -->

<!-- bench_compare_l start -->

### Resize L8 image (U8) 4928x3279 => 852x567

Pipeline:

`src_image => resize => dst_image`

- Source image [nasa-4928x3279.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png
  has converted into grayscale image with one byte per pixel.
- Numbers in the table mean a duration of image resizing in milliseconds.

|          | Nearest |  Box  | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image    |  78.35  |   -   |  119.04  | 186.56  |  258.32  |
| resize   |  11.31  | 26.78 |  40.38   |  70.32  |  93.02   |
| libvips  |  5.68   | 51.41 |  14.45   |  24.51  |  31.19   |
| fir rust |  0.48   | 9.30  |  10.73   |  18.47  |  25.09   |
| fir neon |  0.48   | 4.92  |   7.48   |  13.16  |  20.15   |

<!-- bench_compare_l end -->

<!-- bench_compare_la start -->

### Resize LA8 image (U8x2) 4928x3279 => 852x567

Pipeline:

`src_image => multiply by alpha => resize => divide by alpha => dst_image`

- Source image
  [nasa-4928x3279-rgba.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png
  has converted into grayscale image with an alpha channel (two bytes per pixel).
- Numbers in the table mean a 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 |  Box   | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:------:|:--------:|:-------:|:--------:|
| libvips  |  8.81   | 188.05 |  134.45  | 231.87  |  290.01  |
| fir rust |  0.66   | 18.79  |  25.40   |  43.31  |  55.68   |
| fir neon |  0.66   | 16.88  |  21.07   |  32.55  |  44.99   |

<!-- bench_compare_la end -->

<!-- bench_compare_rgb16 start -->

### Resize RGB16 image (U16x3) 4928x3279 => 852x567

Pipeline:

`src_image => resize => dst_image`

- Source image [nasa-4928x3279.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png
  has converted into RGB16 image.
- Numbers in the table mean a duration of image resizing in milliseconds.

|          | Nearest |  Box   | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:------:|:--------:|:-------:|:--------:|
| image    |  82.91  |   -    |  173.38  | 338.57  |  493.64  |
| resize   |  19.50  | 58.09  |  98.29   | 183.34  |  267.44  |
| libvips  |  23.67  | 197.37 |  109.00  | 228.02  |  301.44  |
| fir rust |  1.39   | 48.64  |  76.07   | 135.93  |  191.26  |
| fir neon |  1.39   | 54.50  |  72.78   | 111.57  |  138.66  |

<!-- bench_compare_rgb16 end -->

<!-- bench_compare_rgba16 start -->

### Resize RGBA16 image (U16x4) 4928x3279 => 852x567

Pipeline:

`src_image => multiply by alpha => resize => divide by alpha => dst_image`

- Source image
  [nasa-4928x3279-rgba.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png
- Numbers in the table mean a duration of image resizing in milliseconds.
- The `image` crate does not support multiplying and dividing by alpha channel.

|          | Nearest |  Box   | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:------:|:--------:|:-------:|:--------:|
| resize   |  23.64  | 77.94  |  115.55  | 206.91  |  303.21  |
| libvips  |  33.79  | 329.22 |  236.24  | 466.96  |  591.03  |
| fir rust |  1.51   | 73.59  |  108.54  | 200.42  |  267.85  |
| fir neon |  1.51   | 45.25  |  60.21   |  90.64  |  120.82  |

<!-- bench_compare_rgba16 end -->

<!-- bench_compare_l16 start -->

### Resize L16 image (U16) 4928x3279 => 852x567

Pipeline:

`src_image => resize => dst_image`

- Source image [nasa-4928x3279.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png
  has converted into grayscale image with two bytes per pixel.
- Numbers in the table mean a duration of image resizing in milliseconds.

|          | Nearest |  Box  | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image    |  78.13  |   -   |  123.28  | 195.56  |  272.13  |
| resize   |  11.84  | 25.06 |  38.29   |  68.43  |  95.25   |
| libvips  |  9.27   | 69.76 |  38.82   |  76.85  |  100.79  |
| fir rust |  0.64   | 23.31 |  35.76   |  58.21  |  85.60   |
| fir neon |  0.64   | 11.80 |  16.48   |  26.00  |  36.87   |

<!-- bench_compare_l16 end -->

<!-- bench_compare_la16 start -->

### Resize LA16 (luma with alpha channel) image (U16x2) 4928x3279 => 852x567

Pipeline:

`src_image => multiply by alpha => resize => divide by alpha => dst_image`

- Source image
  [nasa-4928x3279-rgba.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png
  has converted into grayscale image with an alpha channel (four bytes per pixel).
- Numbers in the table mean a 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 |  Box   | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:------:|:--------:|:-------:|:--------:|
| libvips  |  18.43  | 202.03 |  145.95  | 242.56  |  302.87  |
| fir rust |  0.93   | 41.87  |  60.11   | 101.73  |  140.40  |
| fir neon |  0.93   | 24.30  |  33.30   |  52.33  |  71.84   |

<!-- bench_compare_la16 end -->

<!-- bench_compare_l32f start -->

### Resize L32F image (F32) 4928x3279 => 852x567

Pipeline:

`src_image => resize => dst_image`

- Source image [nasa-4928x3279.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png
  has converted into grayscale image with two bytes per pixel.
- Numbers in the table mean a duration of image resizing in milliseconds.

|          | Nearest |  Box  | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:-----:|:--------:|:-------:|:--------:|
| image    |  7.06   |   -   |  39.97   |  72.83  |  106.05  |
| resize   |  12.14  | 23.30 |  32.60   |  55.84  |  83.37   |
| libvips  |  8.20   | 67.17 |  40.19   |  90.36  |  118.79  |
| fir rust |  0.93   | 18.92 |  30.89   |  54.12  |  78.40   |

<!-- bench_compare_l32f end -->

Note:
The `resize` crate uses `f32` for intermediate calculations.
The `fast_image_resize` uses `f64`. This is a reason why `fast_image_resize`
is slower or equal in cases with `f32`-based pixels.

<!-- bench_compare_la32f start -->

### Resize LA32F (luma with alpha channel) image (F32x2) 4928x3279 => 852x567

Pipeline:

`src_image => multiply by alpha => resize => divide by alpha => dst_image`

- Source image
  [nasa-4928x3279-rgba.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png
  has converted into grayscale image with an alpha channel (two `f32` values per pixel).
- Numbers in the table mean a 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 |  Box   | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:------:|:--------:|:-------:|:--------:|
| libvips  |  16.89  | 184.38 |  129.68  | 225.33  |  283.49  |
| fir rust |  1.52   | 38.62  |  61.88   | 116.00  |  162.75  |

<!-- bench_compare_la32f end -->

<!-- bench_compare_rgb32f start -->

### Resize RGB32F image (F32x3) 4928x3279 => 852x567

Pipeline:

`src_image => resize => dst_image`

- Source image [nasa-4928x3279.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279.png
  has converted into RGB32F image.
- Numbers in the table mean a duration of image resizing in milliseconds.

|          | Nearest |  Box   | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:------:|:--------:|:-------:|:--------:|
| image    |  8.00   |   -    |  51.74   |  95.36  |  139.32  |
| resize   |  19.96  | 45.73  |  69.25   | 133.08  |  190.53  |
| libvips  |  19.48  | 197.65 |  114.33  | 274.50  |  354.63  |
| fir rust |  2.29   | 39.09  |  71.75   | 149.96  |  214.76  |

<!-- bench_compare_rgb32f end -->


<!-- bench_compare_rgba32f start -->

### Resize RGBA32F image (F32x4) 4928x3279 => 852x567

Pipeline:

`src_image => multiply by alpha => resize => divide by alpha => dst_image`

- Source image
  [nasa-4928x3279-rgba.png]https://github.com/Cykooz/fast_image_resize/blob/main/data/nasa-4928x3279-rgba.png
- Numbers in the table mean a duration of image resizing in milliseconds.
- The `image` crate does not support multiplying and dividing by alpha channel.
- The `resize` crate does not support multiplying and dividing by alpha channel
  for this pixel format.

|          | Nearest |  Box   | Bilinear | Bicubic | Lanczos3 |
|----------|:-------:|:------:|:--------:|:-------:|:--------:|
| libvips  |  32.13  | 323.66 |  230.94  | 456.97  |  587.84  |
| fir rust |  3.01   | 68.00  |  111.35  | 209.27  |  315.19  |

<!-- bench_compare_rgba32f end -->