Alex Schuster on  wrote...
| Sorry for the strange original subject, this was unintentionally :(
| 
| Anthony writes:
| 
| > Alex Schuster on  wrote...
| 
| > | I am generating PostScript output with convert, and I like them to
| > | have a title. I do this with -label. Is there a way to center the
| > | title, or to align to the right?
| > |
| > Yes  -gravity north  to center the title at the top of the image.
| 
| I just tried this, and got no output at all. And
| http://imagemagick.org/script/command-line-options.php#gravity sounds  
| like -gravity wouldnot work with -label.
| 
-label is a image attribribute and is only used as a type of 'comment'
string.  The only IM program to make real use of it is "montage", and
only of the label that appears underneath images!

You want to annotate some text, or overlay an image onto existing image.

| 
| This is what I am doing (in a bash script):
| 
| montage -tile "$tile" \
|         -pointsize $MultiPointSize \
|         -label $tileLabel \
|         -geometry "$oGeometry2" \
|         "[EMAIL PROTECTED]" PNG:- 2> /dev/null |
|         convert ${rotate:+-rotate $rotate} \
|                 -pointsize ${PointSize:-15} -font Arial \
|                 ${topLabel:+-label "$topLabel"} \
|                 -gravity North \
|                 ${oGeometry:+-page "$oGeometry"} \
|                 PNG:- PS2:"$printFile}"
| 
| That is, I montage all pageFiles together with an optional label  
| (usually unset) into PNG format, and convert this into PostScript,  
| zooming to a little less than A4 format, and giving a title  
| ($topLabel).
| 
Ok you create a 'montage' image.  Now do you want to add the label
on top of the image, or above the image?

Assuming the latter (like montage -title but with more control)

   montage ..... PNG:- | \
     convert PNG:- -gravity North -background white  -splice 0x18 \
             -pointsize 15 -font Arial -annotate 0 "$topLabel" \
             PS2:"$printFile"

Note that I read the image before you start processing it!!!!!

To put the label on the bottom use  -gravity South

This was pretty well taken directly from IM Example, Annotating Images
 http://www.cit.gu.edu.au/~anthony/graphics/imagick6/annotating/#label_under

| While I am at it: How can I align the whole result image to the right?  
| I thought that -gravity wohld also do this, but whenever I use it, I  
| get an emty image.
| My montage works fine with the right page geometry (581x790+50+20 with  
| 2x4 tiling), but with a different tiling I need another page geometry.  
| I must be making some stupid mistakes here.
| 
The trick is to try to avoid knowning just what size the image you are
processing is.  that way it does not need to do any external
calculations.

Almost all the IM examples try to work to that principle.

| But compared to the resolution of native PostScript text?
| Your example above does not look too good in PS, well, it's only 72  
| dpi I guess. I tried to increase the resolution (-density 300) and got  
| a small image of course. With higher size I got a good-looking font,  
| but the image was 10 MB huge, that's 10 times the size I usually have.  
| This would be a perfomance problem for the printer and for the server  
| (my script automatically fetches medical ultrasound images and prints  
| them).
| 
You never mentioned you were converting TO postscript.
You seemed to indicate you were going from.

IM is not designed for postscript generation,  why, because postscript
is a VECTOR image format.  IM generates raster images.

To get good resolution your image generation must be scaled to
postscript resolution (lots of pixels) with the right -density
setting so font pointsizes also scale properly.

See..
  Actual Font Size, Resolution and Pointsize
    http://www.cit.gu.edu.au/~anthony/graphics/imagick6/text/#pointsize

If outputing to a high dpi, set density right, and scale all pixel sizes
to match the output resolution.

And remember a raster image is very large compared to a vector image
See
  A word about Vector Image formats
    http://www.cit.gu.edu.au/~anthony/graphics/imagick6/formats/#vector

It may be IM is find for something in this, but I am certain you
really want to process your image using a vector image processor.


  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
   Symbolic Link(n) : ``A door closes quietly behind you, you are in a
          twisty maze of little passages, all different.''
 -----------------------------------------------------------------------------
     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