SkillAgentSearch skills...

Ppm

Package ppm implements a Portable Pixel Map (PPM) image decoder and encoder written in Go.

Install / Use

/learn @lmittmann/Ppm
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Package ppm PkgGoDev Go Report Card

import "github.com/lmittmann/ppm"

Package ppm implements a Portable Pixel Map (PPM) image decoder and encoder. The supported image color model is color.RGBAModel.

The PPM specification is at http://netpbm.sourceforge.net/doc/ppm.html.

func Decode

<pre> func Decode(r <a href="https://pkg.go.dev/io">io</a>.<a href="https://pkg.go.dev/io#Reader">Reader</a>) (<a href="https://pkg.go.dev/image">image</a>.<a href="https://pkg.go.dev/image#Image">Image</a>, <a href="https://pkg.go.dev/builtin#error">error</a>) </pre>

Decode reads a PPM image from Reader r and returns it as an image.Image.

func DecodeConfig

<pre> func DecodeConfig(r <a href="https://pkg.go.dev/io">io</a>.<a href="https://pkg.go.dev/io#Reader">Reader</a>) (<a href="https://pkg.go.dev/image">image</a>.<a href="https://pkg.go.dev/image#Config">Config</a>, <a href="https://pkg.go.dev/builtin#error">error</a>) </pre>

DecodeConfig returns the color model and dimensions of a PPM image without decoding the entire image.

func Encode

<pre> func Encode(w <a href="https://pkg.go.dev/io">io</a>.<a href="https://pkg.go.dev/io#Writer">Writer</a>, img <a href="https://pkg.go.dev/image">image</a>.<a href="https://pkg.go.dev/image#Image">Image</a>) <a href="https://pkg.go.dev/builtin#error">error</a> </pre>

Encode writes the Image img to Writer w in PPM format.

View on GitHub
GitHub Stars22
CategoryDevelopment
Updated7mo ago
Forks3

Languages

Go

Security Score

87/100

Audited on Aug 16, 2025

No findings