You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for transforming PDS3 image files to 16-bit output #15
Is your feature request related to a problem? Please describe.
Per user request, would like the capability to convert a 16bit PDS3 image to a 16bit output viewable image format.
I'd say the current processing is a bug where it just linearly scales for example the raw EDR files from Perseverance Rover SignedMSB2 (16 bit) to 8 bit PNG or 8 bit TIFF. The time of 8 bit numbers of image intensity is over for many years now.
Or does some other free software exist to convert the current Mars 2020 raw images on current macOS? NASAView for example isn't available anymore for current macOS.
I looked a bit into the code around src/main/java/gov/nasa/pds/transform/product/Pds4ImageTransformer.java and the 8 bit output appears to be caused by the JAI image writer outside of the PDS tools, but I'm not 100% sure yet. At least the used gov.nasa.pds.objectAccess.ImageExporter is producing internally 16 bit arrays (ElementArray.getDataType() returns SignedMSB2) though later that's reduced to 8.
Even enforcing with ((TwoDImageExporter)exporter).setTargetPixelDepth(16) didn't help. Still 8bit output.
Switching to the latest versions of the PDS loader libraries didn't help either. It's simple, just change in pom.xml:
If it's due to the old JAI, a solution may be to replace that by https://eclipse.github.io/imagen/migration which uses internally the newer javax.imageio.ImageIO. But even the old JAI already supported 32bit/channel images and at least 16bit/channel PNG writing.
Activity
isenberg commentedon Aug 13, 2022
Same for PDS4.
I'd say the current processing is a bug where it just linearly scales for example the raw EDR files from Perseverance Rover SignedMSB2 (16 bit) to 8 bit PNG or 8 bit TIFF. The time of 8 bit numbers of image intensity is over for many years now.
Or does some other free software exist to convert the current Mars 2020 raw images on current macOS? NASAView for example isn't available anymore for current macOS.
Example: Download EDR pair of .IMG/.XML from the _raw directories of https://pds-imaging.jpl.nasa.gov/data/mars2020 and then run it:
In case anyone is wondering about how to build the jar with dependencies here from source. Add the following lines in pom.xml after
With that a simple git clone and mvn package is needed to build it on OpenJDK 8.
isenberg commentedon Aug 15, 2022
In case others want to give it a try:
I looked a bit into the code around src/main/java/gov/nasa/pds/transform/product/Pds4ImageTransformer.java and the 8 bit output appears to be caused by the JAI image writer outside of the PDS tools, but I'm not 100% sure yet. At least the used gov.nasa.pds.objectAccess.ImageExporter is producing internally 16 bit arrays (ElementArray.getDataType() returns SignedMSB2) though later that's reduced to 8.
Even enforcing with ((TwoDImageExporter)exporter).setTargetPixelDepth(16) didn't help. Still 8bit output.
Switching to the latest versions of the PDS loader libraries didn't help either. It's simple, just change in pom.xml:
If it's due to the old JAI, a solution may be to replace that by https://eclipse.github.io/imagen/migration which uses internally the newer javax.imageio.ImageIO. But even the old JAI already supported 32bit/channel images and at least 16bit/channel PNG writing.