You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to read some webp files and creating an alpha composite using Draw method with Over as a parameter (code below).
The output shows glitchy lines where the alpha channel is merged:
This code was used:
package main
import (
"fmt""image""image/draw""image/png""log""os""time"// swap between these two. The glitch is only in this lib//"golang.org/x/image/webp""github.com/chai2010/webp"
)
funcgetTile(pathstring) image.Image {
tileStream, _:=os.Open(path)
tile, _:=webp.Decode(tileStream)
defertileStream.Close()
returntile
}
funcmain() {
tileA:=getTile("a.webp")
tileB:=getTile("b.webp")
canvas:=image.NewRGBA(image.Rect(0, 0, 500, 500))
draw.Draw(canvas, image.Rect(0, 0, tileA.Bounds().Max.X, tileA.Bounds().Max.Y), tileA, image.ZP, draw.Src)
draw.Draw(canvas, image.Rect(0, 75, tileB.Bounds().Max.X, 75+tileB.Bounds().Max.Y), tileB, image.ZP, draw.Over)
outputStream, _:=os.Create("result.png")
png.Encode(outputStream, canvas)
deferoutputStream.Close()
}
Using golang.org/x/image/webp fixes the issue, but it has a couple other problems therefore I can't use it.
Hi.
I'm trying to read some webp files and creating an alpha composite using Draw method with Over as a parameter (code below).
The output shows glitchy lines where the alpha channel is merged:
This code was used:
Using
golang.org/x/image/webp
fixes the issue, but it has a couple other problems therefore I can't use it.The source files are in the following zip:
experiments.zip
The text was updated successfully, but these errors were encountered: