Skip to content

PNG Decoder written in C++ that conforms to the standard specification and transforms PNG images into RGB pixels based image structures.

Notifications You must be signed in to change notification settings

D0zee/png-decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PNG-decoder

Overview

This project is a PNG image decoder that supports grayscale images, regular RGB, indexed images with a fixed palette, and alpha-channel transparency. It decodes PNG images using a pipeline of steps that involves reading the signature bytes, parsing chunks until the IEND chunk is found, validating the CRC of each chunk, concatenating the content of all IDAT chunks into a single byte vector, and decoding the byte vector using deflate. The decoded data is processed by scanlines, applying specified filters.

This decoder supports all possible combinations of modes in IHDR, with bit depth <= 8.

Usage

To use this decoder, include png_decoder.h in your project and call the ReadPng function with the filename of the PNG image as the argument. The function returns an Image object, which contains the width, height, pixel format, and pixel data of the decoded image.

Dependencies

Supported features

  • Grayscale images
  • Regular RGB images
  • Indexed images with a fixed palette
  • Alpha-channel transparency
  • Interlaced images

Unsupported features

  • bit depth = 16
  • Ancillary chunks (except for IHDR and PLTE chunks)

About

PNG Decoder written in C++ that conforms to the standard specification and transforms PNG images into RGB pixels based image structures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published