OUR FREE ONLINE TOOLS: Imgur Downloader Gfycat Downloader Vimeo Downloader Instagram Downloader (new) Find Subtitles File Detective Subtitle Converter File Extensions Image Converter
Images \ Raster images \ .png - Portable Network Graphic

What is .png file?

Portable Network Graphic is a raster image. It was created by PNG Development Group in 1996.
Images are compressed.
File extension is .png.

Software handling .png files

Rest7 Free Online Converter

Structure of .png images

The header is 8 byte long.
Name Type Description
Magic String[8] #89 + "PNG" + #0D #0A #1A #0A
After this go chunks. Each chunk has this structure:
Name Type Description
Length UInt32
Chunk Type String[4] For example "IHDR", "PLTE", "IDAT", "IEND"
Chunk Data UInt8[Length]
CRC-32 UInt32 Computed from Chunk Type and Chunk Data

IHDR - The first chunk

Name Type Description
Width UInt32
Height UInt32
BPP UInt8 Bits per pixel. Possible values:
1- only grayscale or palette
2- only grayscale or palette
4- only grayscale or palette
8- every type
16- not for palette
Color Type UInt8 Possible values:
0- grayscale
2- RGB
3- palette
4- grayscale + alpha
Compression UInt8 Possible values:
0- deflate
Filter UInt8 Possible values:
0- adaptive filtering with five basic filter types
Interlace UInt8 Possible values:
0- no interlace 1- Adam7 interlace

PLTE - palette chunk

Number of entries is determined by chunk length divided by 3. Each entry is:
Name Type Description
Red UInt8
Green UInt8
Blue UInt8

IDAT - the image data chunk

Each scanline is prepended with UInt8 defining filter type.

IEND - the last chunk

This chunk has no data, hence the Chunk Length is 0.
Data types:
UInt8, UInt16, UInt32, UInt64 - Unsigned Integer 8 bit, 16 bit, 32 bit, 64 bit
Int8, Int16, Int32, Int64 - Signed Integer 8 bit, 16 bit, 32 bit, 64 bit
UMint16, UMint32 - Unsigned Motorola Integer 16 bit, 32 bit (Big Endian)
Char8, Char16 - Char 8 bit, 16 bit
Rest7 Webtools Contact Usage Agreements Image Converter

Some icons by Freepik (CC BY 3.0)

Copyright © 2015-8 by rest7.com. All rights reserved.