"leonidas" on  wrote...
| Hello together,
|
| i am working on an image processing automation tool for a printshop - having
| vast difficultes getting to a satisfying result with an IM -crop operation.
|
| I have researched for hours, but i just can not get it right. I guess the
| problem is on my side - i am pretty certain, most people can tell me the
| correct command right away.
|
| The goal is to resize and crop a given image to fit into a specific area on
| a template. If the resized image does not perfectly fit the target area, it
| must be cropped (in the vertical and horizontal center) so that it fits.
|
| I use those commands:
|
| convert files/afoch/UZ4V0121.jpg -resize 236x236 -crop 236x236+0+0
| files/afoch/UZ4V0121.jpg_resized.jpg
| composite -geometry +0+0 "files/afoch/UZ4V0121.jpg_resized.jpg"
| "files/afoch__processed/UZ4V0121.jpg" "files/afoch__processed/UZ4V0121.jpg"
|
| The result is always the same: the source image gets resized to fit either
| height or width of the area placed into. It does not get cropped. Therefore
| i always and up with my target image to contain the source image, but also
| thick white borders.
|
| I would appreciate any help on that matter!
|
| There is two more things i wondered about:
|
| 1.) The image quality of the result is not satisfying even though it never
| gets enlarged but rather shrinked and even though the source image is
| Hi-Resolution. I tried using -quality 100 -depth 8, but the result remains
| the same. Why?
|
See the forum where I believe that was answered.

| 2.) Is there a possibility to merge the two commands i use into one, so that
| imagemagick has not got to be launched twice - therefore saving time and
| cpu.
|
Yes...

   convert files/afoch/UZ4V0121.jpg \
           -resize 236x236 -crop 236x236+0+0 +repage \
           files/afoch__processed/UZ4V0121.jpg -geometry +0+0 \
           -composite   files/afoch__processed/UZ4V0121.jpg


  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
      It was dawn; the sun had not yet quite dared to show its round face,
    because darkness made it nervous.      - Piers Anthony "Man from Mundana"
 -----------------------------------------------------------------------------
     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