Page 1 of 1

Png2Ter - Convert PNG file to Elevation Grid!

Posted: Wed Jun 21, 2017 8:54 am
by Flake
Png2Ter v1.0

Image
About
Similar to Grigors AutoHotKey based elevation grid generator, this program converts a greyscale PNG to a YSFlight Elevation Grid file (TER). This program does NOT use AHK and only relies on .NET 3.5, so users of WinXP+ should be able to use this program without issue!

Instructions
  1. BACK UP YOUR CURRENT FLD FILE! I am NOT responsible if this program breaks and you lose ALL your work! You've been warned!
  2. Draw a Grid Plan PNG file in such a way that a 0% brightness pixel, that is #000000 would be elevation 0 meters and a 100% brightness pixel, that is #FFFFFF would be the maximum height of the grid. See included Example folder for a demo of this.
  3. Open Png2Ter and set the desired parameters, this may require some experimentation on your part!
  4. DRAG AND DROP your PNG representation of the desired elevation grid onto the program, it will generate the grid for you.
  5. Import generated grid into SceneryEditor, set Zero Elevation Faces to be invisible, and apply color gradation as desired.
  6. Save your new FLD - You're done!
Notes
Please adjust colors, face visibility etc. in Scenery editor!

Also note grids are quite large - you should make many small grids rather than one large grid, so please use multiple PNG files of each mountain rather than blobs of mountains!


GIMME DAT!
(DOWNLOAD NOW!)

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Wed Jun 21, 2017 9:41 am
by Zack
Flake wrote:
Wed Jun 21, 2017 8:54 am
ou should make many small grids rather than one large grid, so please use multiple PNG files of each mountain rather than blobs of mountains!
You can't tell me what to do! :lol:

Great work flake, you're making me want to do maps more often now! Thanks for this. :D

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Wed Jun 21, 2017 11:26 pm
by Catraille
I'm just a random passerby, but if anybody around here is interested in creating a .ter of real location, QGIS might help you make a grayscale height image.
http://qgis.org

Tutorials can be found here:
http://johnflower.org/tutorial/getting-height-maps-qgis
http://johnflower.org/tutorial/export-h ... t-composer

Note: I can't test whether the method described in the site above works (I'm a Mac user, so I can't run this program. I hope I could!), so just take it as a random idea. If this method doesn't work please tell me. I will delete this post.

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Wed Jun 21, 2017 11:40 pm
by Flake
That looks promising. I tried other programs already but never found this. Hopefully it's good!

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Thu Jun 22, 2017 9:29 am
by u2fly
There are many ways how do same task in Blender - https://www.versluis.com/2017/06/how-to ... n-blender/
One issue that not solved for do it usable for Blender - there no scripts for export terrain mesh to TER-file for YSFlight.
I will try make this script for both YSFS 1.x (for Blender 2.49b) and YSFS 2.x (for Blender 2.7X) add-ons as soon as possible.

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Thu Jun 22, 2017 10:07 am
by Barr
You could also rewrite this to make a png2fld or pc2 ;)

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Thu Jun 22, 2017 11:36 pm
by Kujo
u2fly wrote:
Thu Jun 22, 2017 9:29 am
One issue that not solved for do it usable for Blender - there no scripts for export terrain mesh to TER-file for YSFlight. I will try make this script for both YSFS 1.x (for Blender 2.49b) and YSFS 2.x (for Blender 2.7X) add-ons as soon as possible.
Hey, making this would actually be a serious improvement and advancement in making scenery. I'd want to try it out once it's done

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Thu Jun 22, 2017 11:38 pm
by Nodoka Hanamura
Impressive. I can see it being used to import Heightmaps into YS sometime down the line.

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Fri Jun 23, 2017 6:10 am
by Flake
Quoting OP wasn't necessary, removed...

Yeah that's sort of the goal actually.

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Sun Jun 25, 2017 9:49 am
by Dragon_Mech
this could be very helpful in making canyon maps and setting most of the foundation work for tunnels and caverns. i may have to learn to make maps and play with this.

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Sun Jul 16, 2017 1:19 pm
by Welshy
Flake will this work fine with DEM imported grayscales? If so this could be a game change!

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Sun Jul 16, 2017 1:41 pm
by Flake
It measures based on the luminosity value of the pixel. Greyscale is what I personally use.

Re: Png2Ter - Convert PNG file to Elevation Grid!

Posted: Sun Jul 16, 2017 2:48 pm
by Welshy
This therefore means real world Digital Elevation models can be used. As a note to all scenery devs, NASA distributes files of the earths terrain which can be broken down and converted to TIFFs easily which then converting to grayscale PNGs will be perfect