Code: Select all
magick m_bgnd.png m_masked.png -compose src -composite m_over_masked.png
The example images are partially transparent (filled circles with transparent background) right? But actually partially transparent circles are much more useful to look at for overlaying transparencies:
Code: Select all
magick -size 60x60 xc:none -fill rgba(255,0,0,0.5) -draw "circle 35,21 35,3" m_src.png
magick -size 60x60 xc:none -fill rgba(0,0,255,0.5) -draw "circle 21,39 24,57" m_bgnd.png
magick -size 60x60 xc: -draw "polygon 0,59 59,0, 0,0" m_mask.png
magick m_src.png m_mask.png ( -clone 0 -alpha extract ) ( -clone 1 -clone 2 -compose multiply -composite ) -delete 1,2 -alpha off -compose copy_opacity -composite m_masked.png
magick m_bgnd.png m_masked.png -compose over -composite m_over_masked.png
Dissolve:
Code: Select all
magick m_bgnd.png m_masked.png -compose dissolve -composite m_over_masked.png
Code: Select all
magick m_bgnd.png m_masked.png -compose dissolve -define compose:args=50x50 -composite m_over_masked.png
Blend gives overlapping region opacity = 1xbackground+1xsource (1.0) while color channels = 0.5xbackground+0.5xsource (170,0,85)
Code: Select all
magick m_bgnd.png m_masked.png -compose blend -composite m_over_masked.png
What I was hoping for in the overlapping region is the simple average for both the opacity and color channels = 0.5xbackground+0.5xsource. Is there any (easy I hope) way to do that?