Is it possible to Crop and Composite at the same time?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
konstantin
Posts: 50
Joined: 2013-08-07T13:50:31-07:00
Authentication code: 6789

Is it possible to Crop and Composite at the same time?

Post by konstantin »

Hi!

I am trying to place a small logo on my image by compositing and at the same time, cropping the background image at the top.
My command:

Code: Select all

convert background.jpg logo.png -crop 1024x624+0+54 -gravity South-East -gamma 1.2 -sampling-factor 1x1 -composite result.jpg 
Unfortunately I always get this error message:

Code: Select all

convert: geometry does not contain image `logo.png' @ warning/transform.c/CropImage/666.
What can I do to achieve my goal?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Is it possible to Crop and Composite at the same time?

Post by snibgo »

I expect your command would crop both your input images. You probably want something like:

Code: Select all

convert ( background.jpg -crop 1024x624+0+54 +repage ) logo.png -gravity South-East -gamma 1.2 -sampling-factor 1x1 -composite result.jpg
snibgo's IM pages: im.snibgo.com
konstantin
Posts: 50
Joined: 2013-08-07T13:50:31-07:00
Authentication code: 6789

Re: Is it possible to Crop and Composite at the same time?

Post by konstantin »

Oh, I see, Thx you very much.
Post Reply