My mother asked me what kind of sweater I would like her to knit for my son. After some thinking I decided I wanted him to have Tux on his sweater. I found a picture of tux, reduced the resolution to how many masks would fit on the sweater and did some manual correction of pixel colours. I also wanted the picture to have a grid and numbered ticks. This is not something the normal print dialog offers to do for you, but it can easily be done in Python using Matplotlib.

Picture of Tux
Picture of Tux
Low resolution picture of Tux
Low resolution picture of Tux

This is how I added the grid and numbered ticks in Python.

import matplotlib.pyplot as plt
import numpy as np

tux = plt.imread('Tux-lowres.png')

plt.figure()
im = plt.imshow(tux, interpolation='none', aspect='equal')
ax = plt.gca();

# Major Ticks
ax.set_xticks(np.arange(0, tux.shape[1], 1))
ax.set_yticks(np.arange(0, tux.shape[0], 1))

# Labels for major ticks
ax.set_xticklabels(np.arange(0, tux.shape[1], 1), rotation = 90)
ax.set_yticklabels(np.arange(0, tux.shape[0], 1))

# Minor ticks
ax.set_xticks(np.arange(-0.5, tux.shape[1], 1), minor=True)
ax.set_yticks(np.arange(-0.5, tux.shape[0], 1), minor=True)

# Gridlines based on minor ticks
ax.grid(which='minor', linestyle='-', linewidth=2)

plt.show()

Low resolution picture of Tux with grid
Low resolution picture of Tux with grid

Unfortunately this is not knittable, since it only a picture on the front and most of the colors are not used as a pattern around the whole sweater, my mother informed me. Which make sense when I think about it. But she could knit a sweater and make the picture using embroidery stitches that looks like knit masks. This is the result.

My happy boy and his friend Tux
My happy boy and his friend Tux

I also have to teach him about all the other helpful and friendly animals and, when he gets older, the dangers of poisonous fruits and broken windows.