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? 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. Thank you very much! Ps.: Here you can find visual examples of what i wish to acquire: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=11750&p=38064 _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
