mopix

package module
v0.0.0-...-aa9d9d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 6 Imported by: 0

README

Mopix

mopix is a lightweight Go library for handling and manipulating PPM (Portable Pixmap) images in the plain-text "P3" format. It provides a clean and modular interface for reading, writing, and transforming images, with support for effects, filters, steganography, drawing, and more.

Features

  • Image I/O: Read and write PPM (P3) images easily.
  • Filters: Grayscale, sepia, invert

Installation

Install mopix using Go modules:

go get github.com/varun0138/mopix

Then import it in your Go files:

import "github.com/varun0138/mopix"

Notes

  • Supports only ASCII (P3) PPM format.
  • All operations are done in memory; suitable for small to medium-sized images.
  • Written in pure Go with standard library only – no external dependencies.
  • Thread-safe operations where applicable.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrayScale

func GrayScale(img *PPMImage)

func InvertColors

func InvertColors(img *PPMImage)

func Sepia

func Sepia(img *PPMImage)

func WritePPMImage

func WritePPMImage(img *PPMImage, path string) error

Types

type PPMImage

type PPMImage struct {
	Format       string
	Width        uint32
	Height       uint32
	ColorChannel uint16
	Data         [][]Pixel
}

func ReadPPMImage

func ReadPPMImage(path string) (*PPMImage, error)

type Pixel

type Pixel struct {
	Red   uint8
	Green uint8
	Blue  uint8
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL