Image format translation for planetary science data

VICARIO is a Java library and command-line tool that converts images between planetary archive formats (VICAR, PDS3, PDS4, ISIS, FITS) and standard formats (TIFF, PNG, JPEG), keeping the label metadata. It is part of NASA's AMMOS Instrument Data Subsystem and is developed by JPL's Multimission Image Processing Laboratory.

Latest test run failed: 166 tests, 30 failed · 2026-10-23 17:47 UTC · commit cc8509d

114100.IMGNLA_406359343EDR_T0050104NCAM00505M1.IMGNLA_406359343EDR_M0050104NCAM00505M1.IMG1n128285132edn0000p1500l0m1.imgNLF_0100_0675828717_276EDR_T0040218NCAM00503_01_600J03.IMGNLF_0100_0675828717_276EDR_N0040218NCAM00503_01_295J03.IMGHorseHead.fitsF0378_3_FILE_13.BIDR

Public mission products (Mars 2020, MSL, MER, Cassini and others) decoded by the latest test run.

What it does

Reads planetary formats

VICAR, PDS3 (attached or detached labels), PDS4 images and tables, ISIS cubes, FITS and Magellan products.

Writes archive and standard formats

VICAR, PDS3, TIFF, PNG, JPEG, JPEG 2000 and raw, with data type conversion, regions, subsampling and band selection.

Keeps the metadata

Labels are carried across conversions. XSL transcoders map VICAR labels to PDS labels; PDS4 labels are generated from Velocity templates.

Plugs into Java ImageIO

The readers and writers register as ImageIO plugins, so ImageIO.read opens VICAR and PDS files directly.

Install

VICARIO 2.7.2 is published to Maven Central. It is built for Java 8 and tested on Java 17.

Maven

<dependency>
  <groupId>gov.nasa.jpl.ammos.ids</groupId>
  <artifactId>vicario</artifactId>
  <version>2.7.2</version>
</dependency>

Gradle

implementation("gov.nasa.jpl.ammos.ids:vicario:2.7.2")

Build from source

git clone https://github.com/NASA-AMMOS/vicario.git
cd vicario
mvn -U -Pshade clean install   # target/vicario-2.7.2-FAT.jar for the command line

Command line: jConvertIIO

The FAT jar runs the converter. Arguments are KEYWORD=value pairs; keyword names are not case-sensitive, and a true/false keyword given alone means true.

java -jar vicario-2.7.2-FAT.jar inp=<input> out=<output> format=<format> [KEYWORD=value ...]
java -jar vicario-2.7.2-FAT.jar HELP        # every keyword

VICAR to PNG

java -jar vicario-2.7.2-FAT.jar inp=image.vic out=image.png format=png

Floating-point image to an 8-bit PNG (stretched to 0..255)

java -jar vicario-2.7.2-FAT.jar inp=real.vic out=real.png format=png OFORM=BYTE

VICAR to PDS3 with an attached label

java -jar vicario-2.7.2-FAT.jar inp=image.vic out=image.img format=pds

PDS3 or PDS4 product to VICAR

java -jar vicario-2.7.2-FAT.jar inp=product.xml out=image.vic format=vicar

Cut out a region (x, y, width, height)

java -jar vicario-2.7.2-FAT.jar inp=image.vic out=region.vic format=vicar SOURCE_REGION=(10,10,200,100)

Quarter-size preview (every 4th sample and line)

java -jar vicario-2.7.2-FAT.jar inp=image.vic out=thumb.png format=png SUBSAMPLING=(4,4,0,0)

Batch: one conversion per line of jobs.txt, 4 at a time

java -jar vicario-2.7.2-FAT.jar ARGFILE=jobs.txt PARALLEL_BATCH=4

On recent JDKs, JAI prints a "Could not find mediaLib accelerator" warning; add -Dcom.sun.media.jai.disableMediaLib=true before -jar to silence it.

Keywords

The most used keywords. HELP prints the full list, including tiling and cache settings.

Input and output
INPInput file or http(s) URL.
OUTOutput file.
FORMATOutput format: vicar, pds, tif, png, jpg, jpeg2000, raw, ... (case-insensitive aliases).
ARGFILERead one set of arguments per line from a file (batch run).
PARALLEL_BATCHRun batch lines in parallel, N at a time, or AVAILABLE_CORES.
IMAGE_INDEXImage to read from a multi-image file (default 0).
SILENTNo printing to stdout.
Data type
OFORMOutput data type: BYTE, HALF, SHORT, USHORT, FULL, INT, REAL, FLOAT, DOUB, DOUBLE. Default: keep the input type.
RESCALERescale values into the new type (default true when OFORM changes the type).
RESCALE_CONSTANT, RESCALE_OFFSETExplicit scale and offset for the conversion.
VALID_MINIMUM, VALID_MAXIMUMUse this range instead of the data range when rescaling.
CLAMP(min,max): clamp values after reading.
Regions and bands
SOURCE_REGION(x,y,width,height): read only this region.
SUBSAMPLING(xStep,yStep,xOffset,yOffset): read every Nth sample and line.
READ_BANDSBands to read, from 0: READ_BANDS=0,1,2.
BANDSBuild a new image from these bands after reading.
SCALE(xFactor,yFactor,xShift,yShift): resample after reading.
2RGBExpand a single-band image to RGB.
PDS labels
XSLStylesheet that maps the input label to the PDS label. XSL=- uses the default in the jar.
PDS_LABEL_TYPEPDS3 (default), ODL3, MSL_ODL or PDS4.
PDS_STATSaddStatistics or calcStatistics: add image statistics to the label.
EMBED_VICAR_LABELEmbed the VICAR label in the PDS label.
PDS_DETACHED_LABEL, PDS_DETACHED_ONLYWrite a detached label, optionally without rewriting the image.
PDS_OBJECTWhich OBJECT of a PDS3 input label to read (e.g. RFL_IMAGE).
ADD_BINARY_HEADER, ADD_BLOBCarry the VICAR binary header into the output.
VELO_TEMPLATE, VELO_CONFIG, PDS4_NAMESPACE_FILEVelocity template and setup for a PDS4 detached label.
Help and debugging
HELPPrint the full keyword list.
PLUGINSList the registered ImageIO readers and writers.
XMLWrite the label as XML files (debugging).
DEBUGExtra debug printing.

PDS4 tables

java -cp vicario-2.7.2-FAT.jar jpl.mipl.io.util.ExtractTableJPL -c -o table.csv product.xml   # -w for fixed-width text

Java library

With VICARIO on the classpath, the VICAR, PDS3, ISIS and FITS readers are found through the standard ImageIO plugin lookup:

import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;

BufferedImage img = ImageIO.read(new File("image.vic"));   // VICAR, PDS3, ISIS, FITS
ImageIO.write(img, "png", new File("image.png"));

The source has the full API, including the label (metadata) classes and the PDS4 readers.

Formats

FormatReadWriteNotes
VICAR✓✓All data types and organizations (BSQ, BIL, BIP), binary headers and line prefixes.
PDS3✓✓Attached or detached labels; PDS3, ODL3 or MSL ODL labels written through XSL transcoders.
PDS4 images✓labelReads PDS4 array products; PDS4 labels are generated from Velocity templates.
PDS4 tables✓textExported to CSV or fixed-width text with ExtractTableJPL.
ISIS cubes✓ISIS2 / ISIS3 cube reader.
FITS✓Primary image HDU.
Magellan✓F-BIDR and resampled products.
TIFF, PNG, JPEG, JPEG 2000✓✓Through the Java ImageIO and JAI Image I/O plugins.
Raw✓Headerless pixel data.

Testing

Every change runs a feature test suite: the real jConvertIIO command against synthetic images and public mission products from the PDS, with each output decoded and compared pixel for pixel. The full suite runs on every merge to main and nightly, and publishes the report linked here.

Latest test run failed: 166 tests, 30 failed · 2026-10-23 17:47 UTC · commit cc8509d

Test proceduresTest report

Capabilities

Each capability is a feature in the test suite. Click one to read its test procedures: what each test does and what makes it pass. The tags count tests by the kind of testing (nominal, off-nominal, malformed input, lossless, mission data, ...). Passed excludes tests that document a known bug.

