compare with "-lowlight-color transparent" shows up as black

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
guysoft
Posts: 12
Joined: 2014-08-25T03:34:17-07:00
Authentication code: 6789

compare with "-lowlight-color transparent" shows up as black

Post by guysoft »

Hey,
I had compare working fine, but after an upgrade to Ubuntu 17.04 it started showing "transparent" as black.

Here is a command example:

Code: Select all

compare  -highlight-color magenta -lowlight-color transparent a.png b.png  -compose src -colorspace sRGB diff.png
Image Magik version:

Code: Select all

compare --version
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
Attaching output.

For comparison, attaching the output also from a different machine

a.png:
Image
b.png:
Image

diff.png:
Image

diff on a different computer:
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: compare with "-lowlight-color transparent" shows up as black

Post by fmw42 »

I can confirm that this has changed somewhere between IM 6.9.4.0 and 6.9.5.8 Mac OSX Sierra. It does not show transparency for the current IM 6.9.9.23 or IM 7.0.7.11. Sorry I do not have current access to versions in-between those. Using Anthony's images from http://www.imagemagick.org/Usage/compare/, I get:

Input:
Image
Image


IM 6.9.4.0

Code: Select all

compare bag_frame1.gif bag_frame2.gif -compose src -highlight-color red -lowlight-color none diff6940.gif
Image


IM 6.9.5.8

Code: Select all

compare bag_frame1.gif bag_frame2.gif -compose src -highlight-color red -lowlight-color none diff6958.gif
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: compare with "-lowlight-color transparent" shows up as black

Post by fmw42 »

Lowlight now works properly to maintain the transparency in both IM 6.9.9.24 beta and IM 7.0.7.12 beta
guysoft
Posts: 12
Joined: 2014-08-25T03:34:17-07:00
Authentication code: 6789

Re: compare with "-lowlight-color transparent" shows up as black

Post by guysoft »

fmw42 wrote: 2017-11-15T19:28:17-07:00 Lowlight now works properly to maintain the transparency in both IM 6.9.9.24 beta and IM 7.0.7.12 beta
I tried with 6.9.9.23 and got an all black image - did you commit something to fix it?

I see commits 3a65092a0 ("Fix lowlight color bug", 2017-11-15) and c6641b299 ("Don't deactivate alpha channel", 2017-11-15). They might have been pushed after post.

compiling and will report
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: compare with "-lowlight-color transparent" shows up as black

Post by fmw42 »

Read the versions I posted. It is fixed in 6.9.9.24 not 6.9.9.23. The .24 version is a beta, so it has not been released as an official version. However, you can download and install the beta, if it is urgent. http://magick.imagemagick.org/download/beta/
guysoft
Posts: 12
Joined: 2014-08-25T03:34:17-07:00
Authentication code: 6789

Re: compare with "-lowlight-color transparent" shows up as black

Post by guysoft »

Ok, so it works from commit be27412d970c1455b99cf416fac22c589b8fcaea. Should I update the topic to [SOLVED] or something?

Also, I don't download, I compile here :)
Post Reply