51 releases

new 0.4.43 May 18, 2024
0.4.41 Mar 12, 2024
0.4.30 Dec 7, 2023
0.4.28 Nov 23, 2023

#228 in Images

Download history 184/week @ 2024-02-15 177/week @ 2024-02-22 22/week @ 2024-02-29 531/week @ 2024-03-07 185/week @ 2024-03-14 20/week @ 2024-03-21 117/week @ 2024-03-28 116/week @ 2024-04-04 12/week @ 2024-04-11 11/week @ 2024-04-18 13/week @ 2024-04-25 144/week @ 2024-05-02 27/week @ 2024-05-09 173/week @ 2024-05-16

359 downloads per month
Used in 4 crates

MIT license

195KB
4K SLoC

fimg

quick simple image operations

supported operations

  • overlay
  • rotation
  • flipping
  • image tiling
  • image scaling
  • triangle drawing
  • line drawing
  • box drawing
  • polygon drawing
  • circle drawing
  • text drawing
  • blur

lib.rs:

fimg

Provides fast image operations, such as rotation, flipping, and overlaying.

Organization

Image types:

  • Image: the main image type.
  • DynImage: This is the image type you use when, say, loading a png. You should immediately convert this into a
  • ImageCloner: This is... a Image, but about to be cloned. It just allows some simple out-of-place optimizations, that .clone().op() dont allow. (produce with Image::cloner)
  • uninit::Image: A uninitialized image. Used for performance optimization.

Operations

Affine:

Drawing:

Scaling: Image::scale

Misc image ops:

feature flags

  • scale: enables the scale module.
  • save: enables Image::save, via the png crate.
  • text: enables Image::text, via the fontdue crate.
  • blur: enables Image::blur, via the stackblur crate.
  • real-show: Image::show, if the save feature is enabled, will, by default, simply open the appropriate image viewing program. if, for some reason, this is inadequate/you dont have a good image viewer, enable the real-show feature to make Image::show open up a window of its own. without the real-show feature, Image::show will save itself to your temp directory, which you may not want.
  • term: term::print. this enables printing images directly to the terminal, if you don't want to open a window or something. supports {iterm2, kitty, sixel, fallback} graphics.
  • default: [save, scale].

Dependencies

~0.1–49MB
~771K SLoC