• Welcome to SC4 Devotion Forum Archives.

importing 16bit png file

Started by SchlauFuchs, November 14, 2012, 11:41:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SchlauFuchs

Hello,

I'm trying to use the import 16bit png function from sc4 mapper. I used a geotiff elevation data file, transformed it to png16 but the result didn't seem right in mapper. I wrote a little java image processor to produce a png16 following some specs from other forums (16 bit unsigned, .1 precision, 0 = -250m )  and produced a png that looks pretty black. SC4 mapper accepts it but the result looks like the the scenery of a bad Kevin Costner movie. Is there any sourcecode available to test this things out and to locate the issue?

Or does anyone have contact details if the creator?

Cheers,
Kai

cogeo

Welcome to SC4D!

The format "specs" you mention are right. For example, a 20m elevation would be represented as a (gray) value of 20x10 + 250x10 = 2700 (convert this to 16-bit int). So if your code is OK, play with the png format options if any, eg compression, planar configuration maybe, or that little/big endian thingy. Also check for implicit conversions carried-out by java itself.

SC4TF/M were written in Python, while for the 16-bit PNGs an "external image library" was used, the creator said.

SchlauFuchs

Hi,

I got a good step forward, there was a bug in my solution and the next try produced a nice region. I have to fine-tune my geotiff a bit because there is currently everything a tiny bit too high but then this could be declared as something useful for more SC4 fans.