Documentation
¶
Overview ¶
Package bmp implements a BMP image decoder and encoder.
The BMP specification is at http://www.digicamsoft.com/bmp/bmp.html.
Example ¶
package main
import (
"image/color"
"image/draw"
"os"
"github.com/sergeymakinen/go-bmp"
)
func main() {
f, _ := os.Open("file.bmp")
img, _ := bmp.Decode(f)
for i := 10; i < 20; i++ {
img.(draw.Image).Set(i, i, color.NRGBA{
R: 255,
G: 0,
B: 0,
A: 255,
})
}
f.Truncate(0)
bmp.Encode(f, img)
f.Close()
}
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeConfig ¶
DecodeConfig returns the color model and dimensions of a BMP image without decoding the entire image.
Types ¶
type FormatError ¶
type FormatError string
FormatError reports that the input is not a valid BMP.
func (FormatError) Error ¶
func (e FormatError) Error() string
type UnsupportedError ¶
type UnsupportedError string
UnsupportedError reports that the input uses a valid but unimplemented BMP feature.
func (UnsupportedError) Error ¶
func (e UnsupportedError) Error() string