Discussion:
[GM-help] Transparency not saved on OSX
Anubhaw Arya
2017-05-11 18:22:31 UTC
Permalink
Hello all,

I’m trying to create a transparent gradient image as I would in ImageMagick in GraphicsMagick. The following command works for me in IM:
convert -size 1280x720 -define gradient:direction=SouthWest gradient:'rgba(0,255,0,0.0)'-'rgba(0,255,0,1.0)' im.png
and generates the attached output.

However, if I run the same command in GM:
gm convert -size 1280x720 -define gradient:direction=SouthWest gradient:'rgba(0,255,0,0.0)'-'rgba(0,255,0,1.0)' gm.png
I get the attached output. As you can see, it is a solid color.

I have GraphicsMagick installed at a quantum depth of 16 and have tried with 32:
➜ ~ /usr/local/bin/gm version
GraphicsMagick 1.3.25 2016-09-05 Q16 http://www.GraphicsMagick.org/
Copyright (C) 2002-2016 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.

Feature Support:
Native Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) yes
BZIP yes
DPS no
FlashPix no
FreeType yes
Ghostscript (Library) no
JBIG no
JPEG-2000 no
JPEG yes
Little CMS no
Loadable Modules yes
OpenMP no
PNG yes
TIFF yes
TRIO no
UMEM no
WebP no
WMF no
X11 no
XML yes
ZLIB yes

Host type: x86_64-apple-darwin15.6.0

Configured using the command:
./configure '--prefix=/usr/local/Cellar/graphicsmagick/1.3.25' '--disable-dependency-tracking' '--enable-shared' '--disable-static' '--with-modules' '--without-lzma' '--disable-openmp' '--with-quantum-depth=16' '--without-gslib' '--with-gs-font-dir=/usr/local/share/ghostscript/fonts' '--without-x' '--without-lcms2' 'CC=clang' 'CXX=clang++'

Final Build Parameters:
CC = clang
CFLAGS = -g -O2 -Wall -D_THREAD_SAFE
CPPFLAGS = -I/usr/local/Cellar/freetype/2.6.5/include/freetype2 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2
CXX = clang++
CXXFLAGS = -D_THREAD_SAFE
LDFLAGS = -L/usr/local/Cellar/freetype/2.6.5/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib
LIBS = -lfreetype -lbz2 -lz -lltdl -lm –lpthread

Doing an identify on the 2 PNGs tells me that im.png is “true color with transparency” and gm.png is just “true color”. Any idea what could be going wrong here?
Thanks,
Anubhaw Arya
Bob Friesenhahn
2017-05-19 13:24:03 UTC
Permalink
Post by Anubhaw Arya
Hello all,
convert -size 1280x720 -define gradient:direction=SouthWest gradient:'rgba(0,255,0,0.0)'-'rgba(0,255,0,1.0)' im.png
and generates the attached output.
gm convert -size 1280x720 -define gradient:direction=SouthWest gradient:'rgba(0,255,0,0.0)'-'rgba(0,255,0,1.0)' gm.png
I get the attached output. As you can see, it is a solid color.
It is not correct to use current ImageMagick options/commands with
GraphicsMagick without verification since the programs have diverged
over the past 15 years.

The "gradient:direction" is not supported (as far as I am aware)

It seems that the remaining problem must be with enabling the 'matte'
flag based on the color specification, and possibly with producing the
gradient in the opacity channel. This would be a GraphicsMagick bug.

It would be good to create a formal bug report for this so that it is
not forgotten.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Loading...