PNG to JSON

Puts an image into JSON, as base64, a dot matrix or file details.

Drop a PNG here or click to choose

Open a PNG file or drag it into the box, then choose what goes into the JSON.

Image as base64

The whole file is written as letters into the data field, along with the name, dimensions, and size. This is how an image goes into a config, a test, or an API response. The bytes stay the same: it is the same PNG in a different notation, and it weighs about a third more than the original.

Pixel matrix

Each row of the image becomes a row of the array, and each pixel becomes a color. A color is written as four RGBA numbers, three RGB numbers, a string like #ff0080, or a single integer. This works for editing pixel art, icons, and LED matrices. A large photo has millions of pixels, so the JSON would be unmanageable — use base64 for that.

File details

Dimensions, color depth, color type, palette, pixel density, modification time, and the list of chunks the file consists of, each marked with whether its checksum matched. Text labels land here too: editors write them, and they can hold an author name or a program name.

Rate this tool

Help us get better

Other tools