This site is 100% GIF free! Powered by libmng!
libmng - The MNG reference library & related info


Back to index
Frequently Asked Questions - libmng


I just need to get the frames without displaying them. How do I do that?
There's no easy way (yet). You should keep in mind that the structure of MNG allows for multiple loops and also unlimited loops. These kind of animations would generate an endless amount of frames, since the end of the file is never reached. There's a big difference with simple GIF files! MNG gives you more power, but also makes it a little more difficult to know what's going to happen further down the file.

Currently what you'd have to do is let the library think you're displaying the file, but simply store the given frame each time the setdelay() callback is called. The problem is that the gettickcount() callback will have to 'fake' its actual count, to make libmng believe a delay finished, so simply keep adding the delays given to the settimer() callback to the tickcount.

Some functions appear to be empty. Why?
libmng has taken a lot of my time. I don't regret spending any of it, because there are so many great people helping, and many, many, many others enjoying it. But it does take a lot of time, and I haven't been able to complete it entirely yet. If you've ever had a look at the complete MNG specification, you'll see why!!! :-)
The missing functions don't hinder the libraries use at all. It's just inconvenient because they might make some programmers life a lot easier. Rest assured that they will eventually be finished. It's just a matter of time...

Can I use this software freely?
Yes, yes and yes! It was, is and always will be freely available, and you may use it as you see fit. A complimentary note to its original developer is appreciated but not required. You can use it in free software (freeware), shareware, adware, commercial apps, military apps, browsers, viewers, editors, whatever.... There are no catches, no smallprint, no requirements and no restrictions. Here's the license text. Of course, if you'd really feel obliged to donate some sum of monetary currency, I wouldn't hold it against you... ;)

Why is libmng so different from libpng?
The easy answer would be to say that it was created by another developer. But the real difference lies in the fact that handling animations is quite different from handling static images. It requires a smoother cooperation between the application and the library. Also I wanted to make the interface as plain and simple as possible and hide the internal structures. libpng is a lot more open than libmng, but that also creates a lot of problems. Having the internal structures off-limits to apps and encompassing libs will make sure that pretty much most future changes will be backwards and forwards compatible.

Is libmng available for my platform?
Check the ports & packages download page. You'll find it in the download section. libmng was written in ANSI-C, so it should run on just about every platform. Many ports are already out there, and it could well be your system already has libmng on it!

What do I need zlib, lcms or ijgsrc6b for?
That depends on your needs with libmng. If you just need to read or write a simple MNG you'll basically only need zlib. zlib is the library that takes care of the compression/decompression of the pixeldata. This is definitely not different from libpng or PNG handling.

MNG also has a sub-format named JNG (JPEG Network Graphics). This is an extension that allows the inclusion of JPEG images in the MNG. The benefit of enclosing a JPEG inside a MNG (or JNG image) comes with PNG's goodies: transparency and color-correction. But to work with JPEG encoded data you'll need ijgsrc6b.

lcms (little-CMS) by Marti Maria Saguer is required if you want to include full color-correction capabilities to the library. Capturing devices and display devices are quite different (even among themselves) and PNG allows for compensation between these devices by embedding specific color-information inside the file. lcms is a great gem of software that'll bring the true power of the color-information back to live on your display device.

Check the links section for more info on these libraries!

What is MNG?
MNG stands for Multiple-image Network Graphic. It's the animation extension to the already popular PNG image format. If you'd like to know more about the history behind MNG, you should really check the MNG Homepages by Greg Roelofs. One of the guru's in this field and maintainer of the PNG and the MNG homepages, not to mention the related zlib homepage.

How do I display MNG's in my browser?
Well, that REALLY depends on your flavor of browser. Mozilla, Netscape 6, KDE Konqueror and some others have built-in support. There are plugins for older versions of Netscape (both Windows & Linux) and Netscape-plugin supporting browsers such as Opera and MSIE. There's even a native ActiveX control for MSIE.
Check the download section for the browser and plugin/ActiveX pages.

What's this TNG format mentioned in the Delphi component?
Heh heheh ;)
(this one's for you Declan...)

For those unfamiliar with Delphi terminology. The T is actually a prefix for a Delphi component. All component-names start with a 'T'. (a component is similar to a C++ class!). So TNGImage breaks up as T-NG-Image. A Delphi component for handling (read/display/create/write) of Network Graphics.

In fact the package also defines TMNGImage, TJNGImage and TPNGImage (and even TMNGVideo for optimized MNG-video stream playback), which are all derived from TNGImage.

I get weird errors from uninitialized memory. What's going on?
libmng expects all it's memory to be zeroed out. It's internal memory-manager uses calloc() for this purpose. But the default is to have your application supply the memory-callbacks. This means your allocation function *must* zero out the memory before returning to libmng. A simple call to calloc() instead of alloc() should do the trick!

Back to index