CapabilityTestsPassedFailed
VICAR image read/write
Reading and writing VICAR images in every data type (BYTE, HALF, FULL, REAL, DOUB) and organization (BSQ, BIL, BIP), in both byte orders, including degenerate shapes and damaged files.
suite 1 unit 1 nominal 29 lossless 18 legacy 3 off-nominal 3 malformed-input 1 regression 1
35314
VICAR binary headers and prefixes
Images with binary label headers and per-line prefixes (NLB/NBB): decoding them, and keeping the prefix bytes when converting to VICAR or PDS (KEEP_LINE_PREFIX, ADD_BINARY_HEADER).
mission-data 4 lossless 2
422
PDS3 products
Reading PDS3 products (attached and detached labels, dual PDS3/VICAR labels) and writing PDS3 with an embedded VICAR label, file name in the label, or ODL3 labels.
suite 1 unit 4 nominal 4 lossless 5 mission-data 7 regression 1 legacy 1
16142
PDS label transcoding (XSL)
Building PDS labels from VICAR labels with the bundled XSL stylesheets, the default stylesheet (XSL=-) and the legacy mission recipes.
nominal 3 lossless 3 legacy 3 mission-data 2 off-nominal 1 regression 1
550
PDS4 images
Reading images through PDS4 XML labels; the PDS4 view must match the attached-label view of the same data.
mission-data 4 lossless 2 nominal 1
440
PDS4 tables
Exporting PDS4 tables (character, delimited) as CSV or fixed-width text, with the bundled ExtractTableJPL tool and jConvertIIO's PDS4_TABLE_* keywords.
nominal 4 off-nominal 1
523
ISIS cubes
Reading ISIS2 cubes with SFDU labels, such as Cassini VIMS spectral cubes (ISIS3 cubes are not supported).
nominal 2 mission-data 1
202
FITS images
Reading FITS images and converting them to other formats.
mission-data 1 lossless 1
110
Magellan products
Reading Magellan F-BIDR radar image strips (full-resolution basic image data records). The resampled format (MgnResampImageReader) has no public sample and is not tested.
mission-data 2
211
Output formats
Every FORMAT= name and alias used by the legacy test (TIFF, PNG, JPEG, JPEG 2000, JPEG-LS, BMP, PNM, RAW, PDS, VICAR, ISIS), for 8-bit, 16-bit and float images.
legacy 29 lossless 20 nominal 25 off-nominal 2 regression 1
392613
Data type conversion
Changing the output data type (OFORM) with or without rescaling, clamping, and float data to 8-bit display formats.
nominal 8 legacy 1 regression 1 lossless 1 mission-data 1
871
Regions, subsampling and bands
Cropping (SOURCE_REGION, CROP), subsampling, scaling, band selection and reordering (READ_BANDS, BANDS), single band to RGB (2RGB), and PNG alpha (WRITE_TRANSPARENCY).
nominal 9 off-nominal 1 regression 3 lossless 2
1091
XML metadata and parser security
Label DOM utilities and XML debug output (XML=true), with every XML parser hardened against external entity (XXE) attacks.
suite 1 unit 5 nominal 1 security 2 malformed-input 2 regression 1
990
Batch, streaming and remote input
Batch runs from an argument file (serial and parallel), files without extensions, output to stdout, and https input from the public PDS archive.
nominal 3 lossless 4 off-nominal 1 regression 1 mission-data 1
541
Visual check (replaces JADE review)
Every output a person would look at decodes to an image of the right size that is neither blank nor saturated, with a preview in the report. Replaces opening each output in the JADE viewer in the legacy procedure; the viewer itself is not tested.
legacy 8 nominal 1 mission-data 7
880
Python label scripts
The Python utilities in src/main/scripts: xml_swap.py (replace, list and show modes, XXE hardening) and build_mesh_extras.py (mesh label extras, path validation).
nominal 3 security 2 malformed-input 1 regression 2 off-nominal 1
550
PDS4 label generation (Labelocity)
Generating detached PDS4 labels from Velocity templates with the public Labelocity release (PDS4 writer and mission templates) and the vicario build under test. Generated labels must match the archive label's array structure and read back to the same pixels.
mission-data 2 nominal 2
220