Scott Bicknell on  wrote...
| On Wednesday, October 18, 2006 12:07 pm, Hugemann wrote:
| 
| > Hi,
| >
| > I'm brand new on this list (but not quite so new to
| > ImageMagick).
| >
| > I would like to watermark a bulk of images with a logo placed
| > at their right bottom. I have this logo as a vector graphic.
| >
| > The problem is that the JPEGs I want to watermark are of
| > various size, thus I would like to scale my vector graphic
| > according to the height of the target image, scaling it for
| > instance to 20% of the target image's height.
| >
| > Any ideas how this could be done?
| >
| > I don't need to do it with a single command, I could possibly
| > use a batch language. (Preferably VBS as I am working on a
| > Windows machine.)
| 
| Assuming you are using the command-line ImageMagick utilities 
| with whatever scripting language you want, you would first need 
| to know the size of the target image, and probably what side of 
| the image is longest, the height or the width. Capture the 
| output of the identify command in a variable.
| 
| height = `identify -format '%h' target.jpg`
| width  = `identify -format '%w' target.jpg`
| 
| Then use whichever is greater (or smaller, depending on which 
| side you want to use) to scale the coresponding side of your 
| watermark image.
| 
With the latest Im you can even have it do some mathematics for you...

  size = `convert target.jpg -format '%[fx: w*0.2 ]x%[fx: h*0.2]' info:`

  convert watermark.png -resize $size  target.jpg  +swap \
          ...do watermarking...

Remember -resize defines a box into which the image is resized to
completely fit into.

As for the watermarking itself see  IM Examples
Watermarking with Images
  http://www.cit.gu.edu.au/~anthony/graphics/imagick6/annotating/#wmark_image

  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
   Captain Janeway: Can we go to warp?
   Paris:   Sure, but with inertial dampeners offline, 
                we'd all be stains on the back wall!     -- StarTrek Voyger
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to