Page 2 of 2

Re: png transparent background is black

Posted: 2015-08-25T12:39:36-07:00
by paphus
If I use "identify -verbose" and compare the original image, with the converted one, the alpha difference is,

original (that gives transparent webm) - Alpha: none #00000000
converted (that is white background) - Alpha: srgba(255,255,255,0) #FFFFFF00

So, how do I make the Alpha - none #00000000
?

Re: png transparent background is black

Posted: 2015-08-25T12:44:20-07:00
by fmw42
try

Code: Select all

convert image -background black -alpha background newimage

Re: png transparent background is black

Posted: 2015-08-25T13:08:30-07:00
by paphus
Doh, okay I figured it out. My images were good, but I somehow have two different versions of ffmpeg on my computer and was using the wrong one that doesn't seem to support transparency.

Now it is working.

My only issue is the last shell line,

for /f %x in ('dir /s /b blink*.png') do @composite -compose CopyOpacity mask-0.png %x %x

This only uses mask-0.png, instead of mask-1 for blink01.png, mask-2 for blink02.png etc.

Re: png transparent background is black

Posted: 2015-08-25T16:11:37-07:00
by fmw42
You will need to change the -x in a variable for the mask-x.png image in your loop. I do not know what the @ is before composite. It is not IM syntax. Is this on Windows or Unix? Looks more like Windows syntax.

Re: png transparent background is black

Posted: 2015-09-06T11:46:11-07:00
by paphus
windows, here is my final script,

for /f %x in ('dir /s /b talk*.png') do @convert -alpha extract %x %x-mask.png
mogrify -flatten talk*.png
for /f %x in ('dir /s /b talk*.png') do @composite -compose CopyOpacity %x-mask.png %x %x

works, end result here,
http://www.botlibre.com/avatar?id=1115544