Free PPM test files and sample generator

A Netpbm 24-bit color image with a plain-text header and raw pixels. Generate valid .ppm sample files for image tooling, converters and pipelines.

Generate a .ppm file →

What is a .ppm file?

PPM: Portable Pixmap Image. PPM is a Netpbm color image: a short plain-text header followed by raw RGB pixels. It exists precisely so that image data can be produced and consumed with almost no code, which makes it the reference format for computer-vision and pipeline testing.

Why generate a test PPM file?

What you can put inside a .ppm file

You get 3 content options for PPM, so the file holds something meaningful rather than random padding: Solid color, Gradient, Checkerboard. For PPM these are alternatives, so choose the one that matches what you need to test.

How a .ppm file is identified

Every .ppm file begins with 50 36, "P6", binary color Netpbm. That is what a validator inspecting content rather than the file name looks for.

How the size lands on the exact byte

Netpbm allows comment lines in the header, so the remainder rides there while the height carries the bulk of the size.

Negative testing with broken PPM files

Which failure to reach for, and what to assert for each, is covered in how to make a corrupted file for testing. For upload limits and type checks see testing file upload validation.

Sample PPM content

[PPM], P6 binary Netpbm: magic, width/height, maxval, raw RGB pixels.

This shows the shape of the file. Your download is generated fresh at the size you choose, so the values will differ.

How to open and verify the file

Open in GIMP, IrfanView or XnView; convert with `pnmtopng` or ImageMagick.

Media type image/x-portable-pixmap · extension .ppm · category Images

Generate a .ppm file → · questions about sizes, privacy or cost are answered on the site FAQ.

Frequently asked questions about PPM files

What identifies a .ppm file?

A .ppm file begins with the bytes 50 36, "P6", binary color Netpbm. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.

How can a .ppm file be an exact number of bytes?

Netpbm allows comment lines in the header, so the remainder rides there while the height carries the bulk of the size.

What can go inside the PPM file?

There are 3 content options for .ppm: Solid color, Gradient, Checkerboard. For PPM these are alternatives, so pick the one matching what you need to test.

Can I download several broken PPM files at once?

Yes, select more than one File Condition and you get one ZIP containing a .ppm per condition, each named after its condition.

Can the PPM file use UTF-16 or a byte-order mark?

No, and deliberately. A .ppm file is a container rather than plain text, so rewriting its bytes as UTF-16 would not produce a UTF-16 document. It would produce a broken file. Use a text format such as CSV, JSON or XML for encoding tests.

How do I open or verify the PPM file?

Open in GIMP, IrfanView or XnView; convert with pnmtopng or ImageMagick.

Related Images formats

JPG · PNG · GIF · SVG · WEBP · BMP · TIFF · ICO

Browse all file formats →