Package bmp implements a BMP image decoder and encoder.
The BMP specification is at http://www.digicamsoft.com/bmp/bmp.html.
Use go get:
go get github.com/sergeymakinen/go-bmp
Then import the package into your own code:
import "github.com/sergeymakinen/go-bmp"
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()
BSD 3-Clause