Skip to content

Images are inverted on the Y axis #987

@bahamas10

Description

@bahamas10

I've created a small example bit of code with:

use std::fs;
use macroquad::prelude::*;

fn main() {
    let bytes = fs::read("input.png").unwrap();
    let image = Image::from_file_with_format(&bytes, Some(ImageFormat::Png)).unwrap();
    image.export_png("output.png");
}

Running this will result in the output image being flipped vertically - this seems incorrect to me.


input.png

Image

output.png

Image

System info:

$ cargo --version
cargo 1.83.0 (5ffbef321 2024-10-29)
$ rustc --version
rustc 1.83.0 (90b35a623 2024-11-26)
$ uname
Darwin
$ cat Cargo.toml
[package]
name = "macroquad-flip-image"
version = "0.1.0"
edition = "2021"

[dependencies]
macroquad = "0.4.14"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions