-background "black" option make image darker

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
rogercampos
Posts: 6
Joined: 2012-08-26T13:00:20-07:00
Authentication code: 67789

-background "black" option make image darker

Post by rogercampos »

Using the following comand with a jpg image without transparency makes the image look darker:

Code: Select all

convert cuca.png -background "black" out.png
However using "red" for instance does not make it look red. If I understant the background command correctly it should just add a background color to the image, visible if it's transparent or has pixels with low opacity (alpha channel). The image is however a jpeg with no transparency. I'll send you a private link to download the image I'm using.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: -background "black" option make image darker

Post by glennrp »

What happens if you use "-background white" instead? I suspect that
it will also be darker (i.e., the "-background" really has nothing to do
with what you are seeing). If you haven't tested with the latest version
of IM (currently 6.8.0-9), please do so, because there have been some
bugs recently fixed in the PNG codec having to do with sRGB versus RGB
colorspaces that may be the reason for what you are seeing.

If you've done all that and still see the problem, please send the
link to glennrp at imagemagick dot org.
rogercampos
Posts: 6
Joined: 2012-08-26T13:00:20-07:00
Authentication code: 67789

Re: -background "black" option make image darker

Post by rogercampos »

You're right, using -background 'white' the result is the same, a darker image. I was trying this with imagemagick version 6.8.0-7. I downloaded and installed now the latest version (6.8.0-9) and the result is now fine, so the bug may be fixed. Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: -background "black" option make image darker

Post by fmw42 »

I am puzzle. I thought that -background was a setting and thus should not make any changes to the image without some option such as -flatten.

Is this not the case?
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: -background "black" option make image darker

Post by glennrp »

fmw42 wrote:I am puzzle. I thought that -background was a setting and thus should not make any changes to the image without some option such as -flatten.

Is this not the case?
Correct. See my earlier response. The "-background" option did not actually have anything to do with the problem. Instead it was an error in the handling of sRGB versus RGB,
which I fixed in a recent version.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: -background "black" option make image darker

Post by fmw42 »

glennrp wrote:
fmw42 wrote:I am puzzle. I thought that -background was a setting and thus should not make any changes to the image without some option such as -flatten.

Is this not the case?
Correct. See my earlier response. The "-background" option did not actually have anything to do with the problem. Instead it was an error in the handling of sRGB versus RGB,
which I fixed in a recent version.

Glenn,

Thanks for the clarification.

Fred
Post Reply