Hi,

I'm trying to write out a png with an alpha component as a jpeg. As I 
understand it, I should be able to use the draw package to do this.

        // src is an image.RGBA
        newImg := image.NewRGBA(src.Bounds())

draw.Draw(newImg, newImg.Bounds(), &image.Uniform{color.White}, 
image.Point{}, draw.Src)
draw.Draw(newImg, newImg.Bounds(), src, src.Bounds().Min, draw.Over)

return jpeg.Encode(w, newImg, &jpeg.Options{Quality: 85})

I expected this blend the src rgb components with the white background 
using the alpha value. It appears to be ignoring the alpha value all 
together. Is this expected? I'm using go1.7.1.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to