Docs

Bitmap.parsePPM

Creates a Bitmap from a PPM (Portable Pixmap) format string.

Syntax

Bitmap.parsePPM(s)

Parameters

Return value

A new Bitmap object containing the parsed image.

Example

let ppm = `P3
2 2
255
255 0 0 255 0 0
255 0 0 255 0 0`
let bitmap = Bitmap.parsePPM(ppm)
bitmap


Notes

Supports P3 (ASCII) PPM format only.