Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Moon Phase
CURRENT MOON

NASA IMG Conversion for LROC Images

View previous topic View next topic Go down

NASA IMG Conversion for LROC Images

Post  Copernicus on Sat May 21, 2011 10:00 pm

Hello everyone! If you’re interested in lunar anomalies then you know that LROC is orbiting the moon and taking high resolution photos, and these photos are available online to view and download. The online Zoomify viewer is helpful, but the images are so big that it would be much easier to just download the image and use your own photo software to view and enhance it.

All of the LROC images are available in a format called IMG, which is not readable by standard graphic programs, and there is no info to help with it. Only a very few “featured” images are available in a format (TIF) viewable with most graphic programs.

But wait… each image does have a TIF available! It’s something they call a PTIF, labeled as multi-resolution lossy compression. These 8-bit TIF’s are about 25MB, which is only 10% of the file size of the 8-bit featured TIF’s and the 8-bit EDR IMG files, which are both about 260MB. Though this TIF image is the same size as the original, I believe it is basically a software-generated preview image of the 16-bit CDR IMG file (which is usually about 516MB). Photoshop seems to be the only program that will open these TIF’s, and most people will not want to work with a poor quality image like this.

So… we have all these IMG files available and nothing to open them with!

Anyway, I spent many hours searching for a solution… and I never did find anything that will convert the 16-bit CDR IMG to another 16-bit image format… but I came up with 2 solutions for working with the 8-bit EDR IMG’s.

NASAview

This program is available here for Solaris, UNIX/LINUX, Mac and Windows. You will have to input a name and email address to download the file.

NASAview will allow you to view most NASA image files and also save them as gifs or jpgs (in parts). If you want to view the 16-bit CDR IMG files (516MB) rather than the 8-bit EDR files (260MB) then you will have to use NASAview. You should realize that it only saves chunks that are 5000 pixels in height… and it only saves them as 8-bit gifs or 8-bit jpgs. Most of the LROC IMG’s are 5024 x 52224 in size, so we’re looking at 11 chunks. (8 bit = 256 color/grayscale, 16 bit = 65536 color)

PDS IMG Reader

The second solution, and the one that I prefer, is called PDS IMG Reader. Though you can preview the image file in parts, the main purpose of the program is to convert the IMG to BMP format. PDS IMG Reader will not convert 16-bit IMG files but it can convert a single 8-bit IMG file to a single 8-bit BMP file. It takes quite a while to do it, so patience is required.

The program requires the user to enter some values found in the IMG file header, so some people may prefer to use NASAview. I was going to show how to actually use PDS IMG Reader, but the instructions in the program’s readme file are fairly clear. If you don’t do it properly the BMP is completely black. You may find that a 52224 pixel height BMP won’t open in your graphic program, or the file size is too big to work with. In that case, you can easily split the IMG file into chunks similar to NASAview.

PDS IMG Reader is here at the bottom of the page… you’ll notice some other interesting utility programs here as well, such as Crater Shadows Simulator, Spacecraft Angles and LROC WAC Previewer. Thanks are in order to Jim Mosher for posting these programs.

There we go! Hopefully this will help everyone, and we’ll see some nice anomalies from LROC NAC’s posted!!!

C
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Jackie (Admin) on Sat May 21, 2011 10:34 pm

Excellent information - Thank you!

cheers
avatar
Jackie (Admin)
Admin

Posts : 444
Join date : 2011-05-13

http://signal.forumotion.com

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Copernicus on Wed Jul 13, 2011 1:04 am

I thought I’d post a bit of update on the PTIF’s that I mentioned above.

During the last big NAC upload in June, the new IMG files were there, but you couldn’t browse them with Zoomify until the new P-TIF’s were uploaded. After that, Zoomify worked as per usual on the new IMG’s, so obviously Zoomify uses the P-TIF’s.

Now, I’ve used Zoomify a lot, so I’d say that the P-TIF’s aren’t as bad as I originally thought. They are definitely not as clear as the IMG’s, but are a quick and easy way to look at some of the NAC’s… but only if you have Photoshop, which is the only graphics program that seems to be able to open them. (I haven’t tried Gimp, though).

C
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Jackie (Admin) on Wed Jul 13, 2011 8:57 am

I'll give it a try this afternoon. I would love to get even part of the views you get! Appreciate the update-
avatar
Jackie (Admin)
Admin

