Unsharpmask sometimes brightens the image? #6881
Replies: 3 comments 3 replies
-
Doing the unsharp after Have you checked that the command line shows the same problem as your Magick++ program? Some IM operations check whether the image is encoded as sRGB and, if it isn't, converts it to sRGB. I don't know if that is affecting you. If it is, then try changing ...
... to ...
This tells IM that the colorspace is sRGB, so the resize and unsharp won't change the colorspace. If that doesn't fix the problem, please post a sample input image. The actual image file, not a screenshot. |
Beta Was this translation helpful? Give feedback.
-
I suggest that you put a +write tmpX.png after each step and find out where the brightening occurs in your command |
Beta Was this translation helpful? Give feedback.
-
With IM v7.1.1-20 on Windows 11, I can't reproduce the problem. With this command:
... the outputs If I remove the |
Beta Was this translation helpful? Give feedback.
-
ImageMagick version
7.0.8-Q16
Operating system, version and so on
Windows 10 Enterprise, ver. 19045
Description
I am having an issue with the ImageMagick's unsharpmask for some of my users. For most of them the image looks fine, but there is that one guy who gets a brighter image (repro 100%). After generating debug images after each step/command I do with imageMagick, I determined it was during unsharpmask step that the issue appeared.
I first suspected the image was not in a linear colorspace when executing the unsharpmask (which it was not), but after fixing that, it is still brighter than it should be (thought it did help a little).
I also had some feedback that a similar issue can appear randomly with a very low frequency for any user, but that could be an unrelated bug with the same visual effect.
It is difficult not to suspect a different setup that user could have, but wouldn't that affect more than just the unsharpmask? To get to the input images shown in this post, there is a successful colorFuzz, Trim, Extent, resize and then the unsharpmask. Only that last step causes the issue. I am using Magick++ but the corresponding command line would be:
As seen above, the unsharpmask parameter I also use in Magick++ are: radius(0), sigma(1), amount(1), threshold(0.05).
The debug image are also generated by Magick++, after the initial copy, I convert it to png and annotate the gamma.
Here you can see after the resize and before the unsharpmask (2 above pistols) with RGB on the left and sRGB on the right. Then, the two on the bottoms are after the unsharpmask, again RGB on the left and sRGB on the right:
Finally, here is the same command's output I get on all the other users, or what I expect:
Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions