Golang Project Structure

Tips and tricks for writing and structuring Go code

drawing

Tag

How to Pixelate Images in Go

When an image is pixelated, it has a visual effect applied to reduce its level of detail through the use of many same-sized blocks, each painted with a single colour. Each of those blocks can be thought of as a large pixel (since a pixel is the smallest unit that can contain a colour in […]

Ways to Work Out the Average Colour of an Image

It’s reasonable to look at a picture and to wonder how it might look if it were distilled down into a single colour, which somehow still encapsulates a sense of the original. In this post, we will look at various methods that can be used to calculate the average colour of an image in Go, […]

Creating Cool Games With Ebiten

The Ebiten game framework was written by Japanese software engineer Hajime Hoshi. The framework is designed to make it easier for Go programmers to create native-looking 2D games, by taking care of all the boilerplate code for us. (Note that since I first wrote this post, Ebiten has been renamed to Ebitengine.) Installing the Ebiten […]

256 Shades of Grey: Converting Colour Images to Greyscale

A beautiful rainbow in a rural landscape.

In this post, I am going to show you how to transform a full-colour image into one made up entirely of different shades of grey. The sort of image that we will create is called greyscale, because every colour that makes up the image is stored as a position on a predetermined scale of greys […]

Drawing an Awesome Chessboard in Go

Since chess is one of the oldest games in the world, the black-and-white chessboard is an instantly recognizable design. It originated in Asia around 1,500 years ago. In this post, we’ll create an image of a chessboard in the Go programming language. But we’ll gradually think through the problems involved before we actually draw it. […]