It's also nice to work with existing images in Julia. The snippet of code at the link below downloads an image, reads it to memory, cuts an 8x8 square of colour pixels out of the image, expands the image as above and saves to file. Output attached.
gist.github.com/CnrLwlss/5a1...