Merge result with background in one 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
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Merge result with background in one command

Post by agriz » 2015-10-26T08:27:38-07:00

Fred's script converted to php

Code: Select all

$kind="desat";
$edge=4;
$con=125;
$sat=100;	
$gray="yes";
$con1 = 100;
$con2 = $con-100;

Code: Select all

exec("convert original.jpg  ( -clone 0 $grayscaling ) ( -clone 1 -negate -blur 0x".$edge." ) ( -clone 1 -clone 2 $setcspace -compose color_dodge -composite -level ".$con2."x100% ) ( -clone 3 -alpha set -channel a -evaluate set ".$con1."% +channel ) ( -clone 3 -clone 4 $setcspace -compose multiply -composite ) -delete 0-4 $setcspace output.jpg");
original.jpg is converted to drawing effect successfully.

Now, How do i merge this converted effect to a background in the same command?
Can i convert more than one image to drawing effect
I am guessing i have to use background image, -gravity -composite for single image.
But i don't know how to use it.

Post Reply