transparency not working
transparency not working
composite -gravity Center -dissolve 20% overlay.png background.jpg output.jpg
This command works fine in 6.9.6, and produces a non-transparent overlay in 6.9.8.
This command works fine in 6.9.6, and produces a non-transparent overlay in 6.9.8.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: transparency not working
What is your exact version and platform. IM is at 6.9.8.6 currently. It would help if you posted your two images to some free hosting service and put the URLs here so we can test with your exact IM version and images.
Re: transparency not working
The OS is FreeBSD 10.3
Working: ImageMagick-nox11-6.9.6.4_2,1 Image processing tools (legacy version)
Not working: ImageMagick-nox11-6.9.8.6,1 Image processing tools (legacy version)
Just about any kind of real-world photograph can be used as background, and "a text string" as a watermark in overlay.png, in which the white text is drawn on a transparent background, non-technically speaking It's neither black nor white, it's nothing. So the problem is - the white letters aren't dissolved (made sem-transparent) in the newer version, but are left as they were. I'll try to make up an example later.
Working: ImageMagick-nox11-6.9.6.4_2,1 Image processing tools (legacy version)
Not working: ImageMagick-nox11-6.9.8.6,1 Image processing tools (legacy version)
Just about any kind of real-world photograph can be used as background, and "a text string" as a watermark in overlay.png, in which the white text is drawn on a transparent background, non-technically speaking It's neither black nor white, it's nothing. So the problem is - the white letters aren't dissolved (made sem-transparent) in the newer version, but are left as they were. I'll try to make up an example later.
Re: transparency not working
Ok, here's what I've come up with.
First, I made a screenshot of this browser window and saved it as background.jpg.
Then I used a free online tool to create a text string with a transparent background (http://www.picturetopeople.org/text_gen ... rator.html)
Now for the good part. The barely visible overlaid text using the command in the first post & IM 6.9.6.
And the failing IM 6.9.8:
First, I made a screenshot of this browser window and saved it as background.jpg.
Then I used a free online tool to create a text string with a transparent background (http://www.picturetopeople.org/text_gen ... rator.html)
Now for the good part. The barely visible overlaid text using the command in the first post & IM 6.9.6.
And the failing IM 6.9.8:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: transparency not working
Try using the more current IM 6 convert. It is more flexible than composite. This seems to work fine for me on IM 6.9.8.6 Q16 Mac OS X.
or
See
http://www.imagemagick.org/Usage/compose/
http://www.imagemagick.org/script/compose.php
Code: Select all
convert background.jpg transparent_text_effect.png -gravity Center -set option:compose:args 100,20 -compose dissolve -composite tmp.png
Code: Select all
convert background.jpg transparent_text_effect.png -gravity Center -define compose:args=100,20 -compose dissolve -composite tmp.png
http://www.imagemagick.org/Usage/compose/
http://www.imagemagick.org/script/compose.php
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: transparency not working
Note that values used in composite are typically reversed when used in convert.
Perhaps you really want 20,100. So if I have the results backwards, then use 20,100 in place of 100,20 (or perhaps you want 20,80).
Perhaps you really want 20,100. So if I have the results backwards, then use 20,100 in place of 100,20 (or perhaps you want 20,80).
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: transparency not working
If you still find that results from 6.9.8.6 and 6.9.6.4 have swapped values, then let me know and I will download a version of 6.9.6.4 tomorrow and check it out. Perhaps that version had a transient bug?
Re: transparency not working
Thank you, sir! This now works as expected in both versions.
convert bg.jpg overlay.png -gravity Center -define compose:args=20,100 -compose dissolve -composite out.jpg
Re: transparency not working
FYI, the composite command in my original post produces the desired result in ImageMagick7-nox11-7.0.5.7
It looks like there's a bug in IM 6.9.8
It looks like there's a bug in IM 6.9.8
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: transparency not working
I get exactly the same results using 6.9.8-7 and 7.0.5-8
Code: Select all
convert bg.jpg overlay.png -gravity Center -define compose:args=20,100 -compose dissolve -composite out6.jpg
Code: Select all
magick bg.jpg overlay.png -gravity Center -define compose:args=20,100 -compose dissolve -composite out7.jpg
Re: transparency not working
I was talking about the "composite" binary itself.
Works in 6.9.6.4 and 7.0.5.7
Fails in 6.9.8.6
Works in 6.9.6.4 and 7.0.5.7
Fails in 6.9.8.6
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: transparency not working
composite is an older syntax. You should always use the convert syntax these days since it is more flexible.