-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for transforming PDS3 image files to 16-bit output #15
Comments
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. |
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. |
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.
Currently all images are output to 8bit formats.
The text was updated successfully, but these errors were encountered: