Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lmittmann/ppm

Package ppm implements a Portable Pixel Map (PPM) image decoder and encoder written in Go.
https://github.com/lmittmann/ppm

go golang image ppm

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# Package ppm [![PkgGoDev](https://pkg.go.dev/badge/github.com/lmittmann/ppm)](https://pkg.go.dev/github.com/lmittmann/ppm) [![Go Report Card](https://goreportcard.com/badge/github.com/lmittmann/ppm)](https://goreportcard.com/report/github.com/lmittmann/ppm)

```
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](https://pkg.go.dev/image/color#RGBAModel).

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

## func [Decode](reader.go#L28)


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](reader.go#L39)


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](writer.go#L15)


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

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