I'm checking how well GDAL works on a Mac to convert IMG files, at least in a rudimentary manner. I am able to do this with some files from a USGS Earth topography database. I wonder if their IMG format is the same thing as in the PDS?

I've been having some trouble getting the results I expect from IMG2PNG. It's probably user error but I'm wondering if someone can help me. I'm trying to create a full 16-bit displacement map for the moon. The Tiff files available here (http://wms.lroc.asu.edu/lroc/view_rdr/WAC_GLD100) are only 8 bit. I've downloaded all of the .img PDS files to try and produce correct 16-bit images but I'm having no luck. Running the converter tells me that sample_bits=16 but the PNG file produced is severely clipped. The resulting PNGs have black and white data ranging from 0 to about 0.05. I've tried using -fneg and also playing around with -fStretch without much luck. These are processed LROC images so I didn't think I needed any kind of calibration files. Am I incorrect? If anyone has any clues, I would very much appreciate it.

I've been having some trouble getting the results I expect from IMG2PNG. It's probably user error but I'm wondering if someone can help me. I'm trying to create a full 16-bit displacement map for the moon. The Tiff files available here (http://wms.lroc.asu.edu/lroc/view_rdr/WAC_GLD100) are only 8 bit. I've downloaded all of the .img PDS files to try and produce correct 16-bit images but I'm having no luck. Running the converter tells me that sample_bits=16 but the PNG file produced is severely clipped. The resulting PNGs have black and white data ranging from 0 to about 0.05. I've tried using -fneg and also playing around with -fStretch without much luck. These are processed LROC images so I didn't think I needed any kind of calibration files. Am I incorrect? If anyone has any clues, I would very much appreciate it.

Have you tried the -s switch (like -s1024) to multiply all the pixels by a number?

I took a look at this and it's a bug in IMG2PNG that should soon be fixed. The problem is that 'normal' images usually do not contain signed data (and therefore no negative values) but this is a DEM and DEMs obviously can contain negative values. IMG2PNG recognizes some files as DEMs and handles them correctly but this DEM is 'unknown' to IMG2PNG. I'll probably add a new command line parameter to make it possible to tell IMG2PNG that the input file is a DEM in case IMG2PNG doesn't correctly recognize it as a DEM.

I've been having some trouble getting the results I expect from IMG2PNG. It's probably user error but I'm wondering if someone can help me. I'm trying to create a full 16-bit displacement map for the moon. The Tiff files available here (http://wms.lroc.asu.edu/lroc/view_rdr/WAC_GLD100) are only 8 bit. I've downloaded all of the .img PDS files to try and produce correct 16-bit images but I'm having no luck. Running the converter tells me that sample_bits=16 but the PNG file produced is severely clipped. The resulting PNGs have black and white data ranging from 0 to about 0.05. I've tried using -fneg and also playing around with -fStretch without much luck. These are processed LROC images so I didn't think I needed any kind of calibration files. Am I incorrect? If anyone has any clues, I would very much appreciate it.

This has now been fixed and a new IMG2PNG version is now available. I added a new command line option (-force_dem) which forces IMG2PNG to treat the input file(s) as a DEM if possible (the sample type must be signed which is the case for all of the DEMs I've seen).

It has come to my attention that for some reason the upload of the new IMG2PNG version mentioned in the preceding post didn't succeed - the old version did not get replaced. So if you have downloaded the new version above to get the improved DEM handling you need to do so again - I have verified that this time the upload succeeded. Sorry for the inconvenience.

I am recently handling the viking orbiter raw images, and in some images there are so many vertical missing lines that they are almost unreadable. I have found a software which can be found at http://petermasek.tripod.com/viking.html .Not only can it eliminate the vertical missing lines, it also removes some white speckles that appear in some VO images and performs contrast stretch. But the software can only process one image at a time, which makes it extremely inconvenient.I would love IMG2PNG to include some of these features of this software(if possible)!

I'm checking how well GDAL works on a Mac to convert IMG files, at least in a rudimentary manner. I am able to do this with some files from a USGS Earth topography database. I wonder if their IMG format is the same thing as in the PDS?

I've struggled with converting IMG files on my MAC, too. In the course of my experimenting with HiRise files, I stumbled on the fact that I can load IMG files directly into FITS Liberator. For anyone not familiar with it, this is readily available freeware. I have been using it for years to do initial histogram stretch on my astro-photography FITS files. Turns out it does what I need for IMG conversion very smoothly. I convert the fairly large HiRise 32 bit DTM files into 16 or 32 bit TIF files to work with in other software. FITS Liberator has a variety of non-linear histogram stretch options. For DTMs I do a linear stretch using the black and white point samplers.

I'm not sure that this meets the needs folks are mentioning here, but it might be worth a try.

IMAGE COPYRIGHT
Images posted on UnmannedSpaceflight.com may be copyrighted.
Do not reproduce without permission. Read
here for further information on space images and copyright.

OPINIONS AND MODERATION
Opinions expressed on UnmannedSpaceflight.com are those of the
individual posters and do not necessarily reflect the opinions
of UnmannedSpaceflight.com or The Planetary Society. The all-volunteer
UnmannedSpaceflight.com moderation team is wholly independent
of The Planetary Society. The Planetary Society has no influence
over decisions made by the UnmannedSpaceflight.com moderators.

SUPPORT THE FORUM
Unmannedspaceflight.com is a project of the Planetary Society
and is funded by donations from visitors and members. Help keep
this forum up and running by contributing
here.