Introduction to images in Go

Posted at — Oct 1, 2013

This series of posts is meant as an introduction to Go, by way of a bit of simple graphics processing. If you haven’t come across Go before, I’d encourage you to head over to to check it out, in particular going through the excellent online tutorial. At the very least you should be familiar with how to run a simple Go program, see here for details.


Here are some of the things we’ll be making… Montage


The posts are meant to be read in order, although if you have an understanding of Go you should be able to jump in at any point.

Running the code

First make sure you can run the example code here. Then to run an example use go run:

go run blank.go

Please note that if an example has dependencies in other files, and most do: depending on canvas.go and vector.go, you will need to pass these dependencies to go run:

go run lines.go canvas.go vector.go

Currently it is not possible to use go build or go install as this leads to errors, due to multiple files defining the main() function. This will be fixed in the future, for now please use go run.


If there’s any post/topic that you’d like to see, please leave a comment below.