Hello,
i want to overlay images of any size with an overlay text like "Restricted". The width of the overlay text should match the width of the original image (and the height choosen automatically). I need to this with one call to convert. I was now experimenting some hours with this problem with no results. The problem is the "one call to convert". This is mandatory as conversion takes part of the EMC Documentum Media transformation server (which includes ImageMagick as plugin). Only the commandline to the convert call is configurable. I can´t do any piping or similar.
Greetings, Joerg
Overlaying image with text and aut. adj. text size
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Overlaying image with text and aut. adj. text size
try either
ww=`convert zelda3.jpg -format "%w" info:`
convert zelda3.png \( -background none -size ${ww}x -fill black \
-font Helvetica label:"restricted" \) \
-gravity north -compose over -composite zelda3_tmp.jpg
or
convert zelda3.png \( -background none -size $(convert zelda3.png -format "%w" info:)x -fill black \
-font Helvetica label:"restricted" \) \
-gravity north -compose over -composite zelda3_tmp2.jpg
This is unix. for windows see http://www.imagemagick.org/Usage/windows/
ww=`convert zelda3.jpg -format "%w" info:`
convert zelda3.png \( -background none -size ${ww}x -fill black \
-font Helvetica label:"restricted" \) \
-gravity north -compose over -composite zelda3_tmp.jpg
or
convert zelda3.png \( -background none -size $(convert zelda3.png -format "%w" info:)x -fill black \
-font Helvetica label:"restricted" \) \
-gravity north -compose over -composite zelda3_tmp2.jpg
This is unix. for windows see http://www.imagemagick.org/Usage/windows/
Re: Overlaying image with text and aut. adj. text size
This is the problem. I can´t break it into two commands or get the size of the original image by an inline convert call. On the MTS host you will not find any convert.exe or composite.exe. There´s only an IMW_ComServer.exe which is running always as a task. The concrete call to transform an image is done by some java server which generates a commandline and passes this commandline to the ComServer. I have to achieve the transformation with a plain call to convert.
I´v thought about drawing two lines (from NW to SE and SW TO NE) on the image (instead of the Restricted text). But from all the line drawing examples, it seems that the -draw command only nows about absolute coordinates.
Anyway what i need is some code to make the image unusuable for publication but people should still be able to recognize what´s represented on the picture.
I´v thought about drawing two lines (from NW to SE and SW TO NE) on the image (instead of the Restricted text). But from all the line drawing examples, it seems that the -draw command only nows about absolute coordinates.
Anyway what i need is some code to make the image unusuable for publication but people should still be able to recognize what´s represented on the picture.
Re: Overlaying image with text and aut. adj. text size
Here is an example you could possibly use based on a previous post in this forum:
You could have the copyright image on your server anyway and just use the composite part ?
Code: Select all
<?php
exec("convert -size 140x80 xc:none -fill grey -gravity NorthWest \
-draw \"text 10,10 'Copyright'\" -gravity SouthEast \
-draw \"text 5,15 'Copyright'\" miff:- | composite \
-tile - ../original_images/House.jpg tiled_text.jpg");
?>
Re: Overlaying image with text and aut. adj. text size
It´s still using a pipe so i can´t use it. Everything must be done within a single convert call.
Re: Overlaying image with text and aut. adj. text size
I think this would also fit my needs:
convert original_pic.tif -size 10000x10000 tile:rings.jpg -compose blend -set option:compose:args 20 -composite target_picture.tif
convert original_pic.tif -size 10000x10000 tile:rings.jpg -compose blend -set option:compose:args 20 -composite target_picture.tif