# Multiple Network Graphics File Format

# Multiple Network Graphics File Format

MNG is a multiple-image member of the Network Graphics format family. It can contain animations, slide shows, or complex still frames, comprised of multiple PNG or JNG single-image datastreams. This format has complex animation capabilities but Imaging only extracts frames. Individual frames are stored as standard PNG or JNG images.
Imaging saves MNG files as MNG-VLC (very low complexity) so it is basically an array of image frames without MNG animation chunks. Frames can be saved as lossless PNG or lossy JNG images. Every frame can be in different data format.
For information about supported data formats of individual frames look at PNG and JNG file formats, which are internally used to store frames.

## MNG frame formats

PNG File Format
JNG File Format
When working with MNG files you can find useful some options which can be set by SetOption function and their current values can be get by GetOption function. Or you can set them by modifying properties of TMNGFileFormat class.

## Options Related to MNG Files

OptionId | Allowed Values | Usage
--- | --- | ---
ImagingMNGLossyCompression | 0 (False) or 1 (True) | Specifies whether MNG animation frames are saved with lossy or lossless compression. Lossless frames are saved as PNG images and lossy frames are saved as JNG images. Default value is 0.
ImagingMNGLossyAlpha | 0 (False) or 1 (True) | Defines whether alpha channel of lossy compressed MNG frames (when ImagingMNGLossyCompression is 1) is lossy compressed too. Default value is 0.

ImagingMNGPreFilter

0, 1, 2, 3, 4, 5, 6

Sets precompression filter used when saving MNG frames as PNG images. Allowed values are:
- 0 - None Filter
- 1 - Sub Filter
- 2 - Up Filter
- 3 - Average Filter
- 4 - Paeth Filter
- 5 - Use 0 for indexed/gray images and 4 for RGB/ARGB images
- 6 - Adaptive filtering - use best filter for each scanline - very slow
Note that filters 3 and 4 are much slower than filters 1 and 2. Default value is 5.

ImagingMNGCompressLevel | 0 (no compression) to 9 (best compression) | Sets ZLib compression level used when saving MNG frames as PNG images. Default value is 5.
ImagingMNGQuality | 1 to 100 | Specifies compression quality used when saving MNG frames as JNG images. Higher value means worse compression/better image quality/larger file size. Default value is 90.

ImagingMNGProgressive

0 (False) or 1 (True)

Specifies whether images are saved in progressive format when saving MNG frames as JNG images. Progressive JPEG rearranges the stored data into a series of scans of increasing quality. In situations where a JPEG file is transmitted across a slow communications link, a decoder can generate a low-quality image very quickly from the first scan, then gradually improve the displayed quality as more scans are received. Default value is 0 (False).