Tuesday, October 30, 2012

GIMP Tutorial: Limited color palette for Spoonflower fabric design

This is a learn-as-you-go process, as with most things. I wanted to create an image but needed to restrict it to a certain color palette. I scanned this sketch of a branch. You can see the lines around the image - that's the paper. That's easy to eliminate in Gimp by selecting Color > Threshold. You can slide the threshold which will make the image more or less pixely.

Here are screen shots of a bird that I put through the process:

Keep in mind that I started with a fairly low resolution photograph of my sketch for this tutorial, so the image is a bit pixely. This is the original image.
I applied the Color > Threshold to remove everything except the black lines and white background.
 Then I erased things I didn't want in the image, such as pen marks.
Then I used a black pencil (size 3) to add in a few lines, in this case to close in the image for filling it with color.
Next I did Layer > Transparency > Add Alpha Channel, then I did Colors > Color to Alpha. White was the default, and that's what I wanted to remove so I pressed ok, which removed the white and left me with a transparency of the black lines. Then I did Colors > Map > Color Exchange. Black was in the exchange From Color box, and white was in the To Color box. I clicked the To Color box and the color tool appeared. I selected a mauve-ish color, c33855, which is one of the RGB hex codes in a current Spoonflower challenge. I pressed okay to select that color, and okay to make the change. Then I zoomed into the image (400%) to look over it and see if there were any pixels that hadn't changed. (By the way, I first tried the color exchange without adding the alpha channel, but there were some random black pixels left behind.)

If your 'From Color' is not black, you can drag all the color setting dials to the left which will make it black. If the color you want to exchange is something else, use the color picker (Tools > Color Picker, then click on the part of your image that has the color you want to change from, which will send the color to the 'Foreground' box), then you can find out the RGB hex code (i.e. white is #ffffff). Enter the code into the color box on color exchange to select your color.

Next I started adding color to the bird and the background using the bucket fill, and zoomed in to ensure all the pixels were filled (or most, anyway - there were a few here and there I didn't bother with). I used these codes (#DE8371, #C33855, #D1CC56, #2E486B, #FFFFFF). I filled in the background with blue.
To finish it off, I added a blue layer, merged the layers and removed the alpha channel. Adding the blue layer ensured there would be no pixels that are not in the limited color palette.


Let's face it. I think this coloration borders on hideous. But I made this just for the tutorial to show how to use Gimp to modify an image and stay within a restricted palette.

As for the colored branch image at the top of the post, I noticed some pixel shearing (I just made that up) along the top edge. I could go in and manually smooth it out, but I'll look for an easier way to do it.

No comments:

Post a Comment