rm2kpng

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: MIT Imports: 7 Imported by: 0

README

Rm2k PNG

Actions Status

Rm2k PNG is a library that converts any PNG file to an 8-bit RPG Maker 2000 / 2003 compatible PNG if less than 256 colors are used.

This library was created so that I could build the rm2kfixwatcher tool, which allows users to work in paint tools they're comfortable in without needing to think about managing their palette manually (until they exceed the max 256 colors that is!).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertPNGToRm2kPNG

func ConvertPNGToRm2kPNG(srcFile io.Reader) (*image.Paletted, error)

ConvertPNGToRm2kPNG will losslessly convert any PNG file

If the PNG provided is already an 8-bit PNG that uses 256 colors or less in its palette, then return an error

Types

type ErrRm2kCompatiblePNG

type ErrRm2kCompatiblePNG struct {
	// contains filtered or unexported fields
}

ErrRm2kCompatiblePNG is an error that occurs if you're trying to convert an already converted image

func (ErrRm2kCompatiblePNG) Error

func (err ErrRm2kCompatiblePNG) Error() string

func (ErrRm2kCompatiblePNG) PaletteLen

func (err ErrRm2kCompatiblePNG) PaletteLen() int

PaletteLen is the size of the palette of the image you tried to convert

type ErrRm2kDecode

type ErrRm2kDecode struct {
	// contains filtered or unexported fields
}

ErrRm2kDecode is an error that occurs if the image given fails to be decoded. This can occur if the file is corrupted or still being written to.

func (ErrRm2kDecode) Error

func (err ErrRm2kDecode) Error() string

type ErrRm2kPaletteTooBig added in v1.0.1

type ErrRm2kPaletteTooBig struct {
	// contains filtered or unexported fields
}

ErrRm2kPaletteTooBig is an error that occurs if the image given exceeds 256 colors. This can occur if the file cannot be converted.

func (ErrRm2kPaletteTooBig) Error added in v1.0.1

func (err ErrRm2kPaletteTooBig) Error() string

func (ErrRm2kPaletteTooBig) PaletteLen added in v1.0.1

func (err ErrRm2kPaletteTooBig) PaletteLen() int

PaletteLen is the size of the palette of the image you tried to convert

Jump to

Keyboard shortcuts

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