Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 859 Bytes

flipping.md

File metadata and controls

33 lines (20 loc) · 859 Bytes

Flipping

To flip an image horizontally or vertically, we can use fliph and flipv.

fn main() {
    let img = image::open("my_image.jpg").unwrap();
    
    let img_fliph = img.fliph();
    img_fliph.save("fliph.jpg").unwrap();
    
    let img_flipv = img.flipv();
    img_flipv.save("flipv.jpg").unwrap();
}

Original image:

my_image

fliph.jpg:

fliph

flipv.jpg:

flipv

We can also use apply_orientation to achieve the same results.

➡️ Next: Rotating

📘 Back: Table of contents