ImgDoc_SaveInBLOB_JSN

Save the image document into a BLOB.
ImgDoc_SaveInBLOB_JSN(imgDocRef;optionsJSON) ➔ imageData
imgDocRef Text The image document reference.
optionsJSON Text Options in JSON text.
↩︎ imageData BLOB Output BLOB.

Save the image document into a BLOB.

Parameter imgDocRef is the image document reference.

The output image is returned in imageData.

The optional parameter optionsJSON is a 4D object serialized in JSON format. Various saving options can be specified:

General Options
Property name Type Default Description
Format String The image doc’s original format.

The option’s value specifies the format to save in.

The format must support encoding.

When saving document containing more than one frame to a single-frame format (anything but TIFF and PDF), only the first frame is saved.

EmbedThumbnail Boolean False

Set to True to embed thumbnails to the output file.

The format must support embedded thumbnails.

ApplyOrientation Boolean Depends on format.

By setting this to true, the pixels are transformed according to the image orientation property and the orientation is set to up-right (kImgOrientationNormal).

The default behavior depends on the value of the image orientation property, and also on the destination format. If the destionation format supports the orientation property, the default is false. Otherwise the default is true.

Lossy Compression
Property name Type Default Description
LossyCompressionQuality Real 0.75

Effective when saving to a lossy format, this option’s value is a real number in the range of 0.0 to 1.0, specifying the image quality.

The higher this number is, the higher the quality of the saved image will be at the expense of larger file size. Lower numbers produce smaller files, at the expense of lower image quality.

Recompress Boolean False The saving operation is optimized to avoid re-compression of lossy image data, when possible. To force re-compression, set this to True.
TIFF Compression
Property name Type Default Description
TIFFMonochromeEncoding Longint kTIFFCompressionCCITTFax4

The TIFF compression method for black and white images.

Can be one of: kTIFFCompressionNone, kTIFFCompressionCCITTRLE, kTIFFCompressionCCITTFax3, kTIFFCompressionCCITTFax4.

TIFFGrayscaleEncoding Longint kTIFFCompressionLZW

The TIFF compression method for grayscale images.

Can be one of: kTIFFCompressionNone, kTIFFCompressionLZW, kTIFFCompressionDeflate.

TIFFColorEncoding Longint kTIFFCompressionLZW

The TIFF compression method for color images.

Can be one of: kTIFFCompressionNone, kTIFFCompressionLZW, kTIFFCompressionDeflate.

Multiframe Progress Options
Property name Type Default Description
ProgressDelay Real 1.0 The delay, in seconds, before the progress starts.
ProgressCallback String "" The name of the project method that will be called with progress information.

The progress callback method has the following signature:

ProgressCallback (event; progress): success

event Longint Progress event: 1 = start, 2 = update, 3 = end.
progress Real Progress value: [0.0-1.0], or -1 if indeterminate.
success Longint Return # 0 to continue, or 0 to cancel.

Note

The ImgDoc_SaveInBLOB method in Q2PixLib is a wrapper to this method that passes the options parameter directly as a 4D object instead of a JSON serialization.