combining 2 images NOK windows last version but OK linux

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
willemijns2
Posts: 15
Joined: 2018-10-02T05:10:24-07:00
Authentication code: 1152

combining 2 images NOK windows last version but OK linux

Post by willemijns2 »

Hello,

took any image like https://imagemagick.org/image/wizard.png

I created an empty page to combine images on it and i began by the first :

Result:
- (abnormal) B&W image in latest windows public build
- (good) colorized image on Ubuntu 18.04 LTS and former windows build i lost the version number.

it is due to a recent change on IM ? on LIBPNG ?

Linux bash & Windows batch follows :

Code: Select all

# imagemagick 6.9.7-4 Q16 x86_64 20170114 
rm emptypage.png
rm workswell.png
wget https://imagemagick.org/image/wizard.png
convert -size 2480x3508 xc:white emptypage.png
convert emptypage.png -strip wizard.png -geometry 150%%x150%%+100+100 -composite workswell.png
xdg-open workswell.png
read $r
read $r
read $r


del emptypage.png
del bad.png
..\ImageMagick-7.0.8-64-portable-Q16-x64\convert -size 2480x3508 xc:white emptypage.png
..\ImageMagick-7.0.8-64-portable-Q16-x64\magick convert emptypage.png -strip wizard.png -geometry 150%%x150%%+100+100 -composite bad.png
start bad.png
pause
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: combining 2 images NOK windows last version but OK linux

Post by fmw42 »

I am not sure I understand your question. Are you saying you get an error from

Code: Select all

convert -size 2480x3508 xc:white emptypage.png
What do you get from

Code: Select all

convert -version
What is your version of libpng?

You can see that from

Code: Select all

convert -list format
and look at the end of the line for PNG
willemijns2
Posts: 15
Joined: 2018-10-02T05:10:24-07:00
Authentication code: 1152

Re: combining 2 images NOK windows last version but OK linux

Post by willemijns2 »

Hello, to simplify: the whole script works with a former linux version but not with the latest windows build....

One hour ago, i found an old windows IM version on my harddisk, i tested with this version and now i can confirm that my script:
- works with 7.0.8-28 => image is colorized :-) (libpng 1.6.35)
- not works with 7.0.8-64 => image is B&W :-( (libpng 1.6.37)

Code: Select all

set num=28
set num=64
del emptypage.png
del bad.png
..\ImageMagick-7.0.8-%num%-portable-Q16-x64\convert -size 2480x3508 xc:white emptypage.png
..\ImageMagick-7.0.8-%num%-portable-Q16-x64\magick convert emptypage.png -strip wizard.png -geometry 150%%x150%%+100+100 -composite bad.png
start bad.png
pause
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: combining 2 images NOK windows last version but OK linux

Post by fmw42 »

Add -colorspace sRGB right after reading in emptypage.png in your second command. The white image is being treated as single channel grayscale, but should be 3 channel truecolor, since named colors even if black or white are supposed to be treated as color not grayscale. I confirm your issue on IM 7.0.8.64 Q16 Mac OSX and I think it is a bug. But lets get a reading from the IM developers.

This works for me as a workaround. But one should not have to add -colorspace sRGB, in my opinion for the reason above.

Code: Select all

magick -size 2480x3508 xc:white emptypage.png
magick emptypage.png -colorspace sRGB -strip wizard.png -geometry 150%x150%+100+100 -compose over -composite good.png
Also for IM 7, use magick, not magick convert. Magick replaces Convert.
willemijns2
Posts: 15
Joined: 2018-10-02T05:10:24-07:00
Authentication code: 1152

Re: combining 2 images NOK windows last version but OK linux

Post by willemijns2 »

the same :-(
willemijns2
Posts: 15
Joined: 2018-10-02T05:10:24-07:00
Authentication code: 1152

Re: combining 2 images NOK windows last version but OK linux

Post by willemijns2 »

you modified your message so i answer that your 2 suggestions does not works with latest build and works with the former 7-0-8-28 :-X
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: combining 2 images NOK windows last version but OK linux

Post by fmw42 »

Sorry, see my changed solution -- add -colorspace sRGB after reading emptypage.png
willemijns2
Posts: 15
Joined: 2018-10-02T05:10:24-07:00
Authentication code: 1152

Re: combining 2 images NOK windows last version but OK linux

Post by willemijns2 »

i saw a second modification of your reply, ok you confirm the bug... and your workaround of forcing sRGB works !

seems "-compose over" is not mandatory on my case ;)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: combining 2 images NOK windows last version but OK linux

Post by fmw42 »

-compose over is the default. But I always add it, especially when I have done other compose methods prior in the command line to reset it.
willemijns2
Posts: 15
Joined: 2018-10-02T05:10:24-07:00
Authentication code: 1152

Re: combining 2 images NOK windows last version but OK linux

Post by willemijns2 »

on a "dev way" it is a regression because it worked with 7-0-8-28 :)

BUT

- Creating a white or black empty page can be build with only 2 colors = grayscale
- Creating a yellow, brown or other blue empty page needs morethan 2 colors so no problem !

I understand it can be a dilemna for B&W :-X maybe IM devs or libpng devs changed their mind ???
Post Reply