nfnt / resize

Pure golang image resizing
ISC License
3.02k stars 321 forks source link

Could Resize return draw.Image instead of image.Image? #3

Closed googollee closed 11 years ago

googollee commented 11 years ago

It's convenience that Resize return a draw.Image instead of image.Image that can continue draw in the image.

nfnt commented 11 years ago

While this would be possible at the moment, it may change in the future due to further optimizations, e.g. trying to use an output type that matches the input image -- image.YCbCr does not have a Set method. For now I'd suggest to cast the output image.Image to draw.Image, like drawableImg := resize.Resize(x, y, inputImg, filter).(*draw.Image) though this may not work in future revisions.