Gimp - a change of weather

From LXF Wiki

Table of contents

IMAGE MANIPULATION
Gimp: a change of weather

Sometimes we all need a little vacation, writes Michael J Hammel. With all you’ve learned about Gimp, you can design an advert to show everyone just how to get there.

WHICH VERSION?
This tutorial (and all tutorials in this column from this issue forward) will focus on using Gimp 2.0 or later. The same processes will work for Gimp 1.2, but there are new blend modes in version 2.0 that make this project easier.

Companies use advertising to convince consumers that a particular product is something they can use. Most advertising is graphics-intensive – a picture is worth a thousand words. But sometimes a picture by itself isn’t enough.

This month’s tutorial will show you how to make an advert for a credit card issued by a fictional financial institution. The financial institution wants consumers to use the card for things besides gas and groceries. They want consumers to use the card for big-ticket purchases – like holidays.

Our idea is to show the credit card – bearing a suitably aspirational tropical island image – over a backdrop of a gloomy, rainy night. We’ll add a tag line that says ‘Looking for a change of weather?’ to complete the picture.

With the exception of the tropical island image, this entire project can be done using Gimp tools. The credit card, clouds, rain and even lightning can all be produced in Gimp. It’s just a matter of knowing the right tricks.

We’re going to start with a tropical island image taken from an old Corel stock photo CD. The nice thing about pictures of tropical islands and other natural features is that they hardly ever show their age.

Creating the card

Open the image, which you’ll need to scale down to 640x480. Drag guides from the rulers to outline the area of the image that you think looks best – in this case the island is placed right of centre, leaving room for where we’ll add raised lettering later.

Make a rectangular selection using the guides and then grow the selection (Select > Grow) by 6 pixels (see Fig 1). This causes the corners of the selection to become rounded, just like a credit card. Invert this selection, and add an alpha channel to the image (Layer > Transparency > Add Alpha Channel). Type Ctrl+X to remove the excess portions of the image. This is the basic credit card shape, with the tropical island image. Turn off the guides (View > Show Guides).

Turn on the Keep Transparency toggle for this layer in the Layers dialog (Fig 2). Draw a rectangular selection around the bottom quarter of the card and fill the selection with white. You can do this by dragging the foreground colour over from the toolbox or using the Bucket Fill tool.

Choose the Text tool from the toolbox and click in the image window. Type in the name of the financial institution, then open the Text Options dialog to select an appropriate font, size and colour. Then move the text layer to align it within the white area at the bottom of the card – vertically centred and right aligned should look good. Add a drop shadow to the text, offset by 1 both horizontally (X) and vertically (Y) with a 3-pixel radius blur and opacity set to 90%.

Next we add raised lettering to the card (Fig 3). Click on the original image layer to make it active, then click on the Text tool in the toolbox. Select an appropriate font – we used a font called Magnetic Card Two Bold – and type in an imaginary name. Make the font white and about 22 pixels in height then move the text over the left middle part of the card.

The effect we’re going to create will see the text take on the approximate colour of the background, so to make sure it’s easy to read it will help if it goes on an area of fairly even colour. Add a drop shadow (Script-Fu > Shadows > Drop Shadow), offset by 1 pixel X and Y, with a radius of 2 pixels and an opacity of 85%. Duplicate the text layer, then increase the layer boundary (Layer > Layer Boundary Size) by about 30 pixels in width and height.

Gaussian blur (Filters > Blur > Gaussian Blur RLE) the duplicate layer by 10 pixels. Click on the original name layer, and bump map the original layer using the blurred layer as the map (Filters > Map > Bump Map). Delete the blurred layer, set the layer blend mode to Grain Merge, and create a selection of the text with Alpha highlighted in the Selection dialog.

Now go back to the original image layer. Type Ctrl+C to copy from that layer and Ctrl+V to paste the copy as a new layer (Layer > New Layer) after pasting. Set the layer blend mode for this new layer to Grain Merge. Reduce the opacity on any of the pasted, text or shadow layers as necessary to improve the effect; then use the same process for the numeric text that represents the user’s credit card number.

Little fluffy clouds

As you can see, there isn’t much work involved in creating the basic credit card. The next task is to add the gloomy backdrop, but before we go any further, save the credit card as creditcard.xcf and then merge the visible layers. Turn off the visibility of the credit card layer. We’ll get back to that layer later when we want to scale and move it around.

First we’ll create some classically British clouds (Fig 4). Create a new layer and fill with a dark grey – #555454. Create another new layer and open the Plasma filter (Filters > Render > Clouds > Plasma). Set the turbulence to 1.2 and pick a random seed, then click OK – this renders the coloured cloud in the new layer – then desaturate (Layer > Colours > Desaturate) this layer. Adjust the brightness and contrast (Layer > Colours > Brightness-Contrast) to reduce the white areas, then run the Shift filter (Filters > Distorts > Shift) with a horizontal shift of 15. This shifting will stretch the clouds horizontally at all points in the layer, making them look more wind-blown and realistic. Gaussian blur this layer by 10 and set the layer blend mode to Grain Merge.

