62 breaking releases

new 0.65.0 Mar 21, 2025
0.63.0 Mar 5, 2025
0.53.0 Dec 19, 2024
0.49.0 Nov 28, 2024
0.12.0 Mar 28, 2024

#297 in Images

Download history 1069/week @ 2024-12-04 1144/week @ 2024-12-11 799/week @ 2024-12-18 268/week @ 2024-12-25 359/week @ 2025-01-01 935/week @ 2025-01-08 1086/week @ 2025-01-15 983/week @ 2025-01-22 1086/week @ 2025-01-29 765/week @ 2025-02-05 1037/week @ 2025-02-12 1514/week @ 2025-02-19 1532/week @ 2025-02-26 1266/week @ 2025-03-05 1251/week @ 2025-03-12 1477/week @ 2025-03-19

5,876 downloads per month
Used in 26 crates (3 directly)

MIT license

50KB
1.5K SLoC

Rust 1K SLoC // 0.1% comments JavaScript 326 SLoC // 0.1% comments

deno_canvas

Extension that implements various OffscreenCanvas related APIs.

Image processing architecture in Rust

flowchart LR
  Input["input binary<br/>( &[u8] )"]
  II["intermediate image<br/>( DynamicImage )"]
  Ops["processing pixel<br/>( ImageBuffer< P, S > )"]
  Output["output binary<br/>( Box<[u8]> )"]
  Input --> II
  II --> Ops --> II
  II --> Output

The architecture of image processing in Rust is rely on the structure of image crate.
If the input is a image of binary, it convert to an intermediate image (DynamicImage in image) with using a decoder corresponding to its image formats.
After converting to an intermediate image, it can process various way for example, to use the pixel processong operation imageops supplied by image.
On the other hand, there can also to implement your own pixel processong operation to refer to the implementation of imageops as here or image_ops.rs module.
You can treat any bit depth that supported by image with generics in the processing pixel layer.

Dependencies

~97MB
~2M SLoC