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

boundary values of -gamma in ImageMagick 7 #1151

Closed
pgajdos opened this issue May 29, 2018 · 2 comments
Closed

boundary values of -gamma in ImageMagick 7 #1151

pgajdos opened this issue May 29, 2018 · 2 comments

Comments

@pgajdos
Copy link

pgajdos commented May 29, 2018

Hello,

I have question about behavioral change between ImageMagick 6 and ImageMagick 7. I have tested with 6.9.9-46 and 7.0.7-34. The test is based on example page.

To be clear, I do not intend to create one color images that way; I consider this just as a testcase that could exhibit a bug potentially.

1. creating black image with -gamma 0

(A) convert  test.png  -gamma 0  -alpha off  black_gamma.png
(B) convert  test.png  \
           -channel red -gamma 0 \
           -channel green -gamma 0 \
           -channel blue -gamma 0 \
           -alpha off black_gamma.png
  • both (A) and (B) works as described in the example page for 6.9.9-46 and both produce:
    black_gamma
  • both (A) and (B) both produce 7.0.7-34:
    black_gamma

I have tried few triplets of -gamma: (1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (2.0, 2.0, 1.0), (3.0, 3.0, 3.0), (0.5, 0.5, 0.5), (0.1, 0.1, 0.1) and of course (0, 0, 0). Results seem to my human eye to be equal for IM6 and IM7, except just (0, 0, 0). Unfortunately I am far from being image processing expert and I do not see the reasoning behind the results.

2. creating yellow image with -gamma -1, -1, 0

This is perhaps related to previous problem. Consider following command:

(A) convert  test.png  -gamma -1,-1,0  -alpha off  yellow_gamma.png
(B) convert  test.png  \
          -channel red -gamma -1 \
          -channel green -gamma -1 \
          -channel blue -gamma 0  \
          -alpha off \
          yellow_gamma.png
  • Command (A) will not work with ImageMagick 7 anymore, see this topic for details.
  • Both (A) and (B) commands produce pure yellow image for 6.9.9-46.
    yellow_gamma
  • (B) produces almost pure yellow image in ImageMagick 7, except the area with
    pixels with fraction of blue in it.
    yellow_gamma

Again, if you consider this as not a bug, fine with me, we will adjust our test cases according to new results and/or Anthony's proposals sent privately.

Thank you!

@urban-warrior
Copy link
Member

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

@pgajdos
Copy link
Author

pgajdos commented Jun 1, 2018

This proves to be fixed for me, thanks a lot!

@pgajdos pgajdos closed this as completed Jun 1, 2018
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jun 3, 2018
2018-06-02 7.0.7-38 Cristy <quetzlzacatenango@image...>
Release ImageMagick version 7.0.7-38, GIT revision 14409:01e395a73:20180602.

2018-05-30 7.0.7-38 <quetzlzacatenango@image...>
Heap buffer overflow fix (reference ImageMagick/ImageMagick#1156).
Boundary issues with -gamma option when HDRI is enabled (reference ImageMagick/ImageMagick#1151).
Fixed numerous use of uninitialized values, integer overflow, memory exceeded, and timeouts (credit to OSS Fuzz).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants