Page 2 of 2

Re: Making sure image has at least given dimensions after resize

Posted: 2018-02-06T12:22:05-07:00
by fmw42
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?

Re: Making sure image has at least given dimensions after resize

Posted: 2018-02-06T13:16:09-07:00
by Mihamix
fmw42 wrote: 2018-02-06T12:22:05-07:00 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?
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.

Re: Making sure image has at least given dimensions after resize

Posted: 2018-02-06T14:11:03-07:00
by fmw42
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

Image

Image

Image

Image

Image

Re: Making sure image has at least given dimensions after resize

Posted: 2018-02-06T14:22:28-07:00
by Mihamix
fmw42 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

Image

Image

Image

Image

Image
Perfect, many thanks - I'll port it to Windows :)
I really do appreciate your help and your drive to find the exact solution!