Posts : 444
Join date : 2011-05-13

http://signal.forumotion.com

Back to top Go down

IMG vs PTIF and Zoomify

Post  Copernicus on Sat Aug 06, 2011 10:21 pm

I’ve finally had a chance to do a proper comparison between the LROC 8-bit IMG’s, the lossy 8-bit P-TIF’s and the images available online with Zoomify, and here are the results. I uploaded these comparison images as BMP’s so that there’s no additional image artifacts introduced by compressing the images to JPG’s. (Note: Photobucket converted the BMP’s to JPG… erggh! Mad )



In the first image, a comparison at 100% between the IMG and the P-TIF shows no noticeable difference other than the P-TIF having higher contrast / brightness.



In the second image, I’ve magnified each of these by 400%, and fringes and image artifacts are clearly visible in the P-TIF image, but not in the IMG image. The fringes in the P-TIF are so bad that they actually change what is displayed in the image. Bear this in my mind for the Zoomify comparison.



The same image taken from a Zoomify screen capture shows the same results as the P-TIF, which is interesting, since Zoomify uses the P-TIF… I thought it would’ve been worse, actually.

A reminder here that you need the PDS Image Reader to convert IMG files to a useable form, and that so far only Photoshop seems to be able to open a P-TIF image.

What should you use for the LROC NAC’s then?

Obviously if you can afford the bandwidth and disk space, and don’t mind doing the conversion, downloading the 8-bit IMG file is the way to go. The NAC was a small 40MB one in the example, but most 8-bit NAC’s are 250MB. Remember that if you keep the original NAC, after you convert it to BMP, it will take an additional 250MB of disk space, for a total of 500MB per NAC. Also, it’s quite possible that in a few years the NAC’s won’t be available to the public, so downloading them means you still have it. And they do change them too… they changed a heckuva lot of them last winter. I’m not exactly sure what they did, or why.

Now, if you’re limited in bandwidth and/or disk space, then the P-TIF is a good alternative… but only if you have Photoshop… and only if there’s no details you’d like to magnify. A standard 8-bit NAC in P-TIF form would be between 30-35MB as compared to 250MB.

Conclusion

For the casual anomaly hunter, using Zoomify is the obvious way to go. Bear in mind that your browser does do some downloading, but you might find this is still a lot better than the alternatives. It’s obvious that magnifying a Zoomify screencap is not an acceptable way to post anomalies, but it’s a good way to find them… and you can still post unmagnified caps.

I will add this: Zoomify is extremely awkward to use most of the time when you need to locate a small feature… particularly when the IMG must be flipped vertically and/or horizontally to match the actual lunar landscape. As mentioned before, Zoomify does not correct the NAC’s to their proper orientation. I don’t know if this is intentional or not, but if the Zoomify people are reading this, this bug really needs to be corrected!! sunny

C
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Copernicus on Sun Aug 07, 2011 12:47 pm

I had several reasons for choosing that particular NAC to use as an example in the previous post. First, the NAC was small and easily manageable.

Second, since this is a featured NAC, there is a “proper” TIF available for download. They don’t do this all that often. (ie. make available a TIF that can be opened by most graphics programs).

This article, Secrets of Schroteri, at the LROC site was originally pointed out by Exuberant1:

http://lroc.sese.asu.edu/news/index.php?/archives/314-Secrets-of-Schroeteri.html#extended

The article links to a page where the TIF can be viewed with Zoomify, and can also be downloaded:

http://wms.lroc.asu.edu/lroc_browse/view/M129635733RE

If you download the TIF you’ll discover that the file size (95MB) is over twice that of the original IMG file. Since this is an 8-bit TIF, the file sizes should’ve been pretty similar. When you open the TIF, you realize that the image has been corrected for proper orientation (flipped both vertically and horizontally), and we can overlook the fact that they failed to mention that…

But…

The features in the image appear larger, as if it’s at a different resolution than the original. A quick comparison shows that the IMG is 2532x16384, while the TIF is 3644x26877!



I am truly mystified at why they did this, but apparently the TIF has been rescaled up (larger), non-proportionally, believe or not, from the original IMG size!!

Well, I guess it was just an error, but this was something that I discovered 6 months ago, and they still haven’t fixed it. Virtually no one who downloads this TIF would realize that there is a problem with the image…

C

Hint: When anomaly hunting, it’s a good idea to pay attention to the image details.
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Copernicus on Sun Aug 07, 2011 6:50 pm

And now we come to the third reason that I chose this NAC as an example…

It would give me an opportunity to repost something I previously discovered in the NAC! Very Happy

We were having a nice discussion on Magic about the boulder field at the bottom of the hill (at the top of the image):



The source of the boulder field was the top of the hill (at the bottom of the image) and I happened to notice something there:



Do you see it? I missed it at first, too…



There’s a nice little 7-meter disk sitting there, plain as day!!

Yep, I know… it’s probably just another boulder…

This happens to be the only NAC of the area, unfortunately, and I’m waiting for another one… maybe in the next NAC upload in September??

C
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Jackie (Admin) on Mon Aug 08, 2011 8:40 pm

How fascinating! I would never have noticed that - Not with my glasses...Is there a scale to this? I can't tell if that is a tiny little critter close up or a great big critter far away...
avatar
Jackie (Admin)
Admin

Posts : 444
Join date : 2011-05-13

http://signal.forumotion.com

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Copernicus on Mon Aug 08, 2011 9:31 pm

Hmmm... I thought glasses were supposed to help? Wink

So, this image is more of an approximation that at 0.5 meters/pixel, but our VW bug should look somewhat like this at 0.7 meters/pixel...



C
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Jackie (Admin) on Tue Aug 09, 2011 9:30 am

Your VW will soon be famous, my friend.

Thank you for adding it!
Shocked Maybe these eyes will help me?
avatar
Jackie (Admin)
Admin

Posts : 444
Join date : 2011-05-13

http://signal.forumotion.com

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  lunarcaveguy on Tue Sep 13, 2011 9:53 pm

Hi,
To tell you what I used to view the giant *.img files (16 bit data), I used something called
Freeview, version 10.3, by a company called PCI Geomatics

I use it in USA so I do not know what their limitations on use in other countries. It has been a while since I got a version but it is free and a reputable company.

After getting it and installing it, run it and open the *.img file.

A dialog box appears and enter these data....

