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?".
I'm hitting a bit of a wall. I need to add a text watermark to images, however I don't know the size of these images so I end up with tet that isn't the appropriate size (tiny) on some images.
The command I use is:
convert 'in.tif'[0] -profile 'AdobeRGB1998.icc' -resize 6150400@\> -background white -flatten -gravity southeast -stroke '#000C' -strokewidth 2 -annotate 0 'this is a test' -stroke none -fill white -annotate 0 'this is a test' 'out.jpg'
Like I mentioned earlier, I need to find a way of resizing this watermark along with the image.
Thanks in advance for your help. I could probably resize the watermark using size $(convert etc...)x$(convert etc..) or something of the likes, but some images are really big and I would like to save computer ressources wherever possible
create an image of your text with transparent background by using label: to fit the image width. Then composite the text image over your background image.
But I am resizing the background image using an area size, so how do I know what size to give my label?
I'd also rather not make a label the size of the original file if I could help it as it would be a waste of ressources. Given the amount of conversions our server has to make this is important for us
resize your background, get its size and then create and overlay the text image via label:
Unfortunately, that means multiple commands.
Or pre-compute the size of the resized image first, then create the label to that size and overlay. You will either know the resize width and/or height or know what percent factor you use. So either way, you can compute the width and/or height of the resized image ahead of time.
Otherwise, do everything at the full image size, overlay the text image and then resize.
Is there any way I could pipe the resized image and get it's resized height/width on the fly? If not I guess I'll have to compute height/width, I was kind of using area size to avoid it but hey.
pommeverte wrote:Is there any way I could pipe the resized image and get it's resized height/width on the fly? If not I guess I'll have to compute height/width, I was kind of using area size to avoid it but hey.
I do not believe that is possible in IM 6. But later in IM 7 I think that will be more feasible.
Unless you are using -resize with @ for file size, you can easily pre-compute the resized image width and height