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?
Merging 3 images, help
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Merging 3 images, help
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
then
convert car.png background.png mask.png -composite result.png
Re: Merging 3 images, help
no-no! 3rd no matter!
for e.g.:
+
=
any ideas?
for e.g.:
+
=
any ideas?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Merging 3 images, help
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
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