Page 1 of 1
Merging 3 images, help
Posted: 2011-11-25T14:28:58-07:00
by M4g
Hello friends! I need some help and ideas with this:
Condition:
1st image (texture, can be absolutely any image):
2nd image:
3rd image:
What I need:
---
any suggestions?
Re: Merging 3 images, help
Posted: 2011-11-25T16:28:38-07:00
by fmw42
Make your third image into a binary mask (black and white). Then composite the old car image over the background using the binary mask to control which image gets what. The trick (which is not easy to get perfect) is that you need to make the blue into white and everything else black (including the subaru letters). Or make the blue into black and everything else white and then negate the result.
then
convert car.png background.png mask.png -composite result.png
Re: Merging 3 images, help
Posted: 2011-11-26T05:38:10-07:00
by M4g
no-no! 3rd no matter!
for e.g.:
+
=
any ideas?
Re: Merging 3 images, help
Posted: 2011-11-26T11:32:56-07:00
by fmw42
If you modify the third image correctly as a mask, it will do the job. But the hard part is making just the blue into white and everything else black including the subaru text (and no alpha channel). That is all I can tell you. If you can make that mask correctly, link to it on your message and I will show you that it works. You can also make the blue into black and everything else white including the subaru text and that can work also with the switching of the texture and car image.
I renamed your images for simplicity but you can figure those out. So try these steps and see what I am doing. Then you need to refine your mask.
convert 1mask.png -alpha extract 1mask3.png
convert 1car.png -alpha extract -negate 1mask4.png
convert 1mask3.png 1mask4.png -average -fill white +opaque black 1mask5.png
convert 1texture_02.png[300x100+0+0] 1car.png 1mask5.png -alpha off -composite \
\( 1mask4.png -negate \) -compose copy_opacity -composite 1result.png