PNG
PNG (Portable Network Graphics) is a losslessly compressed raster-image format that supports transparency.
Learn Go with Pocket-Sized Projects
PNG is a lossless raster image file format that supports indexed, grayscale, and truecolor images with optional transparency.
- How it is used
- Preserves exact pixel colors when raster data represents maze walls, paths, entrances, and treasures.
- How deep it goes
- Explains raster pixels, RGBA access, decoding, encoding, and scan order without detailing PNG compression internals.
- Examples
- Uses a PNG RGBA maze whose explored path is highlighted in a second image.
- What you can do after
- Build a Go tool that decodes, inspects, modifies, and encodes PNG images through standard image packages.
Web Design Playground, Second Edition
PNG is a lossless raster image format that supports indexed, grayscale, and truecolor images, including alpha transparency.
- How it is used
- Deploys PNG for web illustrations, logos, and icons that use solid colors or transparency.
- How deep it goes
- Explains PNG use, color-depth choices, and optimization, but stops short of describing encoding internals.
- Examples
- Uses an atomic-logo.png example, simple logos and icons, 8-bit color, 24-bit palettes, and PNG optimization tools.
- What you can do after
- Apply it via PNG color-depth choices, image optimization tools, and the HTML img element.
Read how Web Design Playground, Second Edition explains PNG →
Also covered in
- Learn Haskell by Example
- Vanilla WebIn early access (MEAP)
- Statistics Slam Dunk
- Data Storytelling with Altair and AI
- Web Design Playground
What to know first
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
- digital imageA digital image is a digital representation of visual content, commonly encoded as an arrangement of pixels or other graphical elements.
- CSSCSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- SVGSVG (Scalable Vector Graphics) is an XML-based standard and markup language for describing scalable two-dimensional vector graphics.
Related concepts
- JPEGalternative to · JPEG is a family of image-compression standards commonly used to encode photographic and other continuous-tone raster images with lossy compression.
- JuicyPixelsused by · JuicyPixels is a Haskell library for decoding, encoding, and manipulating common raster image formats.
- mazeused by · A maze is a spatial puzzle or problem space of connected and obstructed routes in which a path must be found between designated locations.
- RGBA coloruses · An RGBA color is a color representation specifying red, green, blue, and alpha channel values.
Questions about PNG
What is PNG?
PNG (Portable Network Graphics) is a losslessly compressed raster-image format that supports transparency.
Which Manning books explain PNG?
Learn Go with Pocket-Sized Projects and Web Design Playground, Second Edition.
What should I know before learning PNG?
Manning books that teach PNG usually introduce HTML, digital image, CSS and SVG first.
What is the difference between PNG and JPEG?
PNG (Portable Network Graphics) is a losslessly compressed raster-image format that supports transparency. JPEG is a family of image-compression standards commonly used to encode photographic and other continuous-tone raster images with lossy compression.
What is PNG a kind of?
PNG is a kind of file format. A file format is a specification for how information in a digital file is encoded and organized.
What are the parts of PNG?
PNG includes readPNG() function.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

