Fix channel ordering and 0 alpha channel
This commit is contained in:
parent
1b6fcd3cff
commit
d6f81d6aee
1 changed files with 3 additions and 2 deletions
|
|
@ -67,9 +67,10 @@ func (img *IplImage) ToImage() image.Image {
|
||||||
for y := 0; y < img.Height(); y++ {
|
for y := 0; y < img.Height(); y++ {
|
||||||
for x := 0; x < img.Width(); x++ {
|
for x := 0; x < img.Width(); x++ {
|
||||||
s := img.Get2D(x, y).Val()
|
s := img.Get2D(x, y).Val()
|
||||||
b, g, r, a := s[2], s[1], s[0], s[3]
|
|
||||||
|
|
||||||
c := color.NRGBA{uint8(r), uint8(g), uint8(b), uint8(a)}
|
b, g, r := s[0], s[1], s[2]
|
||||||
|
|
||||||
|
c := color.NRGBA{R: uint8(r), G: uint8(g), B: uint8(b), A: uint8(255)}
|
||||||
out.Set(x, y, c)
|
out.Set(x, y, c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue