All of the code to do scaling and cropping in the ‘image’ package in the stdlib. You ‘draw’ into a new image to do scaling. You use SubImage() to perform cropping. See https://blog.golang.org/image-draw
Alternatively, if you need more advanced scaling operations it would be fairly trivial to port the GIMP scaling operations to Go. > On May 10, 2020, at 1:12 PM, Michael Jones <michael.jo...@gmail.com> wrote: > > I have an extremely elaborate resizing library, but it is so complex it would > not make sense as a standard tool for common uses. (Many convolution kernels, > separate windows, forward and backward mapping, separable convolutions, > upsampling first for Nyquist issues, strategy phase and then concurrent > filtering, etc. good work but over the top) > > If nothing else, you could port Paul Heckbert’s filter program from days of > yore. Check graphics gems. > > On Sun, May 10, 2020 at 9:36 AM Vivi <createmap4...@gmail.com > <mailto:createmap4...@gmail.com>> wrote: > How do you advice to resize and crop JPEG and PNG or probably WebP images > without rely on 3rd parties dependencies? > > It was hard to find a good snippet or could be useful to have basic API > function in Go standard library since it's a common feature. > > -- > 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 > <mailto:golang-nuts+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/89e32097-6aa0-48a4-b2ca-8d3756e26af3%40googlegroups.com > > <https://groups.google.com/d/msgid/golang-nuts/89e32097-6aa0-48a4-b2ca-8d3756e26af3%40googlegroups.com?utm_medium=email&utm_source=footer>. > -- > Michael T. Jones > michael.jo...@gmail.com <mailto:michael.jo...@gmail.com> > > -- > 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 > <mailto:golang-nuts+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/CALoEmQwOxRXsrB0%2B-oeAWB938A%2BOzCRppTQvrKENp9%3D8o3BcYQ%40mail.gmail.com > > <https://groups.google.com/d/msgid/golang-nuts/CALoEmQwOxRXsrB0%2B-oeAWB938A%2BOzCRppTQvrKENp9%3D8o3BcYQ%40mail.gmail.com?utm_medium=email&utm_source=footer>. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/0BA4F6D5-0E95-465F-B32C-4F9602787BE6%40ix.netcom.com.