header bytes=0
pixels= (#of width pixels), lines=(# of height pixels), channels=1
data interleaving= pixel
data type=16 bit signed
byte order= lsb

it reads them very fast.

There are some weird differences ( line shifts, of course color differences) between the compressed tif products (browse) and these *.img but I have not been able to justify storing these, they are just too big. I don't even know how PDS can store them, they must have massive storage.



lunarcaveguy

Posts : 24
Join date : 2011-09-12

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Copernicus on Wed Sep 14, 2011 12:47 am

Hey James,

Thanks for the info on Freeview. I will try it out tomorrow, hopefully. For others interested, it requires personal info such as a phone number, etc, before download.

Check my earlier post comparing the P-TIF to the uncompressed IMG... maybe find it in PTIF and then get the IMG for rescaling up.

C
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  lunarcaveguy on Wed Sep 14, 2011 10:10 pm

Yes, you have reopened my eyes to the .img files which I always blew off as being not worth it. There are subtle differences which justify their use in some cases!

lunarcaveguy

Posts : 24
Join date : 2011-09-12

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Copernicus on Wed Sep 14, 2011 11:59 pm

So I've only had a brief look at Freeview, but it certainly opens the 8-bit IMG's fine. There's also controls for brightness and contrast, whereas PDS IMG viewer just has a gamma control which I never use.

One thing... to get the info required to open the IMG, I ended up using the PDS IMG viewer to read the header. Is there a way to do that from within Freeview, James?

Also, sorry, I didn't know about the 5-day rule... but I'd say it's a good deterrent for spammers. I thought maybe you were having problems with the Link command.

I will need to spend some more time with Freeview so that I can give a better idea of its capabilities.

C
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  lunarcaveguy on Thu Sep 15, 2011 10:13 pm

>To get the info required to open the IMG, I ended up using the PDS IMG viewer to read the header. Is there a way to do that from within Freeview?

Ah, no. How do you think I got Freeview to read the *.img file? Trial and error. Would never have got it right if the *.img file had a header!!! But it creates a special file if you open it once correctly. If you open it incorrectly, you must delete that file and completely close the file in Freeview to try again.

For data, I would either read the browse *.tif file to see what the width and height is or read the ASU LROC data on their web site to find this out or download the list of image data for all the images from the PDS repository (there is one file with that data).

Today we got the latest batch of LRO images online. Hopefully more Copernicus crater images!


lunarcaveguy

Posts : 24
Join date : 2011-09-12

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  lunarcaveguy on Fri Sep 16, 2011 9:05 pm

There were a few more Copernicus crater images, but nothing too exciting.

I did find out that one *.img file I downloaded didn't load right with Freeview (a dark thick line occurred in the middle of the Freeview display). I found out I had to add a line of pixels in the header (normally I had at zero)! Good grief!

lunarcaveguy

Posts : 24
Join date : 2011-09-12

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Copernicus on Fri Sep 16, 2011 11:27 pm

Hi James,

Yes, I noticed that it was looking for the total number of lines, so you have to add the header line. Some of the "small" IMG's have 2 header lines.

I'll try and do an evaluation of FreeView this weekend, and also I'd like to compare a proper TIFF (not a P-TIF) of an IMG with a BMP created from it. BMP's aren't necessarily compressed, so we'll see how it turns out.

Oh, and don't give up on Copernicus just yet Wink

What do you think about the idea of investigating Tycho for caves? There's some very interesting terrain just north of it, but not many NAC's of it. I haven't had a chance to check what's new there yet...

C


avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

IMG to BMP vs TIFF

Post  Copernicus on Sat Sep 17, 2011 5:17 pm

As promised, here’s a look at the difference between converting the NAC 8-bit IMG to BMP as opposed to using the 8-bit TIFF.

First off, I’d like to mention that we’re dealing with 8-bit image files here, and all of the following discussion is strictly about 8-bit files, though there are 16-bit NAC’s available. The TIFF’s and P-TIF’s that are also available are all 8-bit.

Second, whether the file is an IMG, a BMP or a TIFF (uncompressed, no Alpha channel), they are all about the same file size. Right away this says to me that none of the files are compressed since they all have the same color depth. Also, with no compression, the file size will be always be the same if the image has the same dimensions. (Photoshop reports the NAC TIFF’s as being uncompressed.)

So, here’s a comparison of a BMP (saved from PDS Image Viewer) with the original uncompressed TIFF of the same image, both at 400%, with no other changes. Just to be clear, I used PhotoShop to save the comparison TIFF (on the right) below, with no compression.



Although there might be a slight, subtle difference in shading, I can see no difference between the 2 images.

I would say, therefore, that it makes no difference whether you prefer to use BMP or TIFF.

However… my preferred graphics program saves TIFF’s with loss-less compression, making the file sizes about half the size of the uncompressed file size. This is a big incentive for those people with little disk space.

On the other hand, very few of the NAC’s are available as proper TIFF’s (not P-TIF’s) and therefore, it would take an additional step for me to convert the BMP’s made from PDS Image Viewer to TIFF’s, and this is already a long process.

So, I guess for your cave search programme, James, I suppose in the end it would depend on whether it’s easier to write the search function for uncompressed BMP’s or uncompressed TIFF’s.

C
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  lunarcaveguy on Sun Sep 18, 2011 10:32 am

>What do you think about the idea of investigating Tycho for caves? There's some very interesting terrain just north of it, but not many NAC's of it. I haven't had a chance to check what's new there yet...

Sure, it just takes alot of time.

lunarcaveguy

Posts : 24
Join date : 2011-09-12

Back to top Go down

FreeView 10.3 Review

Post  Copernicus on Sun Sep 18, 2011 1:16 pm

I felt that I should do a short review of this free application (thank you James) since it is one of only 3 applications that will open LROC IMG’s, and only the 2nd one that will open the 16-bit IMG’s.

The application is here:

http://www.pcigeomatics.com/

Go to the download page (sorry, the "?" in the link broke it for posting) and select the download link for Geomatica FreeView V10.3.

First off, as previously mentioned, you will have to provide an email address and a fair amount of personal information, including your phone number, in order to download the free application. They send the actual download link to your email address.

Installation was easy on my old XP Windows system, but it also installed MS Visual C++ 2005 (without asking). Many people will already have that installed.

Use… as James noted, you will have to determine what numbers to use in order to load an IMG file. If you already have PDS Image Viewer installed, then it is a relatively straightforward task to get the header information from that. Otherwise… well… not so easy.

This alone will deter most people from using FreeView for IMG files.

The viewer itself was fast to move around the IMG file (at least on a “small” IMG), and had a number of controls, such as brightness and contrast, but there was no way to save any portion of the IMG at all, let alone to save it to another image file format. The best that you can do is a screencap.

Also, I didn’t see a way of determining the x and y coordinates of your cursor, which is something I like to know when I’m moving around an image.

Given that this application is strictly a viewer only, I think that most people would find NASAView (also free) to be a better choice for simply viewing IMG’s.

C

avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Jackie (Admin) on Sun Sep 18, 2011 5:00 pm

Thanks for comparing te programs, C. I imagine this will help those of us greenies that are oh so tempted to try what you and lunarcaveguy are doing, but were maybe intimidated by the technology.
avatar
Jackie (Admin)
Admin

Posts : 444
Join date : 2011-05-13

http://signal.forumotion.com

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  lunarcaveguy on Mon Sep 19, 2011 8:40 pm

>You will have to determine what numbers to use in order to load an IMG file. Otherwise… well… not so easy.

The size of the image of interest is in ....
http://wms.lroc.asu.edu/lroc/search
You must enter the image ID number to get it, but I assume you know which image you want.
If you enter that in the first line of the search page, then hit search, a list of candidate image links is presented at the bottom of the page. Clicking on the relevent link brings up a page like.....
http://wms.lroc.asu.edu/lroc/view_lroc/LRO-L-LROC-2-EDR-V1.0/M109134835LE

Paging down on that page brings up this data...
Image lines 52224 (height of image in pixels)
Line samples 5064 (width of image in pixels)

What I haven't figured out is how many lines to add to the header input. I start with 0, then one line's amount of pixels (5064 in the above case) and then try more multiples if that doesn't work.

>there was no way to save any portion of the IMG at all, let alone to save it to another image file format. The best that you can do is a screencap.

Yes! That is a bother. But is so quickly loads giant entire images to view, that somewhat makes up for it.

> didn’t see a way of determining the x and y coordinates of your cursor, which is something I like to know when I’m moving around an image.

These should be in the lower left part of the image. Also, there is a box that you can bring up to look at the integer values of a box of 20 by 20 pixels which I think has the cooridnates too.


lunarcaveguy

Posts : 24
Join date : 2011-09-12

Back to top Go down

Update on Loading IMG Files

Post  Copernicus on Fri Feb 24, 2012 10:02 pm

For those of you who would prefer not to use the PDS IMG converter, I have discovered a little trick that works with the 8-bit IMG files so that you can load them into most graphic programs!

Yes! Very Happy

If your graphic program supports the RAW image format, you can simply load the IMG file as a RAW file! This won’t work, of course, if your graphics program doesn’t support the image sizes commonly used with the IMG files (like mine). You can still load some of the smaller IMG’s this way, though.

You will need to know the image dimensions listed on the Zoomify page for the IMG, and you will also need to know how many bytes there are in the IMG header. Since the number of header bytes is usually 5064, you’re all set! You may also have to rename the IMG file extension to RAW for your program to handle it.

I could not get this to work properly for the 16-bit IMG files, however.

Anyway, after comparing an IMG converted with PDS IMG converter with one that I converted directly, I found that the brightness and contrast was much better in the image done with the PDS converter.

Don’t forget to orient the image properly!

C

avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  MysteryShySoul on Wed Feb 29, 2012 7:00 pm

Thanks Copernicus that is very cool information. It neat to know how you view these in such detail.

Take care
Rhiannon
avatar
MysteryShySoul

Posts : 11
Join date : 2011-05-28
Age : 34
Location : Washington State

Back to top Go down

New NAC Upload

Post  Copernicus on Sun Jun 17, 2012 1:43 pm

Well, the latest upload of images on the LROC site came on Friday, June 15, and it’s always great to get new images! Smile

Unfortunately for me, the only new images in my areas of interest were all low res at about 1.0 to 1.25m/pix. I noticed there was even a pair at 3.5m/pix, harkening back to the Lunar Orbiter era in the 1960’s. Sad

*sigh*

Let’s hope that September’s upload includes some actual high res images!!

C
avatar
Copernicus

Posts : 227
Join date : 2011-05-21
Location : Moon

Back to top Go down

Re: NASA IMG Conversion for LROC Images

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum