png image to .ter file easy?

Started by Ty, March 23, 2009, 09:57:46 PM

Previous topic - Next topic

Ty

I looked around for an answer and could not find anything that deals with creating a heightfield that is compatible with Terragen from a .png image.  Is there a straight forward way to do this?  I'm using a Mac, but also have a PC, so either solution is fine.  Are people getting USGS data and working it up, saving it as a .png or .tiff file type and then importing to Terragen?  What would be best workflow?

Thanks Ty

neuspadrin

Terragen also accepts .bmp or .tga for heighfields, which should be no problem to convert from a png.  You don't need to put it as a .ter, thats just the default terragen accepts.  Just when choosing the file to open, change the file type to select down to .bmp or .tga depending on what you are importing, and then it should import it.

Ty

Thanks for the info and quick reply.  Also I just noticed that GrassGIS supports exporting the map, which has lighting data as well as view angle data embedded, in several different file types.  I just would like to know the best way to export and then import, where there is the least amount of data lost from the map.

neuspadrin

I don't believe file format is the limiting factor with importing terrains quality.  I think it has more to the data resolution, and how many meters it covers.

Seeing as all a heightmap really is, is a bunch of values between white and black, black being low, white being high values, and the pixel represents one datapoint of height.  Example:  a 100x100 pixel hight map wont hold much quality/datapoints, especially when stretched across something like 10000x10000m in terragen.  However, 1000x1000 will look good, higher the resolution, better it looks.

Matt

The heightfield loader can import a lot more image formats than a first glance might suggest. If you select "All Files" in the dropdown file type selector and try to use your .png file, it is likely to work if it is an 8-bit greyscale or 24-bit RGB image. If your data is 16-bit greyscale, you are limited to .ter and .sgi in the current release, but for the upcoming release we have added support for some 16-bit formats including geotiff. 32-bit formats are not supported.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Ty

#5
Quote from: Matt on March 24, 2009, 03:09:17 AM
The heightfield loader can import a lot more image formats than a first glance might suggest. If you select "All Files" in the dropdown file type selector and try to use your .png file, it is likely to work if it is an 8-bit greyscale or 24-bit RGB image. If your data is 16-bit greyscale, you are limited to .ter and .sgi in the current release, but for the upcoming release we have added support for some 16-bit formats including geotiff. 32-bit formats are not supported.

Matt


Thanks Matt, I have read about the 16-bit stuff and I bet that could be the problem.  I'll try again after a trip through photoshop.   

Separately Neuspadrin, the point made about resolution, is very good information as well.  Point well taken.  Thank you  I'll keep that in mind as I trial and error my way through.

Also is this the best way?  Going from map --> pic --> heightfield?  I ask because the info from USGS can be brought out in many different formats, and then converted to something more acceptable to programs like Tarragen.

Ty


latego

Consider adding R32 file format (just C floats, written row-wise bottom to top, Intel byte order, no header). This file format is super simple and is the native "way of life" for World Machine and GeoControl. You can also use it with L3DT.

Bye!!!

gregsandor

"... but for the upcoming release we have added support for some 16-bit formats including geotiff."

Matt, does that mean .dem ?

Matt

Hi greg,

No, only 16 bit image formats supported by the FreeImage library. Only geotiff has been tester, however.

http://freeimage.sourceforge.net/features.html


Matt

Just because milk is white doesn't mean that clouds are made of milk.

gregsandor

Hey Matt, I shouldn't have said .dem -- I do prefer geotiff digital elevation models -- is that really going to be available to use without converting to .ter?

Matt

Yep. And if you get them with associated .tfw files (which you do from the Seamless data server), then you can georeference them too :) Actually you will be able to georeference any heightfield if you know the lat-long coordinates to enter manually, although geotiffs with .tfw file are also vertically scaled correctly.

Matt

Just because milk is white doesn't mean that clouds are made of milk.

gregsandor

#11
Awesome!