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
Feature request.
Requested on golang-nuts:
https://groups.google.com/d/msg/golang-nuts/rL1ATqYBECU/3UYlNCBgEaUJ
By: Alberto García Hierro:
>> There are many different resizing algorithms and approaches. I would
>> imagine that pure Go image resizing can and should be done by a "go
>> get"table third party library. Not everything has to be in the
>> standard library.
I totally agree, resizing algorithms should be pluggable. However, I think the standard
library should provide a basic framework for them, so users could write only the code
for the interpolation.
e.g.
type Interpolator interface... or type Interpolator func... for better performance
func Resize(im Image, width, height int, inter Interpolator) (Image, error)
Best regards,
Dobrosław Żybort
The text was updated successfully, but these errors were encountered:
Regardless of whether it's an interface or a closure, I doubt that calling it in the
inner loop, per pixel, is going to be efficient. That golang-nuts thread points to a
third party library (nfnt/resize) that is designed very abstractly, with interfaces and
closures, and it seems orders of magnitude slower than it could be.
It's not obvious whether there exists an API design that is all three of clean, easy to
use, and efficient. Until a proposal exists, I'm not keen on committing anything to the
standard library, with its backwards compatibility guarantees.
Besides, I don't see why this has to be in the standard library and not a "go get"table
third party library.
I thought it could be something more like database/sql.
Standard library won't have build in interpolator/resizing algorithm, it will just
provide generic interface that every third party resizing library can follow.
The text was updated successfully, but these errors were encountered: