lmittmann / ppm

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

Home Page:https://pkg.go.dev/github.com/lmittmann/ppm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

func Decode(r io.Reader) (image.Image, error)

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

func DecodeConfig(r io.Reader) (image.Config, error)

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

func Encode

func Encode(w io.Writer, img image.Image) error

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

About

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

https://pkg.go.dev/github.com/lmittmann/ppm

License:MIT License


Languages

Language:Go 100.0%