Gradient map conversions (part 1)

A while ago sock released a pack of industrial textures which generated some excitment and discussion on func_ about how to crunch them down into 8-bit versions that Quake could digest. More recently Cage released a tutorial on 8-bit conversion. Today’s post, so outside of my normal topics that I can’t even categorise it, is my attempt to combine these things together in a tutorial style way. This first post will be mostly about technique, and in the second part we’ll get more arty and see what effects we can create.

I’ll be using GIMP  for this example, if you want to paint along at home Bob Ross-style. Everything here should adapt to other image editors easily. I assume you already have a copy of the quake palette installed (post a comment if you’re stuck). I also recommend that you set up a keyboard shortcut to the main function from Cage‘s tutorial: Gradient Map (in Colours-> Map->Gradient Map). 90% of what we’re doing here will be applying a gradient, undoing it, tweaking the gradient, and repeat, so we need to make that as quick as possible.

I’ve grabbed a texture from sock‘s pack of green metal materials. The first thing is to scale it down to Quake dimensions. To try and minimize fuzziness, I increase the image contrast 10% before scaling it, and apply a 10% sharpen filter afterwards (but also read necros’ alternate technique, which I found handled the grooved edges better but made the rust more pixelated). Here’s the texture after these 3 steps (at 200% zoom):


Just for illustration, here’s what we get if we apply Floyd-Steinburg at this point. Ugly as sin:


As we can see from the conversion, Quake doesn’t have a very good match for the main colour of this texture, so my plan is to use the cold, desaturated green near the bottom of the palette to get a workable texture. The key will be the Gradient Map, which works on a greyscale version of the image. If we go back to the base texture and desaturate it we get the following:03-value

From the levels meter we can see that only the central range is used, and when we create our gradient this will be the only “useful” segment of it.

Our first action will be to map out this usable section, which handily gives us some practice if we’ve not worked with GIMP gradients before. Bring up the gradients tab and hit the new button to create the gradient we’ll be using today – it should default to a greyscale. The gradient editor will open up, and I recommend resizing it to be a lot wider, as we’ll be doing detailed work with it.

To do anything more than a basic ramp with a gradient we need to add segments. Start by right-clicking in the gradient editor, choose Replicate Segment and create two segments. You should see something like what’s below:


Notice the blue bar on the bottom, this indicates which of the segments are selected. Click to select the right-hand segment, then right click on the gradient. Click the Left Endpoint’s Color… option, and change this colour to bright red. Do the same with the right endpoint, then change to the left-hand segment and make both those endpoints black. Remember the Gradient Map command we made a shortcut to at the start? Run that now and you should get something like this:


The red dots are coming from the brightest pixels of the image, being mapped onto the upper half of the gradient. Hit undo, and return to the gradient editor (you can keep it open throughout – it makes “live” changes to the gradient). If you drag the black triangle in the middle you can move the black/red terminator. Move it rightwards a little way, then reapply the gradient map. You should see fewer red pixels.

Keep undoing, adjusting and reapplying the gradient until you find the point where all the red pixels have just disappeared. Once you’ve done that, why not do it again! Select the black segment of the gradient, divide it in two using the Split Segment at Midpoints, but this time change the left-hand segment to red. Now when you apply gradient map the red pixels mark the darkest parts of the image. Again, move the terminator until no red pixels come through. You should now have a gradient with two red segments marking the “dead” sections, and a black segment for the “live” region.

Finally we can put some proper colours in. Select the middle segment, and change the right endpoint colour. In the colour select popup, the last tab at the top lets you pick from a palette – I picked the brightest colour on the mint green row. On the left endpoint I plumbed for around 5 points above the darkest shade on that row. I also moved the white triangle which controls the midpoint left, to boost the lighter shades. Here’s what I ended up with, and the gradient I used:


I’ll make no apology for how different the colour of this texture is to the original – we’re doing a conversion and that’s the price we have to pay. But I’ll gladly admit it’s a bit flat and monochrome, and in part II we’ll do something about that…


One thought on “Gradient map conversions (part 1)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.