Original Image:
and this what needs to be achieved.
brick image:
I have many images like one below
I need to multiply this image with a color say "rgba(103,68,56,5)" and make the center white part transparent.
The way I do:
convert mortar.png ( -clone 0 -fill 'rgba(103,68,56,5)' -colorize 100 ) -channel rgba -alpha on -compose Multiply -composite mortar.png
convert mortar.png -transparent 'rgba(103,68,56,5)' mortar.png
the resultant image I get is:
Where as desired image is something like one below: Just look at the inside corner line of the image and the dots on white area you can ignore.
I have tried with different fuzz values as well but that degrades the image more and put holes in the colored area.
Please right click the image and save it at your location to see what full image looks like.
Output after adding blur with command
convert m.png -blur 0x.3 ( +clone -fill 'rgba(103,68,56,5)' -colorize 100 ) -channel rgba -alpha on -compose Multiply -composite -transparent 'rgba(103,68,56,5)' out.png
Desired output: