This commit is contained in:
Norwin Roosen 2020-02-04 13:41:59 +01:00
parent 26a4d1a6aa
commit ccba493de1
1 changed files with 2 additions and 2 deletions

View File

@ -110,9 +110,9 @@ func genCommands(img image.Image, offset_x, offset_y int) (commands [][]byte) {
for x := 0; x < max_x; x++ { for x := 0; x < max_x; x++ {
for y := 0; y < max_y; y++ { for y := 0; y < max_y; y++ {
// ensure we're working with RGBA colors (non-alpha-pre-multiplied) // ensure we're working with RGBA colors (non-alpha-pre-multiplied)
c := color.NRGBAModel.Convert(img.At(x, y)).(color.NRGBA) c := color.NRGBAModel.Convert(img.At(x, y)).(color.NRGBA)
// ignore transparent pixels // ignore transparent pixels
if c.A != 0 { if c.A != 0 {
cmd := fmt.Sprintf("PX %d %d %.2x%.2x%.2x\n", cmd := fmt.Sprintf("PX %d %d %.2x%.2x%.2x\n",
x+offset_x, y+offset_y, c.R, c.G, c.B) x+offset_x, y+offset_y, c.R, c.G, c.B)