Bring on the rain

The clouds are blurred a bit, which gives them a sense of distance. We won’t see much of the clouds in the finished article anyway, so don’t worry if they look different from the grey British clouds you can probably see right now.

The next part to add to the gloomy day (or night, actually) is rain. This is one of the easiest effects you can do in Gimp, as you’ll soon see (Fig 5).

Create a new layer. Fill it with noise (Filters > Noise > Noisify) set to about 0.75 for all channels. Gaussian blur this by 3 pixels. Open the Motion Blur filter (Filters > Blur > Motion Blur). Set the type to Linear, the length to 20 and the angle to 100; then click on OK. Open the Curves dialog (Layer > Colours > Curves) and adjust the Value curve as shown. Changing the curve so that there is a sudden change from dark to light increases the size of the raindrops. Moving the curve near the bottom so there is less black increases the number of drops. You may find that changing the blend mode to Grain Merge gives an interesting effect, but that may not be necessary depending on the shape of your clouds in the layer below.

Lightning effect

The next step is an important one, but one prone to huge variations. Don’t be discouraged if your version comes out badly. Experimentation is key with this technique, and once you have the basic process in hand, most of the work is tweaking to get the effect that works best.

As with most Gimp effects, the first thing to do is create a new layer. Choose the Gradient tool from the Toolbox and open the Gradient Options dialog to make sure the Foreground to Background (RGB) gradient is set. Drag the cursor from left to right at a slight downward angle in the image window. Add a new layer above this one, fill it with Plasma and select Desaturate. Set the new layer’s Blend mode to Difference (Fig 6). Adjust the gradient layer’s Value curve (Layer > Curves) until the image window shows something like a black bolt of lightning. Merge the plasma and gradient layers (Layer > Merge Down) and invert this new, merged layer (Layer > Colours > Invert).

Adjust the curves for this layer again (similar to what is shown in Fig 6) to pull the lightning bolt from the background noise. Set this layer’s blend mode to Screen. This will pull the lightning bolt out and remove from the composite image window the black background of the layer. Select and copy portions of the lightning and paste as new layers. Use layer masks, scaling or the Distort filters (Filters > Distorts menu) to modify the pasted layers. Move these layers around to add fingers of lightning coming from the original bolt.

The lightning might cause some heartache the first few times you try it, but don’t give up. Once you get that tricky first bolt, the rest is nothing more than Cut, Paste, Rotate and Mask.

Now we come to the finishing touches. The lightning for this project has been moved to the left-hand side of the image to make room for the credit card.

Finishing off

Turn the credit card visibility back on and move it to the very top of the layer stack. Scale the credit card down so that it fits comfortably to the right of the lightning, in the upper two-thirds of the image window. To give the card even more appeal, I’ve adjusted the Curves to add a little bit of blue to the lightning. When the background is uneven it can be hard to find an edge, so we’ve added a drop shadow to make the card sit up off the page (Fig 7). Colour has also been added to the lightning bolts by adding layers just above them with a purple shade set to Dodge mode and with their opacity pulled down to about 60%. The degree of opacity and the type of blend mode you use may vary depending on the shape and intensity of your lightning.

Click on the card layer (now at the top of the stack) to make it the active layer. Choose the Text tool again and add the text ‘Looking for a change of weather?’, making sure the text is light enough to stand out against the dark grey background. Add a drop shadow offset by 2 pixels, blurred by 3 pixels and set at 90% opacity. Add multiple drop shadows, blurred and offset at slightly different amounts, to force this text to stand out from the cloud and rain backdrop. Duplicate the text layer, select all but the word ‘weather’ and delete it (Ctrl+X). Turn on Keep Transparency for this layer and fill with a light blue colour. The cloud layer in the final image was also modified slightly by adjusting the blue and green Curves to give the clouds a little bit of colour (Fig 8) – though resist the temptation to go into full-blown psychedelia.

This project is easy even if you find yourself stumbling over the creation of the lightning bolts. That bit is a lot of trial and error, and you’ll almost never get the same bolts twice – but then why should you? Other features you can add here are a light glow around the bolts or lighting effects in the clouds where the bolts originate. Or toss in a photo ID in the upper left of the credit card for fun. With Gimp, the possibilities are endless.

Image captions


1/ Ah, this is the life: fresh mango juice, shoals of fish nibbling one’s toes... This is a simple stock image.

2/ Experiment with the offset, blur and opacity functions when you come to do your own credit card.

3/ The font we’ve used for the raised lettering is pretty specialised – you can use anything with an angular, eighties feel.

4/ Gimp generates clouds in quite a random way that you can’t control absolutely – so if it doesn’t work, try again.

5/ Raindrops are easy, but look really impressive – as with so much in Gimp.

6/ The lightning effect is the icing on the cake – but don’t over-egg the pudding.

7 & 8/ The eye sees in RGB, so a little bit of colour will make a greyscale image look much more realistic.