2018-11-04 New Faces for the Face Generator

Here’s how to create a new collection for the face generator.

First, print some templates.

Second, get a pen and start drawing a sheet of eyes, of eyebrows, of noses, of mouths, of ears, of hair, of chins.

Drawing face elements

Scan them. I use Gimp and there the *File* → *Create* → *XSane* → *Device dialog...* menu opens the scanner application. There, I pick Gray and 300 DPI. Then I scan all the stuff I drew.

Scanning

Next, in Gimp, the processing begins. The first problem is that either the printer or the scanner don’t really get straight lines.

I like to work at 50% zoom...

Use the rotate tool to rotate the image until it looks as straight as possible (shortcut Shift+R). Move the window edges around until you have the opportunity to check whether the lines are in fact straight. In the screenshot below I’m looking at the left edge to verify that the rotation is good.

Rotating the template

Use the crop tool to cut off anything outside the template (shortcut Shift+C).

Got to *Image* → *Scale Image...*. Scale it to 2250×3000, breaking the link between width and height.

Got to *Colors* → *Levels*. In the top bar, move the tiny white triangle to the left until the template is no longer visible in the image. Click the black pipette and then click onto a line that you have drawn such that all your lines are now pitch black.

Using levels to clean up the image

Export your image (shortcut Ctrl+Shift+E).

Cut the image into elements using cutter.pl. It cuts the scan into 5 × 5 images of 450 × 600 pixels each and labels them by row. You’d invoke it as follows: `perl helpers/cutter.pl source1.png alex eyes_all nose_all mouth_all hair_all chin_all` or `perl helpers/cutter.pl source2.png alex eyes_all nose_all mouth_all hair_all ears_all`.

cutter.pl

In other words: First is the source image, then the artist name, and then you provide the element for every row. If the remaining rows are all the same element, you don’t need to repeat it. Thus, if you’ve drawn a sheet full of eyes, just use `perl helpers/cutter.pl source4.png alex eyes_all` and you’re good. Make sure you use `_all` in the filename. That’s how the system knows the face element can be used for all types of faces.

In my case:

perl helpers/cutter.pl alex3-chin-man-2.png alex3 chin_man
perl helpers/cutter.pl alex3-ears-2.png alex3 ears_all
perl helpers/cutter.pl alex3-eyebrows-2.png alex3 face_all
perl helpers/cutter.pl alex3-eyes-2.png alex3 eyes_all
perl helpers/cutter.pl alex3-hair-2.png alex3 hair_man
perl helpers/cutter.pl alex3-mouths-2.png alex3 mouth_all
perl helpers/cutter.pl alex3-noses-2.png alex3 nose_all

And then to write a license file, the README, we should be ready to go, more or less. Let’s see...

Generated Faces

Generated Faces

Check it out!

​#RPG ​#Face Generator ​#Old School ​#Indie

Comments

(Please contact me if you want to remove your comment.)

Todo:

1. Cleanup images that have some transparency left in them

2. Draw more!

– Alex Schroeder 2018-11-04 15:59 UTC