Images darkening after resize

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
paulhr

Images darkening after resize

Post by paulhr »

Hi, I've just started to use image magic for my photography forum. A user has noticed that when an image is uploaded to the galley and after imagemagick resizes the image, the image darkens.

I've searched the forum but have not been able to find an answer.

How can I prevent this from happening?

Thanks
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Images darkening after resize

Post by Bonzo »

I have not noticed that effect; what about adding -normalize or -contrast to your upload code ?

http://www.imagemagick.org/script/convert.php
paulhr

Re: Images darkening after resize

Post by paulhr »

Thanks for the reply bonzo. It seems to be a false alarm.

One of my users was comparing the uploaded image to the image being displayed in photoshop which added a custom color profile.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Images darkening after resize

Post by anthony »

There is also often a darkening effect associated with resizing images using gamma color correction.

The right thing to do in that situation is to remove the gamma, do the resize than re-add the gamma color correction. This is generally the case with all image processing problems, and which must be performed by the user as the gamma level is not always known.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
paulhr

Re: Images darkening after resize

Post by paulhr »

anthony wrote:There is also often a darkening effect associated with resizing images using gamma color correction.

The right thing to do in that situation is to remove the gamma, do the resize than re-add the gamma color correction. This is generally the case with all image processing problems, and which must be performed by the user as the gamma level is not always known.
Thanks for the additional information Anthony, it's really appreciated. I'm using imagemagick with photopost pro and will check this with the developers to get this implemented if they can so any code changes I make do not get overwritten with photopost version updates.

I'll have a quick look at their code first to see what they are doing.

Thanks again.
Post Reply