Image Magick is a software suite to create, edit, and compose bitmap images. Mathematical Compose Methods.

The following commands are the two direct image 'composite' methods available in ImageMagick.

composite {overlay} {background} [{mask}] [-compose {method}] {result}
convert {background} {overlay} [{mask}] [-compose {method}] -composite {result}

Information commands

Bash code:

convert -list compose

PHP code:

<?
$data = exec("/usr/bin/convert -list compose");
echo $data;
?>

Create a yellow triangle

Bash code:

convert -size 100x100 xc:none -fill yellow -stroke black /
-draw "path 'M 10,10 L 90,10 L 10,90 Z' " yellow_triangle.png

PHP code:

<?
passthru("/usr/bin/convert -size 100x100 xc:none -fill yellow -stroke black ".
" -draw \"path 'M 10,10 L 90,10 L 10,90 Z' \" yellow_triangle.png");
?>
Image Magick: yellow triangle

Create a blue triangle

Bash code:

convert -size 100x100 xc:none -fill blue -stroke black /
-draw "path 'M 0,0 L 100,0 L 100,100 Z' " blue_triangle.png

PHP code:

<?
passthru("/usr/bin/convert -size 100x100 xc:none -fill blue -stroke black ".
" -draw \"path 'M 0,0 L 100,0 L 100,100 Z' \" blue_triangle.png");
?>
Image Magick: blue triangle

Create a blue-yellow gradient

Bash code:

convert -size 100x100 gradient:blue-yellow gradient_blue_yellow.png

PHP code:

<?
passthru("/usr/bin/convert -size 100x100 gradient:blue-yellow gradient_blue_yellow.png");
?>
Image Magick: Blue-Yellow Gradient

Create a lime-red gradient

Bash code:

convert -size 100x100 gradient:lime-red -rotate 90 gradient_lime_red.png

PHP code:

<?
passthru("/usr/bin/convert -size 100x100 gradient:lime-red -rotate 90 gradient_lime_red.png");
?>
Image Magick: Lime-Red Gradient

Create a lighting effect

Bash code:

convert -size 100x100 xc: -fill gray50 -colorize 100% -raise 4 -normalize -blur 0x4 lighting_effect.png

PHP code:

<?
passthru("/usr/bin/convert -size 100x100 xc: -fill gray50 -colorize 100% -raise 4 -normalize -blur 0x4 lighting_effect.png");
?>
Image Magick: lighting effect

Compose Method: Atop

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Atop -composite compose_Atop.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Atop -composite compose_gradient_Atop.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Atop -composite compose_Atop.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Atop -composite compose_gradient_Atop.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Atop
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Atop

Compose Method: Blend

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Blend -composite compose_Blend.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Blend -composite compose_gradient_Blend.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Blend -composite compose_Blend.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Blend -composite compose_gradient_Blend.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Blend
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Blend

Compose Method: Blur

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Blur -composite compose_Blur.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Blur -composite compose_gradient_Blur.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Blur -composite compose_Blur.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Blur -composite compose_gradient_Blur.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Blur
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Blur

Compose Method: Bumpmap

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Bumpmap -composite compose_Bumpmap.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Bumpmap -composite compose_gradient_Bumpmap.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Bumpmap -composite compose_Bumpmap.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Bumpmap -composite compose_gradient_Bumpmap.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Bumpmap
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Bumpmap

Compose Method: ChangeMask

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose ChangeMask -composite compose_ChangeMask.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose ChangeMask -composite compose_gradient_ChangeMask.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose ChangeMask -composite compose_ChangeMask.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose ChangeMask -composite compose_gradient_ChangeMask.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose ChangeMask
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient ChangeMask

Compose Method: Clear

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Clear -composite compose_Clear.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Clear -composite compose_gradient_Clear.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Clear -composite compose_Clear.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Clear -composite compose_gradient_Clear.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Clear
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Clear

