compose "over" + convert png->jpg + white background
Posted: 2018-10-18T15:02:38-07:00
Hey imagemagick dudes,
I'm struggling here to figure out what I'm doing wrong.
So first I just wanted to compose two png layers over one another and convert to jpg:
This works fine, but the background is black, and I want it to be white. I found through some other answers that I can use "flatten" to solve this, but I think that's strictly for conversion and not composition over.
This fails.
I'm figuring there is something I need to do using parentheses, or to first convert and then compose, or something like that. But I'm having a hard time figuring what's best to do? Ideas?
P.S This is an example of two layers, but I also need to do images with up to 10 layers.
I'm struggling here to figure out what I'm doing wrong.
So first I just wanted to compose two png layers over one another and convert to jpg:
Code: Select all
convert ./1.png ./2.png -compose over -composite 3.jpg
Code: Select all
convert -background white -flatten ./1.png ./2.png -compose over -composite 3.jpg
I'm figuring there is something I need to do using parentheses, or to first convert and then compose, or something like that. But I'm having a hard time figuring what's best to do? Ideas?
P.S This is an example of two layers, but I also need to do images with up to 10 layers.