PICTools Programmer's Reference
OP_D2S, OP_D2SE, OP_D2SEPLUS

OP_D2S, OP_D2SE, OP_D2SEPLUS: Compress DIB to sequential JPEG

See the DIB_INPUT: OP_D2S section for additional information. In particular, the values for LumFactor, ChromFactor and SubSampling can be adjusted to increase the compression ratio with lower image quality, or to decrease the compression ratio with higher image quality.  The PIC_PARM Head structure must have valid BITMAPINFO data for the DIB prior to REQ_INIT.  If Head.biBitCount is 4 or 8, then ColorTable must be initialized to the DIBs color table so that the DIB pixel color values can be correctly evaluated.

Input formats (Head.biCompression) are BI_RGB (4/8/16/24/32 bpp RGB and 4/8 bpp gray), BI_RGB565 (16-bit RGB 5-6-5), BI_RGBA (32 bit RGB compressed with alpha channel), BI_CMYK (32-bit compressed as 4-component), BI_GR12 (9-16 bit gray compressed as 12-bit JPEG -- OP_D2SEPLUS only), BI_UYVY, BI_YUY2, BI_YV12, or BI_IYUV (planar and interleaved YUV formats).  Set Head.biCompression to BI_RGBA to compress a 32-bit RGBA image as a 4-component JPEG image by also compressing the alpha channel information.  Planar YUV formats require that the entire image be present in the Get queue before compression.

This opcode provides allows the image data to be protected using a key provided by the application. See details in the section describing the PIC_PARM KeyField field.

Color JPEG Output Image

A. No color table in output, standard JFIF output

B. Input is DICOM YBR_FULL_422

The DICOM specification uses the identifier YBR_FULL_422 to specify that the YBR pixels are subsampled 4-2-2 (equivalent to Pegasus 2-1-1), that the subsampling is cosited, and that the input pixel component sample intensities range from 0 to 255. This is in conflict with the JFIF specification which specifies that the subsampling is averaged and not cosited. In order to create DICOM-compliant color jpeg images from YBR_FULL_422 input images, the following steps are taken:

Input is BI_YUY2 or BI_UYVY

C. Input is DICOM YBR_PARTIAL_422

The DICOM specification uses the identifier YBR_FULL_422 to specify that the YBR pixels are subsampled 4-2-2 (equivalent to Pegasus' 2-1-1), that the subsampling is cosited, and that the input pixel component Y sample intensities range from 16 to 235 and Cb and Cr sample intensities range from 16 to 240. This is in conflict with the JFIF specification for which specifies that the subsampling is averaged and not cosited. In order to create DICOM-compliant color jpeg images from YBR_PARTIAL_422 input images, the following steps are taken:

Input is BI_YUY2 or BI_UYVY

D. Output is CMYK Color JPEG

CMYK JPEG files can be created from CMYK input color data

Input is interleaved C-M-Y-K

Gray Scale JPEG Output Image from Color DIB Input

This can't be done directly with this opcode.  The DIB must first be converted to gray scale before being compressed.

Gray Scale JPEG Output Image from Gray Scale DIB or RAW Input

A. 1-8 bpp gray DIB data

B. 1-8 bpp gray RAW data

C. 9 - 12 bpp gray RAW data

Metadata

JPEG metadata can be added to the JPEG image by supplying metadata in the PIC2List. The following metadata operations are supported:

Notes

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback