I'm having trouble with my "ordering", and I could use a second pair of eyes to tell me what I'm doing wrong please....
What I want to do is overlay a text element as _pure white_, and have THAT overlay on top of a solid black rectangle at 50% opacity, and have THAT overlay on top of an image. As you can see from the below command-line code, I've got it almost working, but as you can see, it puts a blend of 50% on _everything_.
convert http://o.aolcdn.com/dims-shared/dims3/G ... 80_350.jpg \( -background black -alpha on -size 356x -fill white \ -font Helvetica label:"Craigslist Killer: How Many Victims?" \) \ -gravity south -compose blend -define compose:args=50 over -composite output.jpg
Can someone give me some pointers on doing 3 things to this?
1) Make the blend so that the black background is 50% opacity, but the white text is 100% opaque
2) Make it so that no matter how long the text string, the font-size will remain consistent.
3) Add a padding to the bottom of the text-area so that it has about 10 pixels underneath the text, (but the black-background at 50% is still pegged at the bottom - - - making the black background taller in other words)
Full opacity text on top of 50% opacity solid black
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Full opacity text on top of 50% opacity solid black
I am not sure what you mean by the text area having 10 pixels below? I have raised the text area by 10 pixels vertically.
But give this a try and then explain what you want different. This is on an older IM 6.8.0.5 and results may differ on other versions. What version of IM and platform?
Note if your pointsize is too large for the width of the image, it will be clipped at the ends.
But give this a try and then explain what you want different. This is on an older IM 6.8.0.5 and results may differ on other versions. What version of IM and platform?
Code: Select all
convert 6_980_350.jpg \
\( +clone -fill "rgba(0,0,0,0.5)" -colorize 100 \) \
-compose over -composite \
\( +clone -fill none -colorize 100 -fill white -gravity center \
-pointsize 20 -annotate +0-10 "Craigslist Killer: How Many Victims?" \) \
-compose over -composite result.jpg
Re: Full opacity text on top of 50% opacity solid black
Well, I wish I had better news, but that call just covered the whole image with a black background with white text:
convert http://o.aolcdn.com/dims-shared/dims3/G ... 80_350.jpg \ \( +clone -fill "rgba(0,0,0,0.
" -colorize 100 \) \ -compose over -composite \ \( +clone -fill none -colorize 100 -fill white -gravity center \ -pointsize 20 -annotate +0-10 "Iran Draws Red Line on Nuclear Deal" \) \ -compose over -composite output.jpg
I am running the IM that comes with Dreamhost.com (and for whatever reason, Dreamhost doesn't surface the version # in their control panel)
convert http://o.aolcdn.com/dims-shared/dims3/G ... 80_350.jpg \ \( +clone -fill "rgba(0,0,0,0.

I am running the IM that comes with Dreamhost.com (and for whatever reason, Dreamhost doesn't surface the version # in their control panel)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Full opacity text on top of 50% opacity solid black
Is this one line? \ at the end of a line must not have any characters or spaces after them and must continue on the next line.convert http://o.aolcdn.com/dims-shared/dims3/G ... 80_350.jpg \ \( +clone -fill "rgba(0,0,0,0." -colorize 100 \) \ -compose over -composite \ \( +clone -fill none -colorize 100 -fill white -gravity center \ -pointsize 20 -annotate +0-10 "Iran Draws Red Line on Nuclear Deal" \) \ -compose over -composite output.jpg
Try with a local image and see if that works. If not, then something is either limited by your 3rd party software or a very old version of IM. It works just fine for me on command line IM on Mac OSX with IM 6.8.0.5, which is not very current, even with your http: access image. Perhaps your 3rd party system cannot handle images over the web?
try putting
convert -version
into your system and see what it returns for the version.
Perhaps your 3rd party system does not allow multi-line commands. So take out all the end of line \ and make it one long command, such as
Code: Select all
convert http://o.aolcdn.com/dims-shared/dims3/GLOB/crop/+283/resize/410x179/format/jpg/http://at.on.aol.com/slots/-999/3_980_350.jpg \( +clone -fill "rgba(0,0,0,0.5)" -colorize 100 \) -compose over -composite \( +clone -fill none -colorize 100 -fill white -gravity center -pointsize 20 -annotate +0-10 "Craigslist Killer: How Many Victims?" \) -compose over -composite result.jpg