Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "bytes"
- "io/ioutil"
- "fmt"
- "image/color"
- "image/png"
- )
- import "github.com/harrydb/go/img/grayscale"
- func main() {
- FName_BG := "test.background.png";
- data_BG, _ := ioutil.ReadFile(FName_BG)
- img_BG, _ := png.Decode(bytes.NewReader(data_BG))
- grayImg_BG := grayscale.Convert(img_BG, grayscale.ToGrayLuminance)
- MaxRowSize, MaxColSize := img_BG.Bounds().Max.Y, img_BG.Bounds().Max.X;
- for y := 0; y < MaxRowSize; y++ {
- for x := 0; x < MaxColSize; x++ {
- c1_bg := grayImg_BG.At(x,y).(color.Gray);
- fmt.Println(c1_bg)
- }
- }
- }
- {255}
- {255}
- {255}
- {255}
- type Gray struct {
- Y uint8
- }
- fmt.Println(c.Y)
Add Comment
Please, Sign In to add comment