An example of downloading and combining images in Go.
- Downloads two images of unknown filetype and size.
- Resizes them to the same height.
- Combines them into a single image.
- Saves them as a PNG.
- Combine more than two images.
- Error handling.
- Concurrency.
After installing Go and setting up your GOPATH, clone this repository and install the dependencies:
$ go get github.com/nfnt/resize
Now you are ready to run the example with go run example.go
- net/http to download images.
- resize for resizing.
- image/draw for combining images. You can learn more about how that works here.
- image, image/jpeg, image/png and image/gif for image import and export.