I have to provide a windows batch script to handle the autocropping, resizing, potentially rotating and finally applying watermark image on of 5000+ images.
The problem is that the watermark logo is sometimes bigger than the autcropped & resized image, resulting in hideously cropped watermarked images. This is primarily if the item on the image is elongated and aligned with the X or the Y axis.
Is there any way I can - after the autocrop and resize - enforce a certain size (or ratio) (and fill the background with white)?
My command is:
Code: Select all
mogrify -print "%f\n" -trim -fuzz "10%" -background "white" -resize 650x650 -rotate "90<" -gravity "center" -draw "image src-over 0,0 0,0 'Watermarks\wm.png'" -path "TestTmp\bn\m" "Source\Original\*.jpg"
Many thanks in advance
My ImageMagick version is below, running on Windows Server 2008R2:
Code: Select all
Version: ImageMagick 7.0.7-21 Q16 x64 2018-01-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib jng jp2 jpeg lcms lqr open
exr pangocairo png ps raw rsvg tiff webp xml zlib