Re: seeking for help on MNG creation
Sven Neumann <[email protected]> 31 Mar 2004 01:40:29 +0200
| Newsgroups | gmane.comp.graphics.mng.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
sorry for not replying earlier but other things (like the GIMP 2.0
release) kept me busy lately. I have now returned to the problem of
generating MNG animations out of Blinkenlights movies. You will
probably remember my last mails...
Following your advice I have now been able to create a working
animations by using a MOVE, CLIP, SHOW sequence for each window. I've
uploaded such a file to http://sven.gimp.org/heart.mng. There's an
issue with the timing, but if you don't mind we can look at that as
soon as the other problems are ruled out.
As you can see, I got it to work basically, but the generated files
are however rather large. This is not evident with the simple example
of the blinking heart but for other Blinkenlights movies, the file
size becomes a problem. I could cut down on file size by using LOOP,
ENDL and relative move and clip coordinates. However this helps only
if there are several windows of the same intensity in the same row.
There are some animations where this is seldom the case, so I'd like
to optimize the general case first. I identified the CLIP chunk as the
major cause for the large file size so I tried to get rid of that.
The reason the CLIP chunk is needed at all is that the overlay image
contains a series of images from that I need to use a clipped area
only when I show a window. My current approach to optimize the
animation is to do the clipping before the actual animation (even
before the SAVE, TERM, SEEK sequence). To do this, I create new empty
objects of the right size using a DEFI, BASI, IEND sequence. Then I
use a PAST chunk to copy the relevant part from the overlay image.
Later in the animation frames I can then refer to the clipped images
and only need to MOVE, SHOW them. Does that sound reasonable?
Here's a file that I created using this optimisation:
http://sven.gimp.org/heart-opt.mng. As you will probably notice, this
file is somehow broken. mngtree and gmngview both freeze when loading
this file. Perhaps you could have a look with MngEye? BTW, I haven't
been able to download this tool, is it available somewhere?.
Here's the relevant part of my source code that creates a pre-clipped
image object:
mng_putchunk_defi (hMNG,
id,
MNG_DONOTSHOW_NOTVISIBLE,
MNG_ABSTRACT,
MNG_FALSE, 0, 0,
MNG_FALSE, 0, 0, 0, 0);
mng_putchunk_basi (hMNG,
win.w, win.h,
MNG_BITDEPTH_8,
MNG_COLORTYPE_RGB,
MNG_COMPRESSION_DEFLATE,
MNG_FILTER_ADAPTIVE,
MNG_INTERLACE_NONE,
0x0, 0x0, 0x0, 0x0,
MNG_VIEWABLE);
mng_putchunk_iend (hMNG);
mng_putchunk_past (hMNG,
id,
MNG_TARGET_ABSOLUTE, 0, 0,
1);
mng_putchunk_past_src (hMNG,
0,
image_id,
MNG_COMPOSITE_REPLACE,
MNG_ORIENTATION_SAME,
MNG_OFFSET_ABSOLUTE,
- win.x, - win.y,
MNG_BOUNDARY_ABSOLUTE,
win.x, win.x + win.w, win.y, win.y + win.h);
If you like, I can make the full source code available. This code is
going to be relased as part of the blinkentools packages (which is
GPL) when it is done. I hope you can again help me. Your comments last
time got me a good deal further already. Thanks for that.
Sven
--
Send the message body "help" to [email protected]