Results 1 to 10 of 19

Thread: [Award Winner] Using the mosaic filter to make towns in Gimp

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Community Leader Facebook Connected torstan's Avatar
    Join Date
    Jul 2007
    Posts
    4,199

    Post

    Now, set the threshold to 0 - this is important as otherwise you'll end up with some slightly transparent buildings. Click the magic wand on the road and you'll get a selection that encompasses the road and all the houses that are adjacent to it.

    Now make sure the black and white mosaic layer is selected and go to Edit->Fill with Background colour to fill the selection with white (or ctrl-. for quick).

    Do not get rid of the selection, we want to put some of those buildings back in again.

    You should now have something like this:

    Click image for larger version. 

Name:	noHouses.jpg 
Views:	399 
Size:	311.8 KB 
ID:	7686

    To replace some of those houses we need a little bit of trickery. Take the following steps:
    1. Make sure the Roads layer is selected.
    2. Go back to the magic wand and deselect the Sample Merged option.
    3. Change the selection preferences to Subtract from Selection.

    Your tools window should now look like this:

    Click image for larger version. 

Name:	MagicWand.jpg 
Views:	319 
Size:	27.0 KB 
ID:	7687

    Now click on the black road. Now you just have the white space selected where you want to replace buildings. However this still borders the road, so if we just fill that with black then we'll be back where we started. To get around this do the following.
    1. Go to Select->Shrink... and shrink your selection by 2 pixels, leave all other options at their default.
    2. Go to Select->Grow... and grow by one pixel.

    This has the effect of getting rid of tiny areas and retaining larger ones.

    3. Make sure your black and white mosaic layer is selected.
    4. Go to Edit->Fill with Foreground colour (or ctrl-, for quick).

    You should now have something that looks like this:

    Click image for larger version. 

Name:	edgingHouses.jpg 
Views:	563 
Size:	208.0 KB 
ID:	7688

    Essentially we are now done, having created a mask that has all of our houses in it. Now the challenge is to make this pretty. I'll address this in the next post.

  2. #2
    Community Leader Facebook Connected torstan's Avatar
    Join Date
    Jul 2007
    Posts
    4,199

    Post Making it pretty

    Now we'll go back to that colour layer we left alone. First of all, we want to get rid of all the blocks of colour that represent houses that we no longer need.
    1. Make sure your black and white mosaic layer is selected.
    2. Select all (ctrl-a).
    3. Copy (ctrl-c)
    4. Select your colour layer.
    5. Right click the colour layer in the layers dialogue and select Add Layer Mask...
    6. Click okay in the dialogue
    7. Select the layer mask in the layers dialogue.
    8. Paste (ctrl-v) and anchor the pasted layer to the layer mask (click the little anchor at the bottom of layers dialogue).

    Now the layer mask is the wrong way round at the moment - it is masking out the buildings and only revealing the white between. With the layer mask selected, go to Colours->Invert. You'll now have the mask the right way round. If you move the colours layer to the top of your layer stack you should now see something like this:

    Click image for larger version. 

Name:	colours2.jpg 
Views:	374 
Size:	293.4 KB 
ID:	7689

    This is all very well, but the houses are just flat blocks of colour at the moment. We want to give them some substance. To do this, take the following steps.
    1. Duplicate the black and white mosaic building mask layer and rename it something like "Building Bump Map"
    2. Go to Colours->Invert to make the streets black and the buildings white. Remember, bump mapping takes white points to be the highest and black points to be the lowest, so we want the streets to be the lowest point.
    3. Change to the Select by Colour Tool with threshold set to zero, and click on one of the white buildings to select all the buildings.

    You should now have something that looks like this (note that I've turned off the visibility of the other layers so that I can see what I'm doing):

    Click image for larger version. 

Name:	SelectByColour.jpg 
Views:	322 
Size:	290.6 KB 
ID:	7690

    4. Switch to the gradient tool.
    5. Select the Shaped Angular option in the Shape drop down.
    6. Check the switch direction checkbox beside the Gradient: drop down
    7. Click and drag inside one of your selected buildings to fill all of them with a shaped gradient.
    8. Edit->Select None (ctrl-shift-a) to see your handiwork.

    It should now look something like this:

    Click image for larger version. 

Name:	gradient.jpg 
Views:	339 
Size:	211.1 KB 
ID:	7691

    This is now ready for use as a bump map.

    9. Turn off the visibility of this layer and select your Colours layer again.
    10. Right click the layer in the layers dialogue->Apply Layer Mask
    11. Go to Filters->Map->Bump Map...
    12. In the Bump Map dialogue make sure that your Building Bump Map layer is selected as the bump map.
    13. Play with the Depth slider until the preview looks good.

    Here are the settings I used:

    Click image for larger version. 

Name:	bumMapDialogue.jpg 
Views:	203 
Size:	55.0 KB 
ID:	7692

    14. Now click okay and you should have something like this:

    Click image for larger version. 

Name:	houses.jpg 
Views:	525 
Size:	214.7 KB 
ID:	7693

    In the next section we'll look at putting in a background and some finishing touches.

  3. #3
    Community Leader Facebook Connected torstan's Avatar
    Join Date
    Jul 2007
    Posts
    4,199

    Post Adding in a background

    Now we'll put in some colour to finish the whole thing off. First of all, let's put in some grass background.

    1. Create a new layer
    2. Place it under your Colours layer and your Roads layer
    3. Fill it with a nice grass texture (select a grass texture and then hit ctrl-.

    Now it will look something like this - its starting to come together:

    Click image for larger version. 

Name:	withGrass.jpg 
Views:	435 
Size:	263.1 KB 
ID:	7694

    We also want roads that aren't black lines. For this take the following steps:
    1. Create a new layer and call it Street Colour
    2. Fill it with a nice street texture - I've found that the default Gimp pattern Slate is actually not too bad as a starting point.

    Now this makes everything grey - we don't want that. We want to create a layer mask that will show only the areas we want.
    3. Right click Street Colour in the layers dialogue and go to Add Layer Mask...
    4. Select Black - full transparency in the Layer Mask Dialogue.
    5. Select your Roads layer.
    6. Select the Magic Wand tool and make sure the selection mode is Replace Current Selection
    7. Click on the road to select all your roads (if you have disconnected road sections it is better to use the Select by Colour Tool here instead).

    You should now have something that looks like this:

    Click image for larger version. 

Name:	roadsSelection.jpg 
Views:	283 
Size:	287.3 KB 
ID:	7695

    8. Select the layer mask for the Street Colour layer in the layers dialogue
    9. Go to Select->Shrink and pick 2 pixels
    10. Fill the selection with white.
    11. Edit->Select none (ctrl-shift-a).

    Now this gives a very hard edged road network. I personally think this is a little too clean. To fix this, still with the layer mask selected, do the following:
    12. Go to Filters->Blur->Gaussian blur
    13. Accept the defaults and hit okay.

    You should now have something that looks like this:

    Click image for larger version. 

Name:	withRoads.jpg 
Views:	468 
Size:	173.6 KB 
ID:	7696

    Now the roads are a bit dark, so I used the Colours->Brightness/Contrast dialogue to up the brightness of the roads a bit:

    Click image for larger version. 

Name:	withRoads2.jpg 
Views:	294 
Size:	177.7 KB 
ID:	7697

  4. #4
    Community Leader Facebook Connected torstan's Avatar
    Join Date
    Jul 2007
    Posts
    4,199

    Post Adding som shadows

    Okay, so now we want to add some shadows.

    1. Go back to your black and white buildings layer
    2. Use the Select By Colour Tool to get a selection of all the buildings
    3. Go to Filters->Light and Shadow->Drop Shadow
    4. Pick the following options in the dialogue:

    Click image for larger version. 

Name:	dropShadow.jpg 
Views:	354 
Size:	20.9 KB 
ID:	7698

    5. Hit okay and move the layer under your Colours Layer

    That's it done. The town is finished and the houses are all there. My final screen looks like this:

    Click image for larger version. 

Name:	finalScreen.jpg 
Views:	195 
Size:	283.6 KB 
ID:	7699

    and the final map looks like this

    Click image for larger version. 

Name:	villageFinal3.jpg 
Views:	600 
Size:	176.8 KB 
ID:	7700

    Now there are lots of things that can be done to tweak this process - if you fiddle with the settings in the mosaic filter specifically you will be able to get more or less spaced out houses and different shapes. Equally you can posterise the colours layer and apply a stroke to the houses to make it look more hand drawn. Here I also put all the colour layers over a parchment background and changed them to multiply, overlay, or hard light, to get a less intense feel. I added an overlay layer with some broad regions of light and dark for the hills. I also used the bump map layer as an overlay layer to give a bit more light and shade to the buildings.

    Click image for larger version. 

Name:	final5.jpg 
Views:	1336 
Size:	164.4 KB 
ID:	7704

    Here's the layer layout for that map:

    Click image for larger version. 

Name:	finalScreen5.jpg 
Views:	230 
Size:	271.5 KB 
ID:	7702

  5. #5
    Guild Adept bryguy's Avatar
    Join Date
    Jul 2008
    Location
    In my own little world =D
    Posts
    289

    Post

    love the tutorial! and I think that the random village shapes look cool




    btw, what did you do for that last pic? it looks awesome
    "When I use a word," Humpty Dumpty said in a rather scornful tone," it means just what I choose it to mean -- neither more nor less."
    "The question is," said Alice, "whether you can make words mean so many things."

    "The question is," said Humpty Dumpty, "which is to be master -- that's all."


    -Lewis Carrol: Through the Looking Glass

  6. #6
    Community Leader Facebook Connected torstan's Avatar
    Join Date
    Jul 2007
    Posts
    4,199

    Post

    I'm glad you liked it. I'd urge all that read through it to rate it, if you like it or not.

    The steps I took to make it look pretty are:
    1. Add a parchment texture as the background.
    2. Change the layers above in the following way:
    a. Duplicate the layer
    b. Set the blend mode of the bottom of the two copies to overlay
    c. Reduce the opacity of the top layer to between 50-80% depending on the result

    This softens the colours and blends the colour scheme together a little more. Now to create some light and dark regions:

    3. Create a new layer over the map and set the mode to overlay.
    4. Fill with precisely 50% grey (you will see no effect at this stage as 50% grey does nothing for overlay layers. Don't worry, it will be important later).
    5. Go to the dodge/burn tool and take a nice large fuzzy brush. Make sure you have the tool set to burn and the range set to shadow:
    Click image for larger version. 

Name:	DodgeBurn.jpg 
Views:	335 
Size:	34.2 KB 
ID:	8163
    6. Now run the brush over those regions that you would like to be dark - essentially hill-sides away from your sun.
    7. Now switch to dodge, and set the range to midtones.
    8. Run the brush over those regions that are in the light - hill tops and the sides of hills facing the sun.

    You will now have soft highlights and shadows on your map. This will give the impression of hills. Repeat these steps to get deeper shadows and feel free to use the smudge tool with a large fuzzy brush to smooth out any shadows that are too dark.

    If you set your overlay layer to normal you'll see that you've really got a grey layer with lighter and darker regions on it. For the map above, my overlay layer looks like this:
    Click image for larger version. 

Name:	overlay.jpg 
Views:	1955 
Size:	19.1 KB 
ID:	8164

    That's all there is to it.

    I've also uploaded the .xcf file in a zip for people who want to see the breakdown of all the layers and blending modes for that final image. I hope its useful!

    village2.zip

  7. #7
    Guild Journeyer Sagenlicht's Avatar
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    249

    Post Nice

    Nice tutorial torstan

    Repped and rated
    My Map Challenge Entries

    I use GIMP for all my maps.

    GIMP scripts and plug-ins overview


    Everything I post on this site uses the Creative Common Attribution-Noncommercial-Share Alike license. Only exception to this are any pyhton scripts which use the GPL.

    If you are using any of my posted stuff just use your rep stick on me

    Should you be interested in using anything I posted on commercial purpose drop me a pm.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •