[SOLVED!!] png2swf stitched pngs without alpha channel?

Questions and answers about animation with Synfig. We encourage you to document your findings on the tips page of the website
User avatar
Nin
Posts: 11
Joined: Fri Sep 18, 2015 4:24 pm
Location: Canada

[SOLVED!!] png2swf stitched pngs without alpha channel?

Postby Nin » Mon Nov 23, 2015 12:27 pm

Hi, I am very new to working in Synfig, but I am falling in love with it fast!

My goal: Use Synfig to create small swf files that I can upload to PowToons to enhance my marketing videos. Basically give me custom creative characters that PowToons does not supply.

My work so far: created screen shot of existing character from a "theme pack" and imported the png into Inkscape. Created a doll for character to hold. Exported as png file with transparent background. (A MUST!) Imported the new png into Synfig. Using the new cutting tool, added skeleton, separated the parts I wanted to move, and linked the parts to the co-coordinating bones. Rendered using ".png" setting and got 96 separate png files in sequence with a transparent background. Excellent! At 24fps, the animation is 4sec long. Perfect! Character is holding her doll and playing with it.

Problem: Stitching the .png files together in sequence to play WITH THE TRANSPARENT background.
I use a Mac Mini, OS X Yosemite Version 10.10.5 ... I downloaded the SWFTOOL for Mac. I placed the "png2swf.exe" into the folder where all the sequential png files are. Ran this code in my cmd pannel:

png2swf -z -r24 -T20 00*.png

Link to the options list


*Note: if you have more than 00*.png files, such as 0000.png to 0250.png, only the first 100 will be sequenced in the resulting swf. To get around that, use 0*.png.

**NOTE: How to resize batch of pngs all at once: Use ImageMagick... Link to great tutorial: .
In terminal window, navigate to the folder containing my pngs...
In my command line enter:
for file in *.png; do convert $file -resize (enter the dimensions as _x_) (enter new file name)-$file; done
works great! file "001.png" is now resized and named (newfilename)-001.png
Create swf in terminal window using png2swf line above:
png2swf -z -r24 -T20 00*.png
The resulting swf will be have transparent background, but alpha shows as black. Open free program FFdec and drage swf into the window. Click on the "others" folder in the file tree for the swf, and select "SetBackgrounColor." The main window will say "backgroundColor= rgb red:0, green:0, blue:0" ... click on this and it will show a black color box. Click on the black color box and it will bring up a palette to choose a color from. Select white. It will now read as "backgroundColor= rgb red:255, green:255, blue:255" ... make sure to click "save". It is now on a transparent background!

Got this animation as a result. They are screen shots of the swf animation in my browsers window.
Screen Shot 2015-11-23 at 11.17.56 AM.png

Screen Shot 2015-11-23 at 11.18.12 AM.png

Screen Shot 2015-11-23 at 11.18.19 AM.png


and the mp4 here:



You can see how the inserted swf animation has a black box around it against the background.
Screen Shot 2015-11-23 at 11.59.45 AM.png


Question: HOW do I tell png2swf to preserve the transparent background for output!?!???

I'm a newbie, so please give an example of the text you would write in the cmd pannel, and possibly a very brief explanation of why it works. I'm really stumped by this problem. Any and all help would be appreciated!
Last edited by Nin on Fri Mar 11, 2016 3:37 pm, edited 11 times in total.

User avatar
Genete
Site Admin
Posts: 5155
Joined: Sat Dec 01, 2007 6:26 am
Location: Spain

Re: png2swf stitched pngs without alpha channel

Postby Genete » Mon Nov 23, 2015 7:43 pm

Why don't you create the whole animation (included background) as a png sequence and then use the png2swf tool over them?
For support on png2swf please ask to the web.
-G
needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you can contribute! :D

User avatar
Nin
Posts: 11
Joined: Fri Sep 18, 2015 4:24 pm
Location: Canada

Re: png2swf stitched pngs without alpha channel

Postby Nin » Mon Nov 23, 2015 11:00 pm


User avatar
d.j.a.y
Site Admin
Posts: 1356
Joined: Fri Apr 27, 2012 4:35 am
Contact:

Re: png2swf stitched pngs without alpha channel

Postby d.j.a.y » Tue Nov 24, 2015 7:48 am


User avatar
Nin
Posts: 11
Joined: Fri Sep 18, 2015 4:24 pm
Location: Canada

Re: png2swf stitched pngs without alpha channel

Postby Nin » Tue Nov 24, 2015 12:07 pm

Hi d.j.a.y!

Hmm. I'm pretty sure they have a transparent background... When they are viewed in Mac OX Preview, they display a pale grey background, like the transparent background images I create in Inkscape do when I view them in Preview as well...

When I uploaded the attachment it shows here as a white background. They must be transparent, right?

0002.png


Nin

User avatar
d.j.a.y
Site Admin
Posts: 1356
Joined: Fri Apr 27, 2012 4:35 am
Contact:

Re: png2swf stitched pngs without alpha channel

Postby d.j.a.y » Tue Nov 24, 2015 1:25 pm


User avatar
Nin
Posts: 11
Joined: Fri Sep 18, 2015 4:24 pm
Location: Canada

Re: png2swf stitched pngs without alpha channel

Postby Nin » Tue Nov 24, 2015 5:22 pm


User avatar
darkspace65
Posts: 577
Joined: Mon Feb 25, 2013 6:22 pm
Location: Belgium, Flanders.

Re: png2swf stitched pngs without alpha channel

Postby darkspace65 » Wed Nov 25, 2015 6:52 pm

Hi!
Do you also get the same problem when you select cairo_png as your render target in synfig?
Greetz!

User avatar
Nin
Posts: 11
Joined: Fri Sep 18, 2015 4:24 pm
Location: Canada

Re: png2swf stitched pngs without alpha channel

Postby Nin » Thu Nov 26, 2015 11:04 pm

Attachments
Screen Shot 2015-11-26 at 10.01.45 PM.png

User avatar
Nin
Posts: 11
Joined: Fri Sep 18, 2015 4:24 pm
Location: Canada

Re: png2swf stitched pngs without alpha channel

Postby Nin » Sat Dec 05, 2015 2:46 pm

Attachments
Screen Shot 2015-12-05 at 1.39.23 PM.png

User avatar
d.j.a.y
Site Admin
Posts: 1356
Joined: Fri Apr 27, 2012 4:35 am
Contact:

Re: png2swf stitched pngs without alpha channel

Postby d.j.a.y » Sun Dec 06, 2015 8:53 am


njleo
Posts: 1
Joined: Sat Aug 13, 2016 12:33 am

Re: [SOLVED!!] png2swf stitched pngs without alpha channel?

Postby njleo » Sat Aug 13, 2016 12:51 am

Hi Nin, I am trying to complete the same task you described but the solution you used does not seem to work on my project. I was wondering if you could give some advice.

My character is animated in Synfig (about 10 second long animation) and I want to render with an alpha transparent background, so I can then place the video in a scene a short 3D animation I have produced in Blender. The animations were original created in Inkscape and I can import single frames as JPG's with alpha transparent backgrounds into Blender. However, I want to animate these characters first and then place in Blender.

I have imported my SVG's into Synfig and created the short animation. However, I cannot export any video format from Synfig, I have tried multiple settings and it does not seem to work. I guess you had the same problem???

I can export PNG's. These PNG's do not have an alpha transparent background, but they render with a black background and an alpha file.

I tried to install png2swf, and I was going to follow your steps, but for some reason png2swf closes everytime I open it. Not sure if you had this problem?

Also if I cannot get png2swf to work (for unknown reasons) is there any other way to convert all my png's to a movie sequence with an alpha transparent background?

Any advice is welcome.

User avatar
d.j.a.y
Site Admin
Posts: 1356
Joined: Fri Apr 27, 2012 4:35 am
Contact:

Re: [SOLVED!!] png2swf stitched pngs without alpha channel?

Postby d.j.a.y » Sat Aug 13, 2016 6:09 pm



Return to “Animation related help”

Who is online

Users browsing this forum: No registered users and 2 guests