Compose Method: ColorBurn

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose ColorBurn -composite compose_ColorBurn.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose ColorBurn -composite compose_gradient_ColorBurn.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose ColorBurn -composite compose_ColorBurn.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose ColorBurn -composite compose_gradient_ColorBurn.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose ColorBurn
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient ColorBurn

Compose Method: ColorDodge

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose ColorDodge -composite compose_ColorDodge.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose ColorDodge -composite compose_gradient_ColorDodge.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose ColorDodge -composite compose_ColorDodge.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose ColorDodge -composite compose_gradient_ColorDodge.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose ColorDodge
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient ColorDodge

Compose Method: Colorize

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Colorize -composite compose_Colorize.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Colorize -composite compose_gradient_Colorize.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Colorize -composite compose_Colorize.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Colorize -composite compose_gradient_Colorize.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Colorize
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Colorize

Compose Method: CopyBlack

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose CopyBlack -composite compose_CopyBlack.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose CopyBlack -composite compose_gradient_CopyBlack.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose CopyBlack -composite compose_CopyBlack.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose CopyBlack -composite compose_gradient_CopyBlack.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose CopyBlack
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient CopyBlack

Compose Method: CopyBlue

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose CopyBlue -composite compose_CopyBlue.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose CopyBlue -composite compose_gradient_CopyBlue.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose CopyBlue -composite compose_CopyBlue.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose CopyBlue -composite compose_gradient_CopyBlue.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose CopyBlue
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient CopyBlue

Compose Method: CopyCyan

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose CopyCyan -composite compose_CopyCyan.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose CopyCyan -composite compose_gradient_CopyCyan.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose CopyCyan -composite compose_CopyCyan.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose CopyCyan -composite compose_gradient_CopyCyan.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose CopyCyan
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient CopyCyan

Compose Method: CopyGreen

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose CopyGreen -composite compose_CopyGreen.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose CopyGreen -composite compose_gradient_CopyGreen.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose CopyGreen -composite compose_CopyGreen.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose CopyGreen -composite compose_gradient_CopyGreen.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose CopyGreen
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient CopyGreen

Compose Method: Copy

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Copy -composite compose_Copy.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Copy -composite compose_gradient_Copy.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Copy -composite compose_Copy.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Copy -composite compose_gradient_Copy.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Copy
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Copy

Compose Method: CopyMagenta

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose CopyMagenta -composite compose_CopyMagenta.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose CopyMagenta -composite compose_gradient_CopyMagenta.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose CopyMagenta -composite compose_CopyMagenta.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose CopyMagenta -composite compose_gradient_CopyMagenta.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose CopyMagenta
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient CopyMagenta

Compose Method: CopyOpacity

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose CopyOpacity -composite compose_CopyOpacity.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose CopyOpacity -composite compose_gradient_CopyOpacity.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose CopyOpacity -composite compose_CopyOpacity.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose CopyOpacity -composite compose_gradient_CopyOpacity.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose CopyOpacity
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient CopyOpacity

Compose Method: CopyRed

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose CopyRed -composite compose_CopyRed.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose CopyRed -composite compose_gradient_CopyRed.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose CopyRed -composite compose_CopyRed.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose CopyRed -composite compose_gradient_CopyRed.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose CopyRed
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient CopyRed

Compose Method: CopyYellow

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose CopyYellow -composite compose_CopyYellow.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose CopyYellow -composite compose_gradient_CopyYellow.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose CopyYellow -composite compose_CopyYellow.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose CopyYellow -composite compose_gradient_CopyYellow.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose CopyYellow
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient CopyYellow

Compose Method: Darken

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Darken -composite compose_Darken.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Darken -composite compose_gradient_Darken.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Darken -composite compose_Darken.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Darken -composite compose_gradient_Darken.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Darken
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Darken

