Page 1 of 1

Collage images with blend

Posted: 2018-10-01T05:33:02-07:00
by dognose
Hi All,

I'm looking to do a 2x2 collage with overlapping / blended edges.

I can't figure out an easy way to do the overlap / blend part. Any suggestions?

Re: Collage images with blend

Posted: 2018-10-01T06:15:09-07:00
by snibgo
Blending can be done with a masked "-compose Over -composite". For example, blending horizontally between x=120 and x=180, with a linear blend (Windows syntax):

Code: Select all

magick ^
  toes.png ^
  ( toes.png -negate ) ^
  ( +clone -sparse-color bilinear "120,0,White 180,0,Black" ) ^
  -compose Over -composite ^
  blnd_neg.jpg
Image

See Blending pyramids for some other blending techniques.

Instead of blending, we can make a jagged cut that is the line of least difference between the images:

Code: Select all

magick ^
  toes.png ^
  ( toes.png -negate ) ^
  ( -clone 0-1 ^
    -compose Difference -composite ^
    -process darkestpath ^
    -fill White -draw "color 0,0,floodfill"
  ) ^
  -compose Over -composite ^
  blnd_neg2.jpg
Image

See Dark paths for more detail.