Page 1 of 1

Convert and resize together

Posted: 2019-03-03T09:20:15-07:00
by indusam
Hello everyone!
I need to put one image (overlay 2748x820 px) on another (background 1000x1000 px). During this operation I want to change overlay size intentionally and preserve background's size change
So I try to use such line (Win 8.1, x64, command line):

magick convert background.jpg \( overlay.png -gravity center -resize 200 \) -composite result.jpg

but it changes both the size of overlay and backround images so that result image is 200x200 px while I want have result image 1000x1000 px (like background) and overlay image 200x60 px in the center of it.

is it possible? thanks for your help in advance

Re: Convert and resize together

Posted: 2019-03-03T09:57:02-07:00
by snibgo
You have \( \and \). Those escapes are needed for bash. They are not correct for Windows. Use just ( and ) .

Re: Convert and resize together

Posted: 2019-03-03T12:11:05-07:00
by fmw42
Also for ImageMagick 7, use just magick and not magick convert. Other tools such as identify, mogrify, etc do need to be prefaced by magick, but not convert. When removing the \s, be sure to keep the space on each side of each parenthesis.

Re: Convert and resize together

Posted: 2019-03-03T12:46:14-07:00
by indusam
snibgo wrote: 2019-03-03T09:57:02-07:00 You have \( \and \). Those escapes are needed for bash. They are not correct for Windows. Use just ( and ) .
you are absolutelly right! in this way it works properly! thank you! :D

Re: Convert and resize together

Posted: 2019-03-03T12:47:55-07:00
by indusam
fmw42 wrote: 2019-03-03T12:11:05-07:00 Also for ImageMagick 7, use just magick and not magick convert. Other tools such as identify, mogrify, etc do need to be prefaced by magick, but not convert. When removing the \s, be sure to keep the space on each side of each parenthesis.
on my PC it do nothing without 'magick'

Re: Convert and resize together

Posted: 2019-03-03T15:00:08-07:00
by fmw42
You need magick, but not convert

Code: Select all

magick background.jpg ( overlay.png -gravity center -resize 200 ) -composite result.jpg