How to create an image and blend it in the same command?

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
zettez
Posts: 2
Joined: 2013-03-05T05:46:50-07:00
Authentication code: 6789

How to create an image and blend it in the same command?

Post by zettez »

Greetings.

I want to create an image with another image as overlay but with transparency and blend like in photoshops multiply feature. I have read http://www.imagemagick.org/pipermail/ma ... 22606.html which states you may pipe the request or use composite in convert. I however cannot get it to work.

My two commands I use:

[*]convert shirt.png -fill green +opaque green colored_shirt.png
[*]composite -blend 80 shirt.png colored_shirt.png fixed_shirt.png

Is it possible to get the result fixed_shirt.png in one command? Do you suggest another approach? It would be nice if I could skip to create colored_shirt.png.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to create an image and blend it in the same command?

Post by fmw42 »

use the convert version of -compose blend and parenthesis processing.

see
http://www.imagemagick.org/Usage/compose/#blend
http://www.imagemagick.org/Usage/basics/#parenthesis

something like

convert shirt.png \( -clone 0 -fill green +opaque green \) -define compose:args=80 -compose blend fixed_shirt.png

I believe this is 20% shirt and 80% processed shirt, but it may be the other way around.

If on Windows, leave off the two \ escapes
zettez
Posts: 2
Joined: 2013-03-05T05:46:50-07:00
Authentication code: 6789

Re: How to create an image and blend it in the same command?

Post by zettez »

Thank you, I had totally missed the parenthesis.
Post Reply