Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing a jpg image may result in wrong colors. #92017

Open
catpieyum opened this issue May 16, 2024 · 7 comments
Open

Importing a jpg image may result in wrong colors. #92017

catpieyum opened this issue May 16, 2024 · 7 comments

Comments

@catpieyum
Copy link

Tested versions

4.2.2.stable, 4.2.1.stable, 3.5.2.stable

System information

Windows 10, Windows 11

Issue description

When importing this jpg:
album
the colors get messed up in the preview/editor and at runtime.
image
This happens to any image in the zips downloaded from this site: https://www.enchor.us
The image can be found in the downloaded zip and is named album.jpg.

Steps to reproduce

  • Download provided image.
  • Import into editor.
  • Open image preview or drag into editor window.

Minimal reproduction project (MRP)

MRP.zip

@Calinou
Copy link
Member

Calinou commented May 16, 2024

@fire

This comment was marked as outdated.

@fire
Copy link
Member

fire commented May 16, 2024

  1. If I open the jpg macos preview
  2. Export the jpg into png
  3. It loads into godot engine correctly.

editor_screenshot_2024-05-16T101842

@catpieyum
Copy link
Author

When the .jpg image is imported into an image editor and exported as a .jpg again, it works correctly too. It's just that the issue shouldn't be happening in the first place.

@fire
Copy link
Member

fire commented May 16, 2024

I think that Godot Engine is probably mis-interpreting BGR/RGB for the color channels, but needs investigation why.

@Brezak
Copy link

Brezak commented May 16, 2024

Wouldn't switching the channels keep the white text white instead of tinting if pink?
Additionally this is how it looks when I swap the red and blue channels it looks like this
album

@fire
Copy link
Member

fire commented May 16, 2024

I don't think I should rush a pull request but a future task is to compare the results of https://github.com/richgel999/jpeg-compressor loading with https://github.com/libjpeg-turbo/libjpeg-turbo

Help welcome.

# Some differences on `exiftool album.jpg`.
Y Cb Cr Sub Sampling            : YCbCr4:4:4 (1 1)
# Compared to `exiftool 292a8bb83ccc4dda16234b1b9cb42f22.jpg` 
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants