JPEG-2000 File Interchange Format .JP2 Export Automation Options

 

When the program is driven from an automation script, an options string can be specified in the script that acts as the export options dialogs do in the program. The string consists of comma-separated parameters, which specify the behavior of the various export options.

 

Parameter

Type

Description

Filter

string

JPG2000

ColorDepth

 -32, -16, -8, 1, 4, 8, 24, 32

Specifies the color depth to use.

ColorDepth=-32 -- 32 bit greyscale output

ColorDepth=-16 -- 16 bit greyscale output

ColorDepth=-8  -- 8 bit greyscale output

ColorDepth=1 -- 1 bit color indexed output

ColorDepth=4   -- 4 bit color indexed output

ColorDepth=8   -- 8 bit color indexed output

ColorDepth=24  -- 24 bit true color output

ColorDepth=32  -- 32 bit true color with alpha output

ColorReductionMethod

1, 2, 3, 4, 5

Specifies the color reduction method to use.

ColorReductionMethod=1 -- Use the Ordered Dither color reduction method

ColorReductionMethod=2 -- Use the Diffused Dither color reduction method

ColorReductionMethod=3 -- Use the Popularity color reduction method

ColorReductionMethod=4 -- Use the MedianCut555 color reduction method

ColorReductionMethod=5 -- Use the MedianCut888 color reduction method

FormatJ2K

0 or 1

Sets the Container Format

0 = JP2 container

1 = J2K container

HDPI

integer

Sets the number of horizontal pixels in the exported image that corresponds to a distance one horizontal inch.  Either a Width or an HDPI option may be specified, but not both.  The default HDPI is the resolution of the display device driver on your computer (this is 96 dots per inch on many Windows display devices, but number can very from device to device).

Height

integer

Sets the height of the exported image in pixels.  Either a Height or a VDPI option may be specified, but not both

KeepAspect

0 or 1

If this is set to 1, for any of the settings Height, Width, HDPI or VDPI you only need to set one option and Voxler will automatically calculate the other parameters in line with the aspect ratio of the input image.

KeepAspect=0 -- Do not retain the aspect ratio

KeepAspect=1 -- Do retain the aspect ratio

KeepPixelSize

0 or 1

Locks the pixel dimension width and height. Changes to the VDPI and HDPI will affect the document size, but not the pixel size, when this is set to 1. Changes to the VDPI and HDPI will affect the pixel dimensions, but not the document size, when this is set to 0. Note that the KeepPixelSize option is ignored if the either the Width or Height option is specified.

ModuleID

integer

Numeric ID of the module to be exported.

 

0=entire viewer window

2=default

Quality

integer from 0 to 100

Represents a percentage of original image quality which the output image has. Higher value = higher quality. 100 = highest quality. 1 = lowest quality.

VDPI

integer

Sets the number of vertical pixels in the exported image that corresponds to a distance of one vertical inch.  Either a Height or a VDPI option may be specified, but not both.  The default VDPI is the resolution of the display device driver on your computer (this is 96 dots per inch on many Windows display devices, but number can very from device to device)

Width

integer

Sets the width of the exported image in pixels.  Either a Width or an HDPI option may be specified, but not both.

 

Example

This example shows how to export an JP2 file with the various options.

 

CommandApi.Construct("Export")

CommandApi.Option("GuiEnabled", "False")

CommandApi.Option("ClearOptions", "False")

CommandApi.Option("Filter", "jpg2000")

CommandApi.Option("Options", "HDPI=83; Height=361; PreviewColor=0; Quality=70; VDPI=83; Width=498")

CommandApi.Option("Path", "C:/Path/To/Export/file.jp2")

CommandApi.Option("PersistOptions", "True")

CommandApi.Option("ModuleId", "2")

CommandApi.Do()

 

Used by: Export

 

 

See Also

Automation Model