From videogame to pattern

As you've probably heard thousands of times, images on a computer screen are made of small coloured points called pixels; while modern computers are able to show millions of such pixels, in billions possible colours, earlier computers were limited to a few thousand pixels in 256 or even less colours: doesn't that sound "counted thread embroidery pattern"?

Not every game can give a working pattern, and most of them will require some manipulation. Unlike embroidery, in pixel art there is no problem in having lots of sigle pixels all in different colours, and this is used expecially in two tecniques: antialiasing and dithering. The former is used to give a better illusion of smooth lines, and uses pixels of intermediate colours on the boundaries; the latter is used to give the illusion of having a third colour available by alternating pixels of two colours. In embroidery these tecniques add technical difficulties, and probably won't even work, because of the higher "pixel" size, so, if possible, they should be removed or minimized.

A note on copyright: what we're doing here is basically taking somebody's copyrighted artwork and converting it to a different format, trying to make it look similar to the original. This is not "taking inspiration" or the like, this is definitely a derived work under copyright law, and thus something you need an autorization from the author for. Making an embroidered work for one's own use, using an original copy of a game, may be fair use (or it may not, ask your lawyer), but distributing the pattern or the work in any way, expecially if money changes hands, is a definite no-no, even for charity, even if the payment is for work and materials. In this tutorial I'm using graphics from the Battle for Wesnoth game which is free, under the GNU GPL, which allows such derived works; this means, by the way, that the patterns and intermediate working images on this page are also under the GPL, as required by that license.

Tools

To follow this tecnique, you'll need an image manipulation program: this tutorial uses The GIMP, which is an excellent one for most needs, available for free from the website (as it is Free Software) for various platforms including windows, linux and macosx. If you are used to some other program like photoshop, paint shop pro or the like, you'll probably be able to adapt the tecnique, as it uses mostly basic operations.

You may also need something to get screenshots from the games: I've used KSnapshot for KDE (under linux); under windows hitting the Print key and pasting in your graphical program may work.

Of course, you'll also need the game from which you want to take the pattern.

Getting the image

screenshot

The first step is to get an image to work on: find an image that you like and take a screenshot. Here I've used the KSnapshot program for KDE under Linux; any other similar program will do, as will hitting stamp under windows, and paste the result in a new image in GIMP.

If you're using an emulator, or your game otherwise allows it, make sure that you're not using any scaling, but are using the original resolution. Probably, this means that the game will be too small to be played on a modern screen, but it will be better for our needs. You may also have other options that may help getting a cleaner screenshot: in our sample, I've deselected the "Show Grid" option in the Wesnoth preferences, to remove some unwanted line.

exult settings with Scaling: x1

Now, open the screenshot in the GIMP and, using the eraser with an hard edge and the crop tool remove any extraneous part, keeping only what you want to remain in your pattern. If you are going to keep something not in a rectangular shape, you'll want to add a white background layer, for ease of editing.

For the second sample, the single character, I've cheated and used an image straight from the game directory: expecially with FOSS games there are quite some chances that gfx is available in an usable format, such as the png's of Wesnoth.

You'll have an image whose pixel size hopefully fits with your embroidery needs, so we'll have to consider the colours. First of all, select Colourcube Analysis... from the Layer -> Colours menu to get informations on the number of colours used in the image (take care to select the image layer, and not the background one). If the Number of unique colours is already something sensible, fine, you can use this image for the pattern, otherwise you'll have to reduce it.

colourcube dialog in GIMP

Colour reduction

Automatized color reduction

indexing dialog in GIMP

Save a copy of the image, as a backup if something goes wrong, then select Indexed... from the Image -> Mode menu; choose Generate optimum palette and Colour dithering: None, then experiment with the maximum number of colours until you get something that works.

If the image was simple enough, you now have something very close to your desidered pattern, with one pixel - one point; put the file back in RGB mode (Image -> Mode -> RGB) and proceed to the last step. If, instead, you can't seem to get workable results, no matter the number of colours, you'll have to proceed by hand.

the image in 6 colours

Manual color reduction

If the above method does not work, you can still draw the pattern yourself, using the original image as a guide.

gimp windows while drawing the new pattern
hand drawn pattern

Create a new transparent layer above everything else; lower the opacity of the original image to something like 50-60%; keep the image at 800% magnification, but open a new view (View -> New View) at 100-200% for reference. Then, with a small pencil and eraser (remember to check the Hard edge option) draw your pattern in as few colours as you like.

Getting a pattern

Image pattern

The scaling dialog in GIMP

To get an usable pattern, take the 1 pixel - 1 point image you've obtained from either method, flatten it with Image -> Flatten Image, then select Image -> Scale Image and scale it up by an integer number, at least 10, and Interpolation: None.

You'll get an image with big coloured squares for each stitch; now we'll add a grid. From Image -> Canvas Size... enlarge your image by 1 pixel in both Width and Height, with 0 offsets; add a new transparent layer, with the size of the new canvas, then select Filters -> Render -> Pattern -> Grid...: select a width of 1 pixel, spacing of whatever number you've scaled up the image and a colour different from any other colour in the image, then hit OK.

the canvas dialog in GIMP
The Grid dialog in GIMP
new layer dialog in GIMP

Save the image in a lossless format such as PNG, print it and use as desidered.

mage embroidery pattern

Other pattern formats

The Gimp offers other formats that can be useful as a pattern.

the Scale Image dialog

To get a text pattern, where each letter is a stitch, enlarge the image by exactly 2 (Image -> Scale Image... and enter 2 percent as the new Width and Lenght, with Interpolation: None), then File -> Save a copy... and select ASCII art as the File Type, then Text file as the format. This is what the result will look like.

Another option can give an html table with 1 cell for each stitch, by selecting HTML table as the File Type, with no need for enlargement. Again, this is a sample reslt.

Last update: 2007-01-07 22:06 +0100

This page by Elena of Valhalla