![open an img file open an img file](https://i.ytimg.com/vi/uvockUCVwUM/mqdefault.jpg)
(I like TextPad.) Text editors don't do well at interpreting binary data. You'll find the answer if you attempt to open the image in your favorite text editor. Look at its file properties and you'll see it's pretty close to the expected 262,144 bytes, but not quite.
OPEN AN IMG FILE DOWNLOAD
Download an image at random, like this one from Phoenix sol 7. You can find these images either at the Imaging Node or the Geosciences Node of the PDS. So a 512-by-256-pixel image with 16-bit pixels will contain (512 x 256 x 2 =) 262,144 bytes of image data, with each pixel represented by the 2 bytes necessary to record the 16-bit number corresponding to the digital number for that pixel.Ī size of 512 by 256 by 2 bytes describes the archival data for the Phoenix Robotic Arm Camera, which I picked for this post because the images are nice and small. It's just binary data, where every pixel is listed, in order, from left to right and top to bottom, using however many bytes are necessary for the bit depth of an image. IMG is a very straightforward image format. (Note: there are a couple of data sets for which the PNGs are just as good, but that's another blog post.) If you have gone to the trouble of finding an image product in the PDS, you really ought to work with the archival-quality IMG file rather than the substandard JPG or PNG. The JPGs or PNGs are usually not has high-quality as the IMG files - JPG files because they have lossy compression, of course, but for either JPGs or PNGs there may have been an automatic contrast stretch applied, and 32- or 16-bit data gets reduced to 8 bits. Often there is also a browse image product in JPG or PNG format. There's an archival data product that usually has a IMG extension. Spacecraft image data exists in NASA's Planetary Data System (PDS) in several different formats.
![open an img file open an img file](https://2.bp.blogspot.com/_yBZxOIReqOw/TJDRQFTjNwI/AAAAAAAABrE/gbIPt3B_srA/s1600/afs+explorer.png)
![open an img file open an img file](https://cdn.openthefile.net/winzip/otf1_300x250.png)
OPEN AN IMG FILE HOW TO
But when I just need to open one or a few images to do quick-and-dirty image processing, it's overkill, and there are some data sets it doesn't know how to handle. I am a big fan of the IMG2PNG tool created by Björn Jónsson, which can batch-convert large numbers of files at once. It explains how you can open archival NASA science data directly in Photoshop without needing to use any other tools. This post will be a little arcane for most readers of this site, but I hope it will be a useful trick for those of you who are into spacecraft image processing.