Jump to content

heightmap import improvement


Recommended Posts

Hello and thanks for your development effort,

In the past I have been strugling with heightmap import when mapmaking following palaxin's heightmap guide and written some posts in the forum regarding this:

The persisting problem I have experienced when importing a heighmap is that the image imported appear to be limited to 8-bit grayscale (or 24 bit RGB, but grayscale, which in practice is the same) whereas 0ad an its map editor allows 16-bit different heights. This fact is stated in the response of another post showing an import error. So, if the editor allows 16-bit height, why not allowing 16-bit grayscale images?

I am convinced that mapmakers do not usually have enough technical background to deal with this and the suggestion of modifying the PMP map file by hand in a HEX editor is discouraging. So as I see it there would be two possible ways of improving the heightmap impor:

  1. Modify the code that import the image file allowing other options that can contains 16-bit images (such as TIFF or RAW) in order to edit the map in 16-bit already in your favourite editor.
  2. Write a plugin for your preferred image editor so that PMP files can be saved directly from image data and publish it. Open source community usually prefer GIMP, I use ImageJ, but any (free) image editor shall be picked.

As I am not a programmer I cannot afford doing this by myself, however I encourage the development team to make a small effort in order to encourage mapmaking enthusiasts.

 

Greetings.

  • Thanks 2
Link to comment
Share on other sites

Yes !!! We need that !

16 bits import ability is the only missing link between elevation files and the Atlas. I have a GIMP plugin nearly ready, for the creation of elevation files, but I'm hesitant to publish since the import learning curve is too high.

Your idea of a GIMP plugin for .pmp export is nice too, that would perfectly fill the gap. Before anyone asks, I don't think I would be able to write such a plugin with my current python level. :-) I might still try to look at it in the (not near) future if nothing moves on this front.

Link to comment
Share on other sites

A temporary solution I found, useful if you are not confident with copy-pasting into a hex editor, is with a nice little command line utility: Swiss File Knife.

It's multiplatform, and doesn't even require an installation. Just put the executable near your files and run it in a terminal.

The useful command it provides is "partcopy", which allows to copy part of a binary file to another.

An example command, to transfer elevation from a 385x385 uncompressed 16 bits greyscale .tif to a large .pmp :

./sfk partcopy [source_name].tif 8 296450 [map_name].pmp 16 -yes

The number in the middle is the number of bytes. It must be adapted to the map's size:

map size        tif(px) bytes
-----------------------------
normal          257     132098
medium          321     206082
large           385     296450
very large      449     403202
giant           513     526338 

 

Edited by Scallact
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...