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

WebP: Significant color distortion on "long" and lossy images #785

Open
rzam opened this issue Jul 8, 2023 · 2 comments
Open

WebP: Significant color distortion on "long" and lossy images #785

rzam opened this issue Jul 8, 2023 · 2 comments

Comments

@rzam
Copy link

rzam commented Jul 8, 2023

Describe the bug
I'm noticing a color distortion when reading "big" (≥ ~4k-5k pixels in width or height) and lossy (generated with cwebp -q 75) WEBP images and converting them to other formats.

The distortion seems to be very significant when reading "long" (~5k+ pixels in height) WEBPs and less noticeable when reading "wide" (~5k+ pixels in width) WEBPs; WEBPs generated with a higher quality setting (eg. cwebp -q 100) seem unaffected.

Version information
TwelveMonkeys version (Gradle):

implementation("com.twelvemonkeys.imageio:imageio-webp:3.9.4")

Java version:

openjdk version "17.0.6" 2023-01-17
OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10)
OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode, sharing)

OS:

OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22000 N/A Build 22000

cwebp version:

1.3.1
libsharpyuv: 0.2.1

Example code
All images in the screenshots below were read and written using the standard ImageIO methods, eg.:

BufferedImage image = ImageIO.read(new File("long.cwebp.q75.webp"));
ImageIO.write(image, "png", new File("long.imageio.q75.png"));

Sample file(s)
sources.zip

  • *.cwebp.* files were generated with cwebp
  • *.imageio.* were generated via the code above

Screenshots
Example using a "long" (500x5000) gradient:
example long

Example using a "wide" (5000x500) gradient:
example wide

@haraldk
Copy link
Owner

haraldk commented Jul 12, 2023

Hi,

Thanks for reporting! There seems to be some kind of error that is accumulated in the vertical dimension, but I will need to investigate...

Unfortunately, I don't have any time to look into this at the moment, but I will as soon as I find the time (August/September). If you can dig some more in the mean time, that would be very helpful! 😀

@haraldk haraldk changed the title Significant color distortion on "long" and lossy WEBP images WebP: Significant color distortion on "long" and lossy images Aug 22, 2023
@haraldk
Copy link
Owner

haraldk commented Nov 14, 2023

as soon as I find the time (August/September).

That didn't age too well... 😛

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

2 participants