Categorygithub.com/jsummers/gobmp
modulepackage
0.0.0-20230614200233-a9de23ed2e25
Repository: https://github.com/jsummers/gobmp.git
Documentation: pkg.go.dev

# README

gobmp

A Go package for reading and writing BMP image files.

Installation

To download and install, at a command prompt type:

go get github.com/jsummers/gobmp

Documentation

Gobmp is designed to work the same as Go's standard image modules. Importing it will automatically cause the image.Decode function to support reading BMP files.

The documentation may be read online at GoDoc.

Or, after installing, type:

godoc github.com/jsummers/gobmp | more

Status

The decoder supports almost all types of BMP images.

By default, the encoder will write a 24-bit RGB image, or a 1-, 4-, or 8-bit paletted image. Support for 32-bit RGBA images can optionally be enabled. Writing compressed images is not supported.

License

Gobmp is distributed under an MIT-style license. Refer to the COPYING.txt file.

Copyright © 2012-2015 Jason Summers <[email protected]>

# Functions

Decode reads a BMP image from r and returns it as an image.Image.
DecodeConfig returns the color model and dimensions of the BMP image without decoding the entire image.
Encode writes the Image m to w in BMP format.
EncodeWithOptions writes the Image m to w in BMP format, using the options recorded in opts.

# Structs

EncoderOptions stores options that can be passed to EncodeWithOptions().

# Type aliases

A FormatError reports that the input is not a valid BMP file.
An UnsupportedError reports that the input uses a valid but unimplemented BMP feature.