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

Changing image background #815

Open
IlanCosman opened this issue Dec 23, 2020 · 10 comments
Open

Changing image background #815

IlanCosman opened this issue Dec 23, 2020 · 10 comments
Labels

Comments

@IlanCosman
Copy link

IlanCosman commented Dec 23, 2020

Hi, I recently attempted to use imgbot (as I have before) on my images for my project. Unfortunately, the background color of all images (but not gifs) was changed. It may be relevant that the original background color is purposefully the same as github's background in dark mode (as of Dec 22 2020). This allows it to blend in perfectly. Here are the images:

Original:

Imgbot:

I'm happy to provide any other information that would be useful.

@dlemstra
Copy link
Collaborator

Those images are identical?

@IlanCosman
Copy link
Author

I'm not sure what you're asking. The top image is what was fed into imgbot, and the bottom is what came out. They are visibly not identical.

@dlemstra
Copy link
Collaborator

They are identical. I am using ImageMagick to compare those images and those two images are the same.

@IlanCosman
Copy link
Author

Fascinating. Do they look identical to you? I've viewed them on multiple machines and they are clearly not the same color.

@IlanCosman
Copy link
Author

It can be very hard to see on GitHub, but just click on each of them to open them in new tabs, and then switch back and forth between them.

@rosslh
Copy link

rosslh commented Jan 18, 2021

I also see the color difference between those images in Firefox (84.0.2) and Chrome (87.0.4280.141). My system is Windows 10 Home 10.0.18363 Build 18363.

@IlanCosman
Copy link
Author

Any update on this? I'd love to get back to using imgbot 🙏What a fascinating bug 😂

@Yash-Singh1
Copy link

I think the background is different:

Lighter
Screenshot from 2021-09-29 12-12-59

Darker
Screenshot from 2021-09-29 12-13-03

@andersk
Copy link

andersk commented Oct 15, 2021

Although the pixels in these images have identical numerical values, imgbot has added a number of PNG chunks that change the colorimetric interpretation of those numerical values:

$ pngcheck -v a.png b.png
File: a.png (21413 bytes)
  chunk IHDR at offset 0x0000c, length 13
    1004 x 324 image, 32-bit RGB+alpha, non-interlaced
  chunk sBIT at offset 0x00025, length 4
    red = 8 = 0x08, green = 8 = 0x08, blue = 8 = 0x08, alpha = 8 = 0x08
  chunk IDAT at offset 0x00035, length 8192
    zlib: deflated, 32K window, default compression
  chunk IDAT at offset 0x02041, length 8192
  chunk IDAT at offset 0x0404d, length 4932
  chunk IEND at offset 0x0539d, length 0
No errors detected in a.png (6 chunks, 98.4% compression).

File: b.png (15715 bytes)
  chunk IHDR at offset 0x0000c, length 13
    1004 x 324 image, 24-bit RGB, non-interlaced
  chunk gAMA at offset 0x00025, length 4: 0.45455
  chunk cHRM at offset 0x00035, length 32
    White x = 0.3127 y = 0.329,  Red x = 0.64 y = 0.33
    Green x = 0.3 y = 0.6,  Blue x = 0.15 y = 0.06
  chunk bKGD at offset 0x00061, length 6
    red = 0x00ff, green = 0x00ff, blue = 0x00ff
  chunk IDAT at offset 0x00073, length 15482
    zlib: deflated, 32K window, maximum compression
  chunk tEXt at offset 0x03cf9, length 37, keyword: date:create
  chunk tEXt at offset 0x03d2a, length 37, keyword: date:modify
  chunk IEND at offset 0x03d5b, length 0
No errors detected in b.png (8 chunks, 98.4% compression).

No errors were detected in 2 of the 2 files tested.

Deleting either or both of the gAMA and cHRM chunks from the imgbot output restores the original appearance.

@Jaex
Copy link

Jaex commented Jan 9, 2022

We also have same problem, you can see example images in this pull request:

ShareX/sharex.github.io#43

Before (#2a2f38):

After (#252b35):

And I realized about this too late :(
So I must find all images modified by Imgbot past one year and revert them to originals.

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

No branches or pull requests

7 participants