I cannot access your posted image. If from dropbox, it needs to made sharable.
Pad which image? The watermark or the background? Do you need to adjust the background to have the same aspect as the watermark? Is that this issue?
Making sure image has at least given dimensions after resize
Re: Making sure image has at least given dimensions after resize
The image is sharable... Here is a different link.
The original image (which becomes the background if I'm correct) needs to be padded on the top and the bottom, to make it big enough for the watermark to fit.
ImageMagick 7.0.7 Q16 HDRI x64 DL on Win Srv 2008 R2
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Making sure image has at least given dimensions after resize
OK. Here is my code in unix syntax for the first image
Here are my results for each image
Code: Select all
magick \
\( /Users/fred/desktop/PZImages/WM_m.png \
-set option:dim "%[fx:(w>h)?650*w/h:650]x%[fx:(w>h)?650:650*h/w]" -resize "%[dim]" \) \
\( /Users/fred/desktop/PZImages/original/17201-33020@02.jpg -print "%f\n" \
-fuzz "10%" -trim +repage -rotate "90<" -resize "%[dim]" \
-background white -gravity center -extent "%[dim]" \) \
+swap -gravity center -compose over -composite \
/Users/fred/desktop/PZImages/fred_results2/17201-33020@02.jpg
Here are my results for each image
Re: Making sure image has at least given dimensions after resize
Perfect, many thanks - I'll port it to Windowsfmw42 wrote: ↑2018-02-06T14:11:03-07:00 OK. Here is my code in unix syntax for the first image
Code: Select all
magick \ \( /Users/fred/desktop/PZImages/WM_m.png \ -set option:dim "%[fx:(w>h)?650*w/h:650]x%[fx:(w>h)?650:650*h/w]" -resize "%[dim]" \) \ \( /Users/fred/desktop/PZImages/original/17201-33020@02.jpg -print "%f\n" \ -fuzz "10%" -trim +repage -rotate "90<" -resize "%[dim]" \ -background white -gravity center -extent "%[dim]" \) \ +swap -gravity center -compose over -composite \ /Users/fred/desktop/PZImages/fred_results2/17201-33020@02.jpg
Here are my results for each image
I really do appreciate your help and your drive to find the exact solution!
ImageMagick 7.0.7 Q16 HDRI x64 DL on Win Srv 2008 R2