Results 1 to 10 of 19

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

Hybrid View

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

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

    Now this has certainly been done before but I've been playing around and trying to get a good town result in Gimp using the mosaic filter and I think I've ended up with something rather nice. Here's the end result:

    Click image for larger version. 

Name:	villageFinal.jpg 
Views:	1893 
Size:	180.7 KB 
ID:	7659

    and a variation with a few tricks applied:

    Click image for larger version. 

Name:	villageFinal2.jpg 
Views:	936 
Size:	171.9 KB 
ID:	7670

    I'll go through the steps I took to get this in the following tutorial.
    Last edited by torstan; 11-10-2008 at 07:30 PM.
    Fantasy Map Blog | My food illustration
    Everything I post is free for use and redistribution under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 licence, except where noted otherwise in the thread.

  2. #2
    Community Leader Facebook Connected Ascension's Avatar
    Join Date
    Jun 2008
    Location
    St. Charles, Missouri, United States
    Posts
    8,298

    Post

    This looks pretty promising. PS has a similar filter and with a lil tweaking you should be able to do this pretty darn easy. I'd like to see the process as I've never actually tried it, only thought about it. Nice job.
    If the radiance of a thousand suns was to burst at once into the sky, that would be like the splendor of the Mighty One...I am become Death, the Shatterer of worlds.
    -J. Robert Oppenheimer (father of the atom bomb) alluding to The Bhagavad Gita (Chapter 11, Verse 32)


    My Maps ~ My Brushes ~ My Tutorials ~ My Challenge Maps

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

    Post

    Thanks - obviously that is a somewhat extreme example, and it may well be that it is best used for smaller regions as that looks a little overwhelming, but the sense of buildings seems to work there. Anyway, on with the tutorial.

    1. Lay out your roads
    Create a new transparent layer (shift-click the new layer button on the layers dialogue). Call the layer Roads.

    First things first. Lay out the areas that will form your roads. Do this with a nice large brush (your actual roads will be a little smaller than these). Your image should look something like this:

    Click image for larger version. 

Name:	villageRoads.jpg 
Views:	445 
Size:	55.6 KB 
ID:	7663

    2. Get some colours for your roofs
    Now we want some nice variation in the colours of the roofs of the buildings. No town looks any good with uniform roof colours. What we will do here is create a solid colour layer that will be used by the mosaic layer as the base for the buildings further down the line. So if you want one district to have blue roofs - make sure that area is blue here.

    I want to have roofs with a wide variety of browns in the roof colours. To this end I create a new layer and call it colours. I then take the brush tool and make sure that the opacity sensitivity for my tablet is off. I want the whole layer to be opaque so that the roofs that are generated are opaque. Now I pick the Use colour from gradient option and pick the Browns gradient from the drop down. I then colour in the whole map with random colours. If you want colour variations that are less random - this is the place to make sure they are in the right place. You should now have something like this:

    Click image for larger version. 

Name:	colours.jpg 
Views:	438 
Size:	127.7 KB 
ID:	7664

    [b]3. Using the mosaic filter[b]
    Now we are ready for the crux of the process, using the mosaic filter. Make sure you have your Colours layer selected and go to Filters->Distorts->Mosaic. Now what you put in here will affect the shape and size of your buildings. Play around with either Octagons and squares, and squares and adjust the neatness slider and see what the results look like. Of course, adjust the size slider too to fit the size you want your final buildings to be. The other settings I would set to the values shown here because they give flat coloured tiles with white gaps between which we will need later.

    Here are the settings I use:
    Click image for larger version. 

Name:	mosaic.jpg 
Views:	235 
Size:	58.0 KB 
ID:	7665

    This will now give you a layer that we'll use later as the base of the colour for our buildings.

    4. Creating a mask
    First of all duplicate the layer Colours and rename it (I've called it streets in my example, but building mask would probably be more appropriate). Now go to Colours->Desaturate. The various options don't really matter here. Next go to Colours->Threshold. Now you'll see that our lovely mosaic pattern has suddenly gone very black and white. Play around with the location of the threshold value until you are happy with the density of the buildings. I left it so there were a couple of holes in the pattern, but not too many.

    Click image for larger version. 

Name:	Threshold.jpg 
Views:	332 
Size:	317.4 KB 
ID:	7666

    Now we need to cut out the roads from this as we do not want buildings on our roads - or even half on the roads. So first move the roads layer above the rest and select the magic wand tool with 'select merged' checked, like this:

    Click image for larger version. 

Name:	CuttingRoads.jpg 
Views:	207 
Size:	285.2 KB 
ID:	7667

    Okay, I'll carry on from here tomorrow.
    Fantasy Map Blog | My food illustration
    Everything I post is free for use and redistribution under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 licence, except where noted otherwise in the thread.

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

    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:	304 
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:	180 
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:	298 
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.
    Fantasy Map Blog | My food illustration
    Everything I post is free for use and redistribution under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 licence, except where noted otherwise in the thread.

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

    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:	289 
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:	242 
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:	252 
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:	123 
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:	273 
Size:	214.7 KB 
ID:	7693

    In the next section we'll look at putting in a background and some finishing touches.
    Fantasy Map Blog | My food illustration
    Everything I post is free for use and redistribution under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 licence, except where noted otherwise in the thread.

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

    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:	360 
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:	213 
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:	188 
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:	195 
Size:	177.7 KB 
ID:	7697
    Fantasy Map Blog | My food illustration
    Everything I post is free for use and redistribution under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 licence, except where noted otherwise in the thread.

  7. #7
    Guild Journeyer
    Join Date
    Apr 2008
    Location
    Cairo
    Posts
    181

    Default

    Just caught up with this tutorial and it looks great, I am at work so can't play with the script, but if you can get this scripted you will make me very happy!

  8. #8
    Community Leader Gracious Donor ravells's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    10,930

    Default

    You're carving out a seriously cool little niche as the Guild's pdf scribe! Thanks for all your hard work, Vandy! It is much appreciated. Have some rep!

  9. #9
    Guild Expert Jalyha's Avatar
    Join Date
    Jan 2014
    Location
    Out of my Mind!
    Posts
    1,067
    Blog Entries
    6

    Default

    I did it I did it I did it!!!!!!

    Thanks so much for the tutorial it's the first one I could follow right all through to the end, and I DID IT!


    I mean, I didn't do it very well, and I used my manor from the contest to fill my castle space but I made a whole city!


    I'm a tiny bit excited

    Here's what I made:

    Click image for larger version. 

Name:	mosaic city.jpg 
Views:	88 
Size:	2.94 MB 
ID:	60957

    It's not very good, but if I can follow the tutorial, I can practice, right ?

    Thank you sooooooo much

    xoxoxo
    Have you "liked" a post today?

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
  •