Is there a way for me to crop an image with Go by giving dimensions and offsets?
I'm thinking of something flexible like this php function: http://php.net/manual/en/function.imagecopyresampled.php
I found this: https://github.com/nfnt/resize But that library does not seem to have an offset option.
I need to be able to crop any area of the original image. Not just scaling down, but also a different positioning of the cropped image.
Any suggestions on how I can achieve this?
I'll answer my own question so that it can be of help to other newcomers of Go.
Reading these two articles helped me greatly to understand how to crop images in Go. No need for third libraries. You decide how to crop an image with points and rectangles which is a very neat way of doing it.
https://github.com/gographics/imagick seems to have what you need : https://godoc.org/github.com/gographics/imagick/imagick#MagickWand.CropImage