seeking for help on MNG creation
Sven Neumann <[email protected]> 17 Mar 2004 14:05:25 +0100
| Newsgroups | gmane.comp.graphics.mng.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I just subscribed to this list in the hope that you might be able to
help me. I am also interested in MNG in general, so I guess I will
follow whatever discussions go on here. But let me please show you my
problem first...
For the Blinkenlights project (http://www.blinkenlights.de/), we had a
creator of GIF animations quite early but I figured that GIF isn't
really suited to our needs when we started to introduce levels of
grayscale. However, having a look at one of the older GIF animations
would make it less difficult for me to explain what I am trying to do.
So please, have a short look at this animation:
http://blinkenlights.de/gallery/camel.en.html
My goal is to write a tool that creates similar animations but using
the MNG format. We have a simple XML-based file format for our
"movies" as well as a theme file format that describes how to combine
PNG images to get the desired look. The idea is to be able to create
a MNG animation on the command-line using
b2mng --theme <themename> <moviefile> > foo.mng
I have written this tool using libmng and it creates MNG files that
should IMO work. Judging from the output of mngtree, the files seem to
be correct and none of the viewers I tried so far complain. But the
problem is that nothing is shown except the background image. So I
guess I must be doing something wrong. I have put a simple MNG file
(2 frames) online here:
http://sven.gimp.org/blinkenlights/heart.mng
Here's a short commented excerpt from the mngtree output. The basic
idea is to set an image of the building as background layer. Then,
load an image of illuminated windows and place clones before the
windows according to the frame data.
MHDR # header
tEXt # comment
DEFI # define an abstract object
IHDR # load PNG chunks
IDAT # ..
IEND # ..
BACK # set the object as background image
SAVE # save
TERM # set loop behaviour
SEEK # seek
FRAM # first frame (MNG_FRAMINGMODE_4)
DEFI # define another abstract object
IHDR # load PNG chunks
IDAT # ..
IEND # ..
CLON # do a partial clone of the image just loaded and position it
CLIP # we only need part of the image, so set a clip rectangle
(repeat CLON, CLIP steps for all illuminated windows ...)
SHOW # set windows visible and display them (MNG_SHOWMODE_0)
FRAM # second frame (MNG_FRAMINGMODE_NOCHANGE)
(optionally create some more clones here if needed)
SHOW # set windows visible and display them (MNG_SHOWMODE_0)
(repeat for all frames)
MEND
Now, what could I be doing wrong here? If there's interest, I can make
available the source code. It is licensed under the terms of the GPL.
It would be very nice if you could help me with this. I am pretty much
stuck at this point. I read the spec, I tried various changes but I
always end up with only the background image displayed :(
Sven
--
Send the message body "help" to [email protected]