Composite then crop and resize.

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
chaoscarnage
Posts: 93
Joined: 2012-12-31T15:56:29-07:00
Authentication code: 6789

Composite then crop and resize.

Post by chaoscarnage »

Code: Select all

convert /var/images/cf4d0728852f660282decdb97290e9a199.png -composite /var/images/b1691d10038f45282924804a22204.png -crop +repage -resize 48x48 /var/images/59913038d72f297dfef26c3207.png
What I am trying to do:
Take this image, add this image to it, then crop and resize.

What it does now:
Takes the original image and saves it to the specified location. Does not composite or crop or resize.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Composite then crop and resize.

Post by snibgo »

"-composite" needs two images before it.

"-crop" needs a geometry argument, eg 10x10+0+0.
snibgo's IM pages: im.snibgo.com
chaoscarnage
Posts: 93
Joined: 2012-12-31T15:56:29-07:00
Authentication code: 6789

Re: Composite then crop and resize.

Post by chaoscarnage »

snibgo wrote:"-composite" needs two images before it.

"-crop" needs a geometry argument, eg 10x10+0+0.
Thank you, I meant to use Trim in this case. That should fix one issue. I will test and get back to you in a few moments.
chaoscarnage
Posts: 93
Joined: 2012-12-31T15:56:29-07:00
Authentication code: 6789

Re: Composite then crop and resize.

Post by chaoscarnage »

Okay, new question. Say I want to do 250 of these in a batch. Is there anyway to send them off to a server to have it done?

I know about

Code: Select all

dev/null &
I was using that for a ton of images being compiled into one. However, I am unaware if there is a method for me to build the commands and build a bunch of images at once.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Composite then crop and resize.

Post by snibgo »

"Send them off to a server to have it done?" I would think the cost (time) of the comms would far exceed just doing the work.
chaoscarnage wrote:... to build the commands and build a bunch of images at once.
Sorry, I don't know what you mean. You can process in loops of course, but that isn't "at once".
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Composite then crop and resize.

Post by fmw42 »

You can use mogrify to do that on multiple images, if the overlay image is the same for all background images. See http://www.imagemagick.org/Usage/basics ... fy_compose. If not, then you would have to write script loop.
Post Reply