PDA

View Full Version : How to create a Dashed Border?



buntings
09-20-2009, 06:43 PM
Hi All,
My first posting on here so be gentle!

I found the guild a few days ago and Im overwhelmed by the quantity of information on here. Its quite amazing.

Despite all that Ive searched and browsed but I cant find the answer to my question - its likely on here somewhere but I cant find it.

I am making a world political map for a website and I am looking to recreate the dashed border/neatline found on old maps, for example this one:-

http://www.davidsongalleries.com/news/?p=75

Can anyone tell me how to create this effect in photoshop ( Im still using the original photoshop CS )?

Thanks in advance

Gareth

töff
09-20-2009, 07:35 PM
Well, I hope I don't come off as an absolute ogre here, but I think this is the sort of basic technique that all Photoshoppers rely upon on a regular basis, and you would benefit greatly from experimenting on your own to create this imagery, rather than following a tutorial. Teach a man to fish is one thing, but point him toward a river is another.

There are probably easily a dozen ways to achieve this particular effect. I think you ought to be able to come up with at least two at the newbie level.

Edit: Furthermore, throwing oneself into the river is how all the amazing guys here come up with their original awesome advanced techniques to share with others. You must never be afraid to hurl yourself into the water, head first! It's not as if you'll break your neck on a rock. Okay, I've ridden that metaphor into the ground now.

Sigurd
09-20-2009, 11:29 PM
You want to find a method that draws the border once with an interrupted stroke. Look at the structure of your brush and see if you can reduce the frequency of the dots until you break up the line.

Make sure you keep the borders on a separate layer. Keeps everything clear and allows you to have a version with and without borders.

In photoshop you likely want a dotted brush and then trace a work path with that brush.

In Illustrator its much the same.


Sigurd


Oh and what töff said is true. Try not to think of it as a problem but as a puzzle to solve. :)

Ascension
09-20-2009, 11:58 PM
You can do the dotted border by setting the spacing on your pencil tip (not brush) to 150% or more. For a dashed line you need a few steps:

1. Make a path with the pen tool.
2. Pick any pencil tip that you want but set the spacing to 1%.
3. Stroke the path.
4. Click on the eraser tool and at the top set it to pencil mode.
5. Use a hard square pencil tip that is exactly double the size of the pencil tip you used to make the line.
6. Click on the brush editor and set the spacing to 300% or more and set the angle jitter control to direction.
7. Stroke the path with this modified eraser and delete the path when done (if you want).

The two most important things here are the spacing and the direction control on the eraser...otherwise the results will be unpredictable. If you were to make your own brush tip in a rectangular shape it won't work either (it doesn't bend around curves, I've tried, so that's why I use a hard round pencil tip to draw the line and a square to erase holes out of it). By the way, I use CS as well so I know this works.

Coyotemax
09-21-2009, 12:23 AM
For the type of border you provided an example for, I made mine (works with any version of PS that i know of) by setting up an inner and outer border with a space between, then overlaying a grid on another layer, and using the select too to cut the grid out so it only showed between the borders. flatten those, then paintbucket alternating sections. I found you end up with more predictable control on the size for this sort of grid (plus i find it's easier if you want to do something like red/black alternating) instead of calculating out the size of the brush and spacing percentages, but I hate math :P

(toff is right though, it's worth really getting to know the basics until they are second nature to you, it will serve you well in the longrun)

Midgardsormr
09-21-2009, 01:49 AM
I like to make a box of known dimensions with the Marquee tool, Fill it, give it a stroke, then alt-shift-drag it to one side to make a copy. I fill the copy with the second color, merge the two layers, then alt-shift-drag and merge again. That makes four boxes with alternating colors and a stroke.

You can set the Marquee tool to a fixed size by changing the Style from Normal to Fixed Size. The stroke should go to the inside of the object, and each box should be wider than you actually need it to be so that when you overlap them to make the strokes all the same width, the boxes are the correct length. This is important because the neatline serves as an additional scale and must therefore be as accurate as the main scale cartouche.

buntings
09-21-2009, 04:02 AM
Not sure if Ive just been mildly flamed?


"...basic technique that all Photoshoppers rely upon on..."

If you are a designer then I would possibly agree so - but not all photoshop users are designers, including myself.

I am an IT guy trying to make a commercial "go" of my photographic hobby - the map is to be a "clickable" way to obtain photographs of a particular country. Whilst I am quite happy manipulating photographs in PS and, more likely, in Lightroom you wont be too surprised that Ive never had the occasion to draw a dotted line in a photograph, its just a technique I think a photographer is unlikely to use.

For what its worth, having been working in IT for the better part of 30 years I absolutely hate those who come asking without having done their own legwork first.
So my question was not asked lightly, Id been experimenting and hunting around for a week or so before I came across the forum.

Various techniques for dashed/dotted lines/borders are well documented on the web - such as brush spacings ,colouring+shrinking+deleting layers and also using patterns. None of which gave me the result I am seeking since the border is NOT a simple dashed border. If you look closely at the example it is more than a dashed line since the white segments have a red border.

Being a manipulator of existing images rather than a designer of new images my way of thinking didnt lend itself to resolving the problem - but Coyotemax seems to have pointed me in the direction I was looking for, without feeding me any metaphorical fish!

I need to go experiment a little now.

Many thanks to all that took the time to reply.

Gareth.

Ramah
09-21-2009, 05:23 AM
I have to admit, I struggled with a similar border that I placed around my own map. It took me far longer to do than it should but I guess much of that was due to changing the size etc.

What I did was calculated from the size of the image how many alternating boxes I would need and then used the fixed size marquee tool to create a grid by stroking the inside with a 1 pixel pencil tip and then moving the marquee. After that I filled the boxes with the paint bucket and cropped out all the lines I didn't need.

buntings
09-21-2009, 06:48 AM
Hi Ramah,

Thanks for that outline, something else for me to try out.

... and greetings from the otherside of the M1, Im over near Matlock :)

töff
09-21-2009, 10:47 AM
I did not mean my post as a flame in any way, shape, or form. You don't have to be a designer to use Photoshop ... notice I said Photoshopper, which you are. Sorry if I offended. I meant it as encouragement to build your basic skills -- square marquees, grids, xy transforms, strokes, paths -- which will serve you well and daily in more advanced Photoshop challenges.

su_liam
09-21-2009, 03:21 PM
I've been using photoshop since at least version 5, and I didn't know how to do this. Just because it's never really come up. Given a bit of time I could probably have come up with the solution, but that's just because I've been at it for a long time.

Now this isn't meant as any kind of a flame, either, but for a newbie tutorials are key to learning an app as deep and complex as photoshop. They allow a new user to get something useful done with the app, which promotes further use and experience rather than giving up in frustration. Properly written, a tutorial can be used to demonstrate what those basic principles mean. This is especially important in a fairly uncommon niche like cartography and terrain-building. There are a lot of questions to ask that aren't answered in a standard, "Making your Digital Photos Prettier with Photoshop," book.

That said, it's a really good idea to practice with those cookbook recipes, modifying them, seeing the results, and trying to understand the principles behind them. Think a lot about how you can adapt the various tools used in the recipe for other tasks. For instance, with the technique Ascension describes, you are creating paths, stroking paths and manipulating brush settings. There's a lot of power there if you learn it well and adapt it.

RobA
09-21-2009, 05:05 PM
I'll add the technique I use in Gimp, as it may have an equivalent in photoshop, plus turn this into a mini tutorial. The basic idea is to use a checkerboard grid with a layer mask, plus some strokes. This also assumes you do not want to cover any of the existing map.

1- Decide on the width you want for the lines, and enlarge the canvas to that size. i.e. for a 1200x800 map you might want a neatline 20 px wide, so make the canvas 1240x840, centering the layers.

2- decide on a the number of segments you want. Keep it close to the same proportion as the image size so they stay square. For example, say 31x21 in this case. Using an odd number will ensure the same colour in all four corners.

3 - create a new layer this size.

4 - filters->render->pattern->checkboard, and select a value of 1 (pixel) The checkerboard is in your fg/bg colour.

5 - scale the layer to the image size, with NO interpolation (this is the magic step that takes care of the nasty math!)

6 - use the move tool to place it over the whole image.

7 - create a selection bordering the area. Select->all, select->border 20 (the size we wanted)

8 - add a layer mask, using the selection.

9 - If you want to outline the checkboard in a different colour, use the select by colour tool and click on the colour, then stroke the selection with an even sized stroke.

10 - Turn the layer mask into a selection and stroke the selection again, using a 2x the width in step 9.

11 - add more borders, etc.

Here is the result of this:
16962

-Rob A>

Tom_Cardin
09-21-2009, 10:43 PM
Simplest brute force method I would use would be to draw one set of alternating boxes exactly as you wish with border, spacing, coloring all established. You want to divide your map height and width to a nice number to create your grid spacing...Aesthetically you probably want the spacing to be an odd number vertically and horizontally so that your corners all look the same. Exactly what your example shows.

1. on a new layer make a rectangular selection which is the dimension of one grid box. Fill with white. Click the selection tool again and nudge it to the right so that the selection box is now flush to the right side of the white rectangle you just made. Fill with black.

2. Add details. I used a 1 pixel pencil and painted in the red and black lines - hold down the shift key to draw a straight line. Get as detailed as you want in this step but don't change the length of these two segements, the width of your map should be evenly divisible by these if you want the outline pattern to be semetrical.

3. Make your corners. Select your double segment, copy it and paste it. Go to Edit >Transform>Rotate 90 CCW. Align it so that its overlapping the right side of the original bar - make sure to copy your original layer at this point as well.

4. Use a one pixel pencil to repair where they overlap.

5. Place a corner piece in each corner of the map. Again your math should be good or this won't work cleanly. Use the same rotate trick as in step 3 for each corner.

6. Copy and paste in your sides from the original segment you drew. Try different layer overlay type to get different effects.

You can do a pattern fill for the black and white area as well, but this method lets you really add lots of individual details. It's very straightforward and only prone to issues if your math is off...its sometimes easier to make your border then scale your map to fit.

I like doing things this brute force way, I don't get lost in any trickery or smoke and mirrors. It's not very time consuming, in fact its quite fast considering other methods that would require more pattern set up and brush configuration.

ravells
09-22-2009, 06:54 AM
Doesn't PS have a 'Replicate' command which will replicate the boxes across the map? Or am I confusing this with another application?

Midgardsormr
09-22-2009, 01:06 PM
Illustrator can do that, but I haven't seen such a function in PS. That doesn't mean it isn't in there somewhere, of course.

Tom_Cardin
09-22-2009, 01:22 PM
No replicate that I am aware of. One could make an action to do it but I am not sure how you could set one up to be usefull more than once since the size and placement would vary from map to map.

I think its assumed one would use pattern fills or brush spacing to achieve such affects.

One thing I have found invaluable for my pixel pushing duties is the Smart Guides. I am not sure which version of PS introduced them, I am using CS3...very handy little buggers since I hate using snap features.

In 3D Studio Max there are all kinds of duplicate and array abilities that would make creating this sort of doodad a snap...but thats another tutorial all together.

ravells
09-22-2009, 04:10 PM
I just had a hazy memory of it from the Lyzard Stomp site (the best photoshop tutorials I've ever seen for my purposes) but it's off air now. I don't use PS anymore so I was working from a vague memory.

To be honest, I use vector to make my borders, I find it so much easier.

töff
09-22-2009, 04:17 PM
If Buntings follows any of these tutes at all, I hope to hell he does them all. Every one.

Then I would love him to post another method that hasn't been covered yet. I would so rep that.

buntings
09-23-2009, 09:19 AM
Right, thanks to all for the very informative, constructive and educational comments.

I liked the bruteforce approach and agree that often the simple ways are the best, on the otherhand I was learning a lot fiddling around with some of the more smoke and mirror approaches so I went that route.

So, heres what Ive actually done - with my sincere thanks to coyetemax who has been working away in the background to guide me in the right direction as well as being a useful sounding board for some other ideas.

I was looking for a red/white dashed border ( although Im now wondering if black might be more suitable - thats another story! ).

First I created the rectanglar border on a seperate layer called "border" thus:-

Created a rectangular selection
fill red
contract 1 pixel
fill white
contract 4 pixels
file red
contract 1 pixel
delete

so I now have a 4 pixel wide border around my world map, filled with white and edged with red.

[the procedure from this point forward is credited to coyetemax ]

Create and select a layer called "grid"

created the required "grid" using the single column/row marquee tools ( in "add to" mode so the whole grid is eventually selected )

Fill the selection with red and deselect.

So I now have a double red border on one layer which is in effect intersected by the single pixel wide red grid on the other layer.

Now have to remove the superflous lines ( ie anything except those lines within the double border )

Select the border layer and using the magic wand select everything on the outer side and inner side ( ie where the map goes ) of the border.

select the grid layer

Hit delete

Merge the two layers into the "border" layer ( so the grid layer goes ) to leave a red border, filled with white and broken into dashes by red lines.

Then simply hop around and bucket fill the appropriate squares with red.

Job done.

Looks long winded when you write it down but in reality its quick, simple and works a treat.

Frankly had I been left to my own devices rather than guided in the right direction I would have likely have come up with the brute force approach reasonably quickly but learnt little that I didnt already know. There is nothing wrong with the brute force way and it will work - however being patiently guided through this layered approach, not spoonfed but rather pointed in the right direction - left to some trial and error but being helped when necessary means that my knowledge has over the last few days increased tremendously. More importantly Ive started to think in the right way to build up an image from scratch rather than amending existing images which is what I am used to.

More than that, whilst this was to be a "one off" image Ive actually been inspired to make a few more maps ( when I finish this one! ) - Ive seen potential for the techniques Ive found here to create a 3 dimensional map of my village ( a very old village in the hills of central England and famous as the home of Florence Nightingale ). The local parish council were looking for some new tourist boards - and Ive been inspired!


Thank you!!

Coyotemax
09-23-2009, 10:36 AM
Glad to hear things are working well! And being inspired is a good thing, I look forward to seeing the finished work.. yay!

Ramah
09-23-2009, 03:19 PM
More than that, whilst this was to be a "one off" image Ive actually been inspired to make a few more maps ( when I finish this one! ) - Ive seen potential for the techniques Ive found here to create a 3 dimensional map of my village ( a very old village in the hills of central England and famous as the home of Florence Nightingale ). The local parish council were looking for some new tourist boards - and Ive been inspired!


Thank you!!

The area around Matlock is indeed very beautiful. And very hilly. It will be very interesting to see what you come up with. :)