Re: [go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread Jonathan Wills
jpeg does not support transparency. On Tue, Nov 8, 2016 at 12:14 PM, wrote: > 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(

Re: [go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread Nigel Tao
On Wed, Nov 9, 2016 at 4:14 AM, wrote: > 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.Bou

Re: [go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread Jordan Stinson
Sorry, this site: https://www.socketloop.com/tutorials/golang-convert-png-transparent-background-image-to-jpg-or-jpeg-image On Tue, Nov 8, 2016 at 3:24 PM, Jordan Stinson wrote: > I realize that there isn't an alpha channel. My understanding is that the > image/draw package would blend the colou

Re: [go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread Jordan Stinson
I realize that there isn't an alpha channel. My understanding is that the image/draw package would blend the colours according to the alpha value in the image and the blending equation. This site seems to suggest that it will work. On Tue, Nov 8, 2016 at 2:37 PM, Jonathan Wills wrote: > jpeg do

[go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread jordan . stinson83
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.Poin