PDA

View Full Version : [Award Winner] Technique for adding coastal detail as you zoom in.



RobA
01-18-2008, 06:11 PM
I have been playing with a few techniques in GIMP (applicable to any raster program) to allow me to zoom in and "refractalize" a coastline without significantly changing the shape...

This technique is designed to work with a coastal outline (white land on black water) and will not directly translate to working with heightfields....

Steps:
1) Make a rectangular selection of the desired area, and copy it to a new image.

2) Enlarge the new image to the desired size

3) Blur it enough to get rid of the jaggies, but still maintaining some detail. I sued ~20 px in the examples. The bigger the blur, the more randomization will occur, and the less "true" the new coastline will be.

3) Create a new layer on top and set its mode to burn

4) Render clouds using the max detail and check turbulent. (I don't know what the photoshop equivalent of this is).

5) Invert (optional). Depends how it looks :)

6) repeat 4 and optionally 5 with different seeds until you get one you like. some just seem to work better than others. I kept a copy of the starting image open for reference to try and ensure coarse features were maintained.

7) Flatten the image (or just merge down the clouds layer).

8) Threshold with black at 1 or very low, again, maximizing detail while keeping the shape close to the original.

Here is a set of examples, with each showing the next one's selection. I started with a nice spherical mapped noise layer:
2175

2176

2177

2178

-Rob A>

su_liam
01-18-2008, 11:51 PM
I would start by using Flexify to center the projection on the area of interest. For most useful projections(maybe all, I don't know), distortion is minimal near the center of the map. You could then build a collection of USGS-like 'topo' maps of your planet. Cool.

RPMiller
01-21-2008, 02:25 PM
This is a great tip Rob! I'm going to need it as I move forward. Thank you, and I when I can, I'll rep you for this.

ravells
01-21-2008, 04:12 PM
It's really clever! Fractalisation on demand!

Chaosmark
01-29-2008, 12:20 AM
Now where was this when I was having to repeatedly zoom in on my map...? *sigh*

NymTevlyn
10-03-2008, 10:09 AM
Bumpity bump! How can I use this in Photoshop? I don't have a turbulent option nor can I find Threshold.

RPMiller
10-03-2008, 10:52 AM
Threshold is under Image-->Adjustments-->Threshold...

As for turbulent PS doesn't have an option. You'll just have to keep rendering clouds until you see something you like.

Ascension
10-03-2008, 03:59 PM
What I do if I want to zoom in on an area for a larger map is I make the main landmass white and put it onto a black layer. Then filter > pixelate somewhere between 3 and 12 (this puts a bunch of white, gray, and black jaggie shapes in where the white and black meet). Then Image > adjustments > brightness/contrast and turn the contrast up all the way to remove the gray. Now you have a black sea and white newly jagged landmass.

delgondahntelius
10-04-2008, 12:08 PM
Just played around in PS with this... Created an action for it too.... Its pretty much the same steps as Rob said...
>copy, create new, paste, increase image size.
>Gaussin Blur 2.0 pix
>New layer set to color burn
>Filter>Render>Clouds. Filter>Render>Difference Clouds.
>Threshholds
>Lather>Rinse>Repeat

:D

dr-spangle
12-18-2008, 02:47 AM
When we try this we always seem to get stuff like this:
http://www.novatainia.org/user_files2/andreas/fractalnova.png

burning the clouds layers down doesn't appear to be working...

RobA
12-18-2008, 07:29 AM
@dr-spangle:

Are you blurring the original enough to give the clouds layer something to work with?

Can you post up the starting image, too, so I have a better idea of what you are working from?

-Rob A>

dr-spangle
12-18-2008, 11:33 AM
A friend did that copy, erm

Here's one I did with similar results.
Start: http://80.42.27.104/zoomed%20maps/base.png

Scale up 500%
http://80.42.27.104/zoomed%20maps/Try%206/2.png

Blur:
http://80.42.27.104/zoomed%20maps/Try%206/3.png

Create cloud layer on burn
http://80.42.27.104/zoomed%20maps/Try%206/4.xcf

Merge down:
http://80.42.27.104/zoomed%20maps/Try%206/5.png

Threshold:
http://80.42.27.104/zoomed%20maps/Try%206/6.png



Both this one and the one my friend did are parts of this map:
http://www.micras.org/maps/blank.png
I use black for land, he uses black for water, both images are part of the central continent.

Redrobes
12-18-2008, 03:12 PM
Try it this way then. Take zoomed up coast in black and white and blur it a bit. Get some fractal clouds noise and add enough contrast so that it spans the range from black to white burning out a little at each end. What I have labeled lumpy noise. Then take that noise and adjust contrast by -20% so it spans from near black to near white. Then 50:50 average the blurred coast and the new noise. Then ram the contrast right up to 100% to get black and white again.

All that you are doing is just modulating some noise on top of the coast. By averaging in some noise on the blurred edge of the coast then it pushes it over and under the mid level and then when you whack up the contrast again its takes it back to black and white with crinkly noisy edges.

dr-spangle
12-18-2008, 06:01 PM
Ok, that works for a small area, but the clouds are not dense enough when I do a large area like 1000*500, I'm limited to something like 200*200 squares...

If I zoom the original map by 5 times, the map will be 18000*9000, which would have to be broken into 200*200 parts, of which there would be 4050 :?

Redrobes
12-19-2008, 07:45 AM
These techniques will work at any size. I guess your having trouble getting some noise at the right scale and density. I am sure Gimp will be able to do it but I don't use Gimp - I use imagemagick (www.imagemagick.org) which is also free.

Install imagemagick, open a command line - run cmd.exe and type

convert.exe

if that gives a huge list of image options then its installed ok. If it talks about converting drive formats from DOS to NTFS or whatever then its not in the path correctly so add the full path to the file like

C:\Apps\ImageMagick\bin\convert.exe

until you get image options. Then paste this into it modifying the convert to the full path version.

C:\Apps\Imagemagick\bin\convert.exe -size 512x512 xc: -type Grayscale +noise Random -resize 4096x4096 -contrast +noise Laplacian -blur 2 -contrast C:\MyWorkingArea\noise.png

that will give you a 4K x 4K noise map like this.

RobA
12-19-2008, 12:02 PM
Mentioned in another thread-

Get this noise generator: http://fimg-gmplugins.sourceforge.net/

It can produce many more options at better resolutions, and absolute pixel sizes, as opposed to being relative to the image size.

-Rob A>

dr-spangle
12-20-2008, 05:44 AM
Well, I'm on linux, and that option by RobA appears to be windows only...

I'm having a little trouble with imagemagick, but I should be able to install it on apache on here later today and get something through that... possibly

isomage
12-20-2008, 06:01 AM
Well, I'm on linux, and that option by RobA appears to be windows only...

It has source code which looks like it'll compile under linux -- get the .tar.gz.


I'm having a little trouble with imagemagick, but I should be able to install it on apache on here later today and get something through that... possibly

Shouldn't need a web server -- Redrobes's use of Imagemagick was command-line.

isomage
12-20-2008, 02:03 PM
It has source code which looks like it'll compile under linux -- get the .tar.gz.

I just compiled it on Ubuntu 8.04, and I only needed to install the GIMP development package, libgimp2.0-dev.

I also tested the ImageMagic instructions; note that Redrobes's instructions are for Windows, so you need to use "convert" instead of "convert.exe" and specify a Linux path for the output instead of "C:\..."

If you're getting errors, let us know -- someone here might be able to help you get set up.

dr-spangle
12-20-2008, 07:29 PM
dr-spangle@dr-spangle-laptop:~$ convert -size 512x512 xc: -type Grayscale +noise Random -resize 4096x4096 -contrast +noise Laplacian -blur 2 -contrast /home/dr-spangle/Desktop/noise.png
convert: UnrecognizedNoiseType `Random'.

isomage
12-20-2008, 07:52 PM
Do "convert --version" and see what it says. Random noise was added in version 6.3.5: http://www.imagemagick.org/script/changelog.php

dr-spangle
12-20-2008, 10:49 PM
Ok, I'm on version 6.2.4 :P

That'll teach me not to install from sudo apt-get install :P


ok
compiled
ran the thing to test and i get an error

dr-spangle@dr-spangle-laptop:~/Desktop/ImageMagick-6.4.7-10$ /usr/local/bin/convert logo: logo.gif
/usr/local/bin/convert: error while loading shared libraries: libMagickCore.so.1: cannot open shared object file: No such file or directory

isomage
12-20-2008, 11:15 PM
ok
compiled
ran the thing to test and i get an error

dr-spangle@dr-spangle-laptop:~/Desktop/ImageMagick-6.4.7-10$ /usr/local/bin/convert logo: logo.gif
/usr/local/bin/convert: error while loading shared libraries: libMagickCore.so.1: cannot open shared object file: No such file or directory

If you built it from source instead of installing from your package manager, you may need to make sure that the path where the libraries were installed (probably /usr/local/lib) is in /etc/ld.so.conf, and then run ldconfig.

dr-spangle
12-21-2008, 08:35 AM
include /etc/ld.so.conf.d/*.conf

/usr/lib/atlas

so do I add it to the bottom?

isomage
12-21-2008, 01:32 PM
Yeah. And then run "ldconfig" in the shell as root.

It's possible that it's already in one of the files referenced in the "include" line -- you could check the files in /etc/ld.so.conf.d/ to make sure, so you're not repeating. Run "ldconfig" in either case.

dr-spangle
12-21-2008, 01:58 PM
ok, it worked :D
somewhat

the test function on their site "/usr/local/bin/convert logo: logo.gif" worked


the noise one didn't work so well



dr-spangle@dr-spangle-laptop:~$ convert -size 512x512 xc: -type Grayscale +noise Random -resize 4096x4096 -contrast +noise Laplacian -blur 2 -contrast /home/dr-spangle/Desktop/noise.png
convert: no encode delegate for this image format `/home/dr-spangle/Desktop/noise.png' @ constitute.c/WriteImage/1145.

isomage
12-21-2008, 02:17 PM
It's possible you don't have libpng installed, or ImageMagick was configured "--without-png", or both. If you don't want to fix that you could just use gif, since you know it works.

By the way, what distribution and version are you using?

dr-spangle
12-21-2008, 04:57 PM
Ubuntu 7.10

Any newer and my crappy wireless card fails...

Getting a new computer in January, thinking about a macbook, they tend to work apparently :P

This one is sort of falling apart:
http://80.42.17.23/Photos/Laptop/RIMG0903.JPG

Yes, that tape holds the screen up

Redrobes
12-21-2008, 06:45 PM
LOL, I like to see every last CPU cycle extracted from a PC before it dies :D

Dunno what to suggest for the file output other than to try a few types and see what saves out which you can use in Gimp.

isomage
12-21-2008, 08:08 PM
"identify -list format" will print a list of supported image formats.

dr-spangle
12-21-2008, 08:23 PM
using imagemagick I made this:
http://80.42.17.23/noise3.gif

I used GIMP to make it greyscale and then upped the constrast to 20

then i burnt it onto this map:
http://80.42.17.23/zoomed%20maps/Try%206/3.png

and it produced this:
http://80.42.17.23/check_with_scott_or_andreas2.png

:?

Soixante
02-21-2010, 10:21 AM
I still cannot get this to work in PS (CS3).... delgondahntelius' method doesn't seem to give the desired results. I've tried numerous variations of the methods described here and still I don't get a good looking coastline.

Anyone that knows how to do this in PS and can give a very step-by-step description of exactly how they do it? I'd really appreciate it.

RobA
02-22-2010, 11:33 AM
The links don't work for me :( Can you upload the images here? (Many users will not click on external links for safety's sake)

-Rob A>