Compose Method: DarkenIntensity

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose DarkenIntensity -composite compose_DarkenIntensity.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose DarkenIntensity -composite compose_gradient_DarkenIntensity.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose DarkenIntensity -composite compose_DarkenIntensity.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose DarkenIntensity -composite compose_gradient_DarkenIntensity.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose DarkenIntensity
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient DarkenIntensity

Compose Method: DivideDst

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose DivideDst -composite compose_DivideDst.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose DivideDst -composite compose_gradient_DivideDst.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose DivideDst -composite compose_DivideDst.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose DivideDst -composite compose_gradient_DivideDst.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose DivideDst
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient DivideDst

Compose Method: DivideSrc

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose DivideSrc -composite compose_DivideSrc.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose DivideSrc -composite compose_gradient_DivideSrc.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose DivideSrc -composite compose_DivideSrc.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose DivideSrc -composite compose_gradient_DivideSrc.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose DivideSrc
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient DivideSrc

Compose Method: Dst

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Dst -composite compose_Dst.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Dst -composite compose_gradient_Dst.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Dst -composite compose_Dst.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Dst -composite compose_gradient_Dst.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Dst
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Dst

Compose Method: Difference

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Difference -composite compose_Difference.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Difference -composite compose_gradient_Difference.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Difference -composite compose_Difference.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Difference -composite compose_gradient_Difference.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Difference
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Difference

Compose Method: Displace

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Displace -composite compose_Displace.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Displace -composite compose_gradient_Displace.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Displace -composite compose_Displace.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Displace -composite compose_gradient_Displace.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Displace
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Displace

Compose Method: Dissolve

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Dissolve -composite compose_Dissolve.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Dissolve -composite compose_gradient_Dissolve.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Dissolve -composite compose_Dissolve.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Dissolve -composite compose_gradient_Dissolve.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Dissolve
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Dissolve

Compose Method: Distort

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Distort -composite compose_Distort.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Distort -composite compose_gradient_Distort.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Distort -composite compose_Distort.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Distort -composite compose_gradient_Distort.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Distort
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Distort

Compose Method: DstAtop

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose DstAtop -composite compose_DstAtop.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose DstAtop -composite compose_gradient_DstAtop.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose DstAtop -composite compose_DstAtop.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose DstAtop -composite compose_gradient_DstAtop.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose DstAtop
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient DstAtop

Compose Method: DstIn

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose DstIn -composite compose_DstIn.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose DstIn -composite compose_gradient_DstIn.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose DstIn -composite compose_DstIn.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose DstIn -composite compose_gradient_DstIn.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose DstIn
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient DstIn

Compose Method: DstOut

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose DstOut -composite compose_DstOut.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose DstOut -composite compose_gradient_DstOut.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose DstOut -composite compose_DstOut.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose DstOut -composite compose_gradient_DstOut.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose DstOut
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient DstOut

Compose Method: DstOver

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose DstOver -composite compose_DstOver.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose DstOver -composite compose_gradient_DstOver.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose DstOver -composite compose_DstOver.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose DstOver -composite compose_gradient_DstOver.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose DstOver
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient DstOver

Compose Method: Dst

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Dst -composite compose_Dst.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Dst -composite compose_gradient_Dst.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Dst -composite compose_Dst.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Dst -composite compose_gradient_Dst.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Dst
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Dst

Compose Method: Exclusion

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Exclusion -composite compose_Exclusion.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Exclusion -composite compose_gradient_Exclusion.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Exclusion -composite compose_Exclusion.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Exclusion -composite compose_gradient_Exclusion.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Exclusion
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Exclusion

Compose Method: HardLight

Bash code:

  1. convert yellow_triangle.png blue_triangle.png /
    -compose HardLight -composite compose_HardLight.png
  2. convert gradient_blue_yellow.png gradient_green_red.png /
    -compose HardLight -composite compose_gradient_HardLight.jpg
  3. convert -size 100x100 xc: -fill gray50 /
    -colorize 100% -raise 4 -normalize -blur 0x4 lighting_effect.png
    convert compose_HardLight.png lighting_effect.png /
    -compose HardLight -composite compose_HardLight_lighting_effect.png
    #OR
    convert compose_HardLight.png /
    \( +clone -fill gray50 -colorize 100% -raise 4 -normalize -blur 0x4 -compose hardlight \) /
    -composite compose_HardLight_lighting_effect.png
  4. convert -size 100x100 xc: -fill gray50 /
    -colorize 100% -raise 4 -normalize -blur 0x4 lighting_effect.png
    convert compose_gradient_HardLight.jpg lighting_effect.png /
    -compose HardLight -composite compose_gradient_HardLight_lighting_effect.jpg
    #OR
    convert compose_gradient_HardLight.jpg /
    \( +clone -fill gray50 -colorize 100% -raise 4 -normalize -blur 0x4 -compose hardlight \) /
    -composite compose_gradient_HardLight_lighting_effect.jpg

PHP code:

  1. <?
    passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
    "-compose HardLight -composite compose_HardLight.png");
    ?>
  2. <?
    passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
    "-compose HardLight -composite compose_gradient_HardLight.jpg");
    ?>
  3. <?
    passthru("/usr/bin/convert -size 100x100 xc: -fill gray50 ".
    " -colorize 100% -raise 4 -normalize -blur 0x4 lighting_effect.png");
    passthru("/usr/bin/convert compose_HardLight.png lighting_effect.png ".
    " -compose HardLight -composite compose_HardLight_lighting_effect.png");
    /*OR*/
    passthru("/usr/bin/convert compose_HardLight.png ".
    " \( +clone -fill gray50 -colorize 100% -raise 4 -normalize -blur 0x4 -compose hardlight \) ".
    " -composite compose_HardLight_lighting_effect.png");
    ?>
  4. <?
    passthru("/usr/bin/convert -size 100x100 xc: -fill gray50 ".
    " -colorize 100% -raise 4 -normalize -blur 0x4 lighting_effect.png");
    passthru("/usr/bin/convert compose_gradient_HardLight.jpg lighting_effect.png ".
    " -compose HardLight -composite compose_gradient_HardLight_lighting_effect.jpg");
    /*OR*/
    passthru("/usr/bin/convert compose_gradient_HardLight.jpg ".
    " \( +clone -fill gray50 -colorize 100% -raise 4 -normalize -blur 0x4 -compose hardlight \) ".
    " -composite compose_gradient_HardLight_lighting_effect.jpg");
    ?>
  1. Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose HardLight
  2. Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient HardLight
  3. Image Magick: Compose HardLight Plus Image Magick: Lighting effect Image Magick: Compose HardLight Lighting effect
  4. Image Magick: Compose Gradient HardLight Plus Image Magick: Lighting effect Image Magick: Compose Gradient HardLight Lighting effect

Compose Method: Hue

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Hue -composite compose_Hue.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Hue -composite compose_gradient_Hue.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Hue -composite compose_Hue.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Hue -composite compose_gradient_Hue.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Hue
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Hue

Compose Method: In

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose In -composite compose_In.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose In -composite compose_gradient_In.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose In -composite compose_In.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose In -composite compose_gradient_In.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose In
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient In

Compose Method: Lighten

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Lighten -composite compose_Lighten.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Lighten -composite compose_gradient_Lighten.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Lighten -composite compose_Lighten.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Lighten -composite compose_gradient_Lighten.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Lighten
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Lighten

Compose Method: LightenIntensity

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose LightenIntensity -composite compose_LightenIntensity.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose LightenIntensity -composite compose_gradient_LightenIntensity.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose LightenIntensity -composite compose_LightenIntensity.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose LightenIntensity -composite compose_gradient_LightenIntensity.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose LightenIntensity
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient LightenIntensity

Compose Method: LinearBurn

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose LinearBurn -composite compose_LinearBurn.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose LinearBurn -composite compose_gradient_LinearBurn.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose LinearBurn -composite compose_LinearBurn.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose LinearBurn -composite compose_gradient_LinearBurn.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose LinearBurn
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient LinearBurn

Compose Method: LinearDodge

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose LinearDodge -composite compose_LinearDodge.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose LinearDodge -composite compose_gradient_LinearDodge.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose LinearDodge -composite compose_LinearDodge.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose LinearDodge -composite compose_gradient_LinearDodge.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose LinearDodge
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient LinearDodge

Compose Method: LinearLight

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose LinearLight -composite compose_LinearLight.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose LinearLight -composite compose_gradient_LinearLight.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose LinearLight -composite compose_LinearLight.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose LinearLight -composite compose_gradient_LinearLight.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose LinearLight
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient LinearLight

Compose Method: Luminize

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Luminize -composite compose_Luminize.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Luminize -composite compose_gradient_Luminize.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Luminize -composite compose_Luminize.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Luminize -composite compose_gradient_Luminize.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Luminize
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Luminize

Compose Method: Mathematics

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Mathematics -composite compose_Mathematics.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Mathematics -composite compose_gradient_Mathematics.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Mathematics -composite compose_Mathematics.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Mathematics -composite compose_gradient_Mathematics.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Mathematics
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Mathematics

Compose Method: MinusDst

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose MinusDst -composite compose_MinusDst.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose MinusDst -composite compose_gradient_MinusDst.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose MinusDst -composite compose_MinusDst.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose MinusDst -composite compose_gradient_MinusDst.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose MinusDst
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient MinusDst

Compose Method: MinusSrc

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose MinusSrc -composite compose_MinusSrc.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose MinusSrc -composite compose_gradient_MinusSrc.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose MinusSrc -composite compose_MinusSrc.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose MinusSrc -composite compose_gradient_MinusSrc.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose MinusSrc
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient MinusSrc

Compose Method: Modulate

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Modulate -composite compose_Modulate.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Modulate -composite compose_gradient_Modulate.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Modulate -composite compose_Modulate.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Modulate -composite compose_gradient_Modulate.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Modulate
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Modulate

Compose Method: ModulusAdd

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose ModulusAdd -composite compose_ModulusAdd.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose ModulusAdd -composite compose_gradient_ModulusAdd.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose ModulusAdd -composite compose_ModulusAdd.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose ModulusAdd -composite compose_gradient_ModulusAdd.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose ModulusAdd
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient ModulusAdd

Compose Method: ModulusSubtract

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose ModulusSubtract -composite compose_ModulusSubtract.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose ModulusSubtract -composite compose_gradient_ModulusSubtract.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose ModulusSubtract -composite compose_ModulusSubtract.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose ModulusSubtract -composite compose_gradient_ModulusSubtract.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose ModulusSubtract
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient ModulusSubtract

Compose Method: Multiply

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Multiply -composite compose_Multiply.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Multiply -composite compose_gradient_Multiply.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Multiply -composite compose_Multiply.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Multiply -composite compose_gradient_Multiply.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Multiply
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Multiply

Compose Method: None

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose None -composite compose_None.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose None -composite compose_gradient_None.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose None -composite compose_None.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose None -composite compose_gradient_None.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose None
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient None

Compose Method: Out

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Out -composite compose_Out.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Out -composite compose_gradient_Out.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Out -composite compose_Out.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Out -composite compose_gradient_Out.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Out
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Out

Compose Method: Overlay

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Overlay -composite compose_Overlay.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Overlay -composite compose_gradient_Overlay.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Overlay -composite compose_Overlay.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Overlay -composite compose_gradient_Overlay.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Overlay
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Overlay

Compose Method: Over

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Over -composite compose_Over.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Over -composite compose_gradient_Over.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Over -composite compose_Over.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Over -composite compose_gradient_Over.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Over
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Over

Compose Method: PegtopLight

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose PegtopLight -composite compose_PegtopLight.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose PegtopLight -composite compose_gradient_PegtopLight.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose PegtopLight -composite compose_PegtopLight.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose PegtopLight -composite compose_gradient_PegtopLight.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose PegtopLight
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient PegtopLight

Compose Method: PinLight

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose PinLight -composite compose_PinLight.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose PinLight -composite compose_gradient_PinLight.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose PinLight -composite compose_PinLight.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose PinLight -composite compose_gradient_PinLight.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose PinLight
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient PinLight

Compose Method: Plus

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Plus -composite compose_Plus.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Plus -composite compose_gradient_Plus.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Plus -composite compose_Plus.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Plus -composite compose_gradient_Plus.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Plus
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Plus

Compose Method: Replace

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Replace -composite compose_Replace.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Replace -composite compose_gradient_Replace.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Replace -composite compose_Replace.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Replace -composite compose_gradient_Replace.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Replace
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Replace

Compose Method: Saturate

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Saturate -composite compose_Saturate.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Saturate -composite compose_gradient_Saturate.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Saturate -composite compose_Saturate.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Saturate -composite compose_gradient_Saturate.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Saturate
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Saturate

Compose Method: Screen

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Screen -composite compose_Screen.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Screen -composite compose_gradient_Screen.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Screen -composite compose_Screen.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Screen -composite compose_gradient_Screen.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Screen
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Screen

Compose Method: SoftLight

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose SoftLight -composite compose_SoftLight.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose SoftLight -composite compose_gradient_SoftLight.jpg

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose SoftLight -composite compose_SoftLight.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose SoftLight -composite compose_gradient_SoftLight.jpg");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose SoftLight
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient SoftLight

Compose Method: Src

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Src -composite compose_Src.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Src -composite compose_gradient_Src.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Src -composite compose_Src.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Src -composite compose_gradient_Src.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Src
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Src

Compose Method: SrcAtop

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose SrcAtop -composite compose_SrcAtop.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose SrcAtop -composite compose_gradient_SrcAtop.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose SrcAtop -composite compose_SrcAtop.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose SrcAtop -composite compose_gradient_SrcAtop.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose SrcAtop
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient SrcAtop

Compose Method: SrcIn

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose SrcIn -composite compose_SrcIn.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose SrcIn -composite compose_gradient_SrcIn.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose SrcIn -composite compose_SrcIn.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose SrcIn -composite compose_gradient_SrcIn.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose SrcIn
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient SrcIn

Compose Method: SrcOut

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose SrcOut -composite compose_SrcOut.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose SrcOut -composite compose_gradient_SrcOut.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose SrcOut -composite compose_SrcOut.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose SrcOut -composite compose_gradient_SrcOut.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose SrcOut
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient SrcOut

Compose Method: SrcOver

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose SrcOver -composite compose_SrcOver.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose SrcOver -composite compose_gradient_SrcOver.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose SrcOver -composite compose_SrcOver.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose SrcOver -composite compose_gradient_SrcOver.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose SrcOver
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient SrcOver

Compose Method: Xor

Bash code:

convert yellow_triangle.png blue_triangle.png /
-compose Xor -composite compose_Xor.png
convert gradient_blue_yellow.png gradient_green_red.png /
-compose Xor -composite compose_gradient_Xor.png

PHP code:

<?
passthru("/usr/bin/convert yellow_triangle.png blue_triangle.png ".
"-compose Xor -composite compose_Xor.png");
passthru("/usr/bin/convert gradient_blue_yellow.png gradient_green_red.png ".
"-compose Xor -composite compose_gradient_Xor.png");
?>
Image Magick: yellow triangle Plus Image Magick: blue triangle Image Magick: Compose Xor
Image Magick: yellow triangle Plus Image Magick: Gradient Lime Red Image Magick: Compose Gradient Xor