Monday, June 17, 2013

Making vector like smooth gradients in GIMP

I always wanted to know how graphics like angry birds, CutTheRope etc are made then i came to know about Inkscape, vector arts. But i want to master few software instead of learning 100s. So i wanted to achieve the same in GIMP.

Except shape editing i find GIMP robust for most of my needs, so i surrendered using Inkscape. I use Inkscape for making shapes mostly. Now GIMP does all my job :).

I have written a simple short tutorial to do smooth gradients often found in vector graphics. This tutorial will give you some simple but powerful tips how to choose colors and opacity to play with smooth color gradients.


Below is the download link of the tutorial in PDF format for offline use:
GIMP_smooth_vector_like_gradients.pdf.7z

Or online version below:


Requirements:
  1. GIMP 2.8 is recommended, otherwise 2.6 if 2.8 is not available.
  2. Some basic knowledge of PC and graphics terms like alpha, hue, saturation etc
  3. Basic usage of GIMP or other app with layers.

The only tools and settings we will use most:
  1. Airbrush tool, opacity & size of brush.
  2. HSV instead of RGB colors,


Steps:
  1. Create new project 640x480 or above resolution with transparent background.
  2. Fill background with dark green color. [ HSV = 124, 99, 63 ]
  3. Select Airbrush tool with size = 20, opacity = 100, same above green foreground color.
  4. Select brush blurred circle, size = 51x51, Hardness 075.
  5. Create new layer and click it to make active work layer.


Things to note:
We have the same green color which will not produce any effect on the background color then why we picked it?

Because we want to use HSV which allows us great color match & closer difference in surrounding colors using Saturation & Value (lightness).

Notations:
H = Hue, S = Saturation, V = Value (lightness), O= Opacity, Sz = Size,

Back to steps:
  1. Now click the FG color box to change the color of our brush.

  2. Look at the color formats available: H, S, V, R, G, B. We will always use HSV not RGB because altering RGB values changes colors undesired way.
  3. Now we can move V slider to change darkness/lightness of a color and S slider to change the color strength. H values for choosing different colors.
  4. We will select V = 40.
  5. Now draw an irregular line (L1) in the blank layer. Now set V = 30.
  6. Use “Fuzzy select tool” and select that irregular line. Click “Menu -> Select -> To Path”.
  7. Go to path tab near layers tab (dockable layers dialog), enable it with eye button at left. Switch to Layers tab and select path tool.
  8. Select the path and move it to above-right of the last selected irregular line. Use Move(alt) option in path tool to move path. Click selection from path. Hide path again.
  9. Now fill this selection with the airbrush. V = 40, O = 50, Sz = 30. The Mouse pointer should be over the top-right border of the selection so that middle of the selection fills lighter green color. Unselect all to remove selection. Now the lines should look like a walking path (L2).













  1. Now change Brush, V = 75, Sz = 50, O = 100. Draw below L1. Will give output like this -




 
  1. Using this method we can make a smooth color gradient just like we get in vector art apps like inkscape. But GIMP gives us much more powerful control.
  2. Below is final output of what i made while writing this tutorial using some objects i made separately. Viz -




















 
The water like thing at bottom of image was just made using MODE of layer color combination not any pen or brush.

You can try it: Make new layer above your green layer, make figures or anything, from mode select saturation, value, dodge etc whichever looks cool to you.

All these gfx were made using the method i described above. You have to play with V, S, O, Sz and brushes, Use Opacity to get lighter color instead of changing V every time.

There are lots of techniques to play with but one good trick of making quick graphics is to make bigger gfx using airbrush tool and downscale it then use pixel editing if desired.


Lets make a simple grass:
  1. Create a new project 640x480 with transparent background.
  2. Now create a grass like shape with closed boundaries so that we can fill it with green color.
  3. Now select the grass shape with Fuzzy select tool and click Menu => Select => Save to channel (keep important selections saved into channels). Get back to the layers tab and create a new layer. Keep selection active!

NOTE:
Always try to keep outlines in separate layer to keep it unaltered and pick selections from them and work on new layers. It means select something in a layer using selection tools and create new layers and do editing on them. This is important so that any editing we do shouldn't spread outside of the boundaries ( the outline ) of our target object and our outlines remain available as it is.

  1. Now fill this new layer with green color with your choice of SV values .
  2. Now select Airbrush tool, choose a darker value and apply shade on left of the grass.
  3. It is important that you shade color in gradient way, means left to right => dark to light. To achieve this try not to change V, just reduce opacity to draw less darker towards right.
  4. The above shade means grass has some light source at right side. Without shading grass will be plain single color filled paint. Can you image what shade objects have at night/dark? Of course nothing but black, That is why keep smarter shading assuming all light sources including the color mixing due to nearby objects. Suppose a blue orb a left, then apply little blue reflective shading at left to produce more realistic output.

NOTE:
Lots of paintings fail due to bad shading, we should never apply anything without planning. While working always think this in such cases, why i am doing this? Even a single pixel can produce bad shade if added randomly.


  1. Now select higher V, means lighter green and apply to right side of grass. Just as done above. Below are the snap of all steps done yet -





















  1. Now select white, but!, in HSV white means V=100, S=0. Apply some white shade randomly where we assume direct light reflection. Adjust opacity to keep white level as per requirements.
  2. Remove the black outline and your grass is ready.

This result may or may not be up to your expectations. But the shading methods mentioned above will result in your desired one depending upon efforts made.























Impact of nearby objects:
Colors mix together, here Blue + Green = Cyan, therefore to let shading take practical color create new layer and apply shading with the object (blue here). The layout is blue shade layer above and the target object is below (grass here). Click blue shade layer and select MODE to “Addition”. This will add blue with the bottom layer i.e. green to automaticaly produce cyan.








TIP:Always reuse your work if possible. Using color, size variations of images.
- GIMP rocks :) -




GIMP TIP:
To master GIMP one has to become a player in Selection, selection modifications, path, and color selection. Above tutorial has a little demo of this all. Lots of things are there depending upon your needs. But instead of depending too much on filters try to make things yourself otherwise you probably will loose mastering art!

Sunday, June 16, 2013

Using GIMP for learning and working with Pixel-Art

I have been using gimp for pixel-art and it works great with almost everything i needed for pixel-art. Even more than that!

I have written a tutorial how gimp can be used for pixel-art with some techniques to enhance pixel-art work.

Please download the tutorial in PDF format for offline use:

GIMP_for_pixel_art.pdf.7z


Or online version below:




Setup GIMP for pixelart work
  1. Start GIMP ( v2.8 recommended )
  2. Create new project 32x32 with background transparent.
  3. Zoom-in till the working canvas gets screen-fit size.
  4. Select pencil tool with black foreground color (default).
  5. Choose any brush which doesn't has blur. Simply select the black circle without blur.
  6. Now set brush size to 1 pixel in GIMP 2.8 OR minimum scale in GIMP 2.6.


Now the above steps have made a pixel art environment in GIMP.

Setup color palettes
  1. Go to any of your favorite TAB ( layers tab at right is recommended ) and click [<| ] button which shows tooltip “configure this tab”. See following image:









  1. Click -> Add Tab -> Palettes. Same way add FG/BG color


TIPS:
  1. Always work in Greyscale using Greys (32) palette. Click this palette then switch to FG/BG Tab pane. You will get black to white color in order.
  2. Why greyscale only? Its because realism doesn't reside in colors but number of colors. Doesn't a black & White image look real? It does. Therefore work in greyscale without caring colors just focus on shading and dithering then after completion give colors using fills or “select by color tool”.
  3. Instead of selecting darker OR lighter color from color chooser just change the Opacity of the selected color. E.g. Use black color over lighter backgrounds with varying opacity to get desired black/grey color.
  4. Another fast way of getting similar colors to image is to pick colors from the image itself using “color picker tool”.
  5. To get dispersed pixel like spray set “Apply Jitter” checked with desired value.


How to get pixelart samples?
This can be done easily using GIMP. Following steps will let you get loads of pixelarts from images/wallpapers we have.

  1. Import/Open any camera picture in GIMP.
  2. Resize to acceptable size so that image becomes pixelated but clearly recognisable.
  3. Now click in menu Image => Mode => Indexed => Generate Optimum palette with maximum 256 colors.
  4. This will reduce total colors used by the image. This can make image low-colored but this is exactly what we wanted. Because most of pixelart is done with 256 colors only.
  5. Now look at the parts of image how the pixels are organised :)











NOTE:
Indexed image will not offer flexible alpha values, only visible OR invisible pixel are there. To edit indexed image convert it back into RGB format.


Few pixarts i made in GIMP :