nfnt / resize

Pure golang image resizing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

googollee opened this issue · comments

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

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.