Menu

Free software for 16-bit Image processing?

Help
Onsemeliot
2013-07-11
2013-07-11
  • Onsemeliot

    Onsemeliot - 2013-07-11

    It drives me crazy: Inkscape and GIMP are great tools for working in 8-bit color depth. But from time to time I want to generate maps with higher level differences. In those cases I soon end up with a very pumpy road since 256 levels are not enough for that.

    I searched for a long time, but didn't find anything working so far. I have even used ImageMagick for converting 8-bit images into 16-bit images by applying a blur. It technically works, but it doesn't really help since the pumpy surface just gets converted into clean steps. It obviously doesn't create the missing values in between.

    Even if I directly convert an SVG-image to png with ImageMagick I get the same result. ImageMagick doesn't seem to render 16-bit values between starting point and endpoint of gradients but gets the roughly integer values from Inkscape and converts the whole thing to 16-bit after interpreting the svg as 8-bit image. (ImageMagick potentially could interpret it's own vector format, but this doesn't support gradients in other angles than horizontal or vertical. Therefore this wouldn't help either since even if I do a lot of linear gradients by hand in Inkscape in order to cover all directions the road may bend to I would still need to use different angles.)

    Geomorph doesn't seem to help either since I want to get roads which height variations along the road, but not across the road i.e. not tilting sideways. Or is there a way of drawing smooth streets in Geomorph without unpredictable outcomes? (Unfortunately Geomorph is not in the Debian repository and I'm not very fond of trying out things which could potentially mess up my system.)

    To actually get this done in GIMP at the moment I duplicate the normally quite rough basic terrain layer (usually it's the effect "difference clouds" from "rendering") and use a strong gaussian blur on it. (20 to 40 pixel blur radius is sufficient for a 512 pixel map.) This erases tiny high and low peaks and makes it smoother over all. It's right, when driving on it isn't pumpy any more.

    Next I set the road in Inkscape to a very thin stroke. (Most of the time 3 pixels are perfect.) I export the slim street line as an png with transparency by using whole page export and: "hide all except selected". This file I import in GIMP as a layer and use it as a mask on the blurred terrain layer. I apply the mask. This leaves the smoothened terrain only where the core line of the street was. At this stage there isn't much to see. The relevant magic happens now:

    I use a small gaussian blur on the layer with the slim terrain line again. This time with a rather small radius of about 3 pixels. Using the gaussian blur on the line makes it bolder, but partly transparent. By duplicating this layer the now a little bolder line gets more solid as well since the not yet solid areas add up. I merge the layers with the blurred terrain line down to one. In the next step I do the blurring with a larger radius. Let's say 5 to 7 pixels. Then I keep on blurring (with an increasing radius), duplicating and merging until I'm satisfied with the thickness of the resulting road.

    The emerged layer with a road-wide band has the desired height variations in driving direction but it has quite blurry edges. (If the edges of the road are to blurry I can use an other mask derived from the layer with the Inkscape street line by growing and feathering the original selection of it.)

    To a certain degree this all works quite well, but it doesn't help if I want to have large height differences in my maps. In my opinion height differences are a very important aspect of good map design and I hate to be limited in that regard.

    So far I didn't find any free software enabling me to edit height maps in a similar (or better) way, but producing 16-bit png files as output. I even wanted to use blender, but I have red it supports only 8-bit images as well...

    Does anyone have a hint for me?

     

    Last edit: Onsemeliot 2013-07-11
  • qubodup

    qubodup - 2013-07-11

    I can only recommend to accept the limitation and be guided by it in designing levels.

     
  • Onsemeliot

    Onsemeliot - 2013-07-11

    Today I discovered, that one of my most serious problem in the last days was, that it's not a good idea to use high resolution images in Trigger Rally.

    Tracks get much smoother if the horizontal scaling is larger than 2. If it is smaller it gets increasingly pumpy. So even if it is possible to get a greater detailed surface projection with a not that far stretched surface texture it still is no good idea to go for it - at least if you want to avoid serious pumps.

    The greater the horizontal scaling, the smoother the track...

     

Log in to post a comment.