PS text with aqua effect no longer transparent?

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
joew
Posts: 42
Joined: 2012-08-23T01:19:56-07:00
Authentication code: 67789

PS text with aqua effect no longer transparent?

Post by joew »

Hello,

Based on http://www.imagemagick.org/Usage/advanced/#aqua_effects I have created a postscript text with aqua effect, that I used to overlay onto photographs. The command to generate the transparent aqua-text was this:

Code: Select all

convert \
    -channel RGBA \
    -density 600 \
    -gravity center \
    \( text.ps -trim +repage -channel RG -level 100% \) \
    -background none -fill yellow \
    -filter lanczos -resize 300%x300% \
    \( \
        +clone -bordercolor None -border 1x1 \
        -alpha Extract -blur 0x8  -shade 130x30 -alpha On \
        -background gray50 -alpha background -auto-level \
        -function polynomial 3.5,-5.05,2.05,0.3 \
        \( +clone -alpha extract  -blur 0x14 \) \
        -channel RGB -compose multiply -composite \
        +channel +compose -chop 1x1 \
    \) \
    -compose Hardlight -composite \
    poster-label.png
That used to work great on my old ubuntu box. But now I did a dist-upgrade, and the background of the final result is no longer transparent. This looks very ugly when attached onto a photo. The version of convert on the upgraded ubuntu is 6.6.0. Unfortunately, I don't know the old (working) version of convert.

I am not very familiar with IM. But I found by try+error that the transparency seems to get lost with the last 2 lines of the big enclosed sub-command:

Code: Select all

        -channel RGB -compose multiply -composite \
        +channel +compose -chop 1x1 \

Any ideas what the cause of the problem might be?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PS text with aqua effect no longer transparent?

Post by anthony »

joew wrote:I am not very familiar with IM. But I found by try+error that the transparency seems to get lost with the last 2 lines of the big enclosed sub-command:

Code: Select all

        -channel RGB -compose multiply -composite \
        +channel +compose -chop 1x1 \

Any ideas what the cause of the problem might be?
Hmmm a multiply composition normally makes opaque any pixel that isn't transparent in either input image. That is how SVG works. It is also a rather obnoxious (in my humble thinking) feature for mathematical compositions.
See Im Examples, Composition, Mathematical Composition and Alpha Blending
http://www.imagemagick.org/Usage/compose/#math_blending

However this setting channel RGB is supposed to
1/ Turn off the normal SVG transparency handling (remove IMv6 "sync" channel flag)
2/ Also tell IM not to modify the transparency channel of the destination (first image), period.

The result is that transparency of the destination (first) image is ment to be preserved.
In a quick test using the same examples as from the IM Examples, show that the destination image alpha
is being preserved in the latest version of IM.

what version of IM are you using?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
joew
Posts: 42
Joined: 2012-08-23T01:19:56-07:00
Authentication code: 67789

Re: PS text with aqua effect no longer transparent?

Post by joew »

anthony wrote: what version of IM are you using?

Code: Select all

jw@tm8371-u:~$ lsb_release -rci
Distributor ID: Ubuntu
Release:        11.10
Codename:       oneiric
jw@tm8371-u:~$ convert --version
Version: ImageMagick 6.6.0-4 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP 

jw@tm8371-u:~$
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PS text with aqua effect no longer transparent?

Post by anthony »

Note the text itself was never made transparent. But the input "text.ps" needed to be a colored shape as it is these colors that were shaded (made brighter and darker).

But it looks like some aspects has changed since the example was first created, as on my own version of IM 6.7.9-5 the colors are becoming negated.

I am sure there are many examples that will need to be looked at, which is one reason why the examples do show intermediate steps.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply