0
I have two JPGs one big.jpg
and the other small.jpg
.
I want to extract a region region.jpg
of big.jpg
of the same size as small.jpg
and merge region.jpg
and small.jpg
into a result.jpg
. result.jpg
is equal to small.jpg
, except at the 16 pixels boundary where it gets more and more similar to region.jpg
.
Using ImageMagick, I have done this in two steps, making a semitransparent PNG first:
convert -compress None small.jpg -channel A -virtual-pixel transparent -morphology Distance Euclidean:4,16! semitransparent.png
convert -compress None big.jpg -crop wxh+x+y semitransparent.png -composite result.jpg
Is there any way of doing this in a single step, without generating the intermediate PNG? I tried this:
convert -compress None big.jpg -crop wxh+x+y small.jpg -channel A -virtual-pixel transparent -morphology Distance Euclidean:4,16! -composite result.jpg
But this is not quite the same: the semitransparent layer does not end up really transparent at the edge.
I am a total newbie to ImageMagick (what a complex piece of software!), any suggestions would be appreciated.
EDIT
I'm adding files big.jpg
and small.jpg
to play with, together with result.jpg
that comes out of the 2-line solution, and result2.jpg
that comes out of the oneliner. The -crop
I used was 200x160+160+80
: