ycc2rgb <outext><imagefile><w,h,d, [ppi] [>] [-raw_out ]
[-nonintrlv ]
[-YCbCr H0,V0:H1,V1:H2,V2]
Ycc2rgb takes as input a raw pixmap file containing an uncompressed color YCbCr image and converts its pixels to the RGB colorspace. Two output file formats are possible, a NIST IHead file (the default) or a raw pixmap file (specified by the -raw_out flag).
The color components of YCbCr pixels in a raw pixmap file may be interleaved or non-interleaved. By default, ycc2rgb assumes interleaved color pixels. Note that interleaved input produces interleaved output, and likewise, non-interleaved input produces non-interleaved output. Results from non-interleaved input should be explicitly stored in a raw pixmap file, because the IHead format only supports interleaved pixels. (See INTERLEAVE OPTIONS below.)
It is possible that the component planes of the input YCbCr image have been previously downsampled. If so, the -YCbCr flag must be included on the command line listing the appropriate component plane downsampling factors. If downsampling is specified, then ycc2rgb conducts appropriate upsampling of the YCbCr component planes prior to RGB conversion. By default, this utility assumes no downsampling. Regardless of downsampling, the conversion from RGB to YCbCr and back to RGB will not result in the same exact image. Some pixels values will be slightly perturbed due to the round-off of the floating point transformations that are applied. (See YCbCr OPTIONS below.)
All switch names may be abbreviated; for example, -raw_out may be written -r.
the extension of the RGB output file. To construct the output filename, ycc2rgb takes the input filename and replaces its extension with the one specified here.
the input raw pixmap file containing the color YCbCr image to be converted.
the attributes of the input image in the raw pixmap file.
the pixel width of the pixmap
the pixel height of the pixmap
the pixel depth of the pixmap
the optional scan resolution of the image in integer units of pixels per inch.
specifies that the results should be stored to a raw pixmap file.
specifies that the color components in the input raw pixmap file image are non-interleaved and stored in separate component planes. The -raw_out flag should always be used in conjunction with this option. (See INTERLEAVE OPTIONS below.)
this option, if provided on the command line, indicates that the YCbCr component planes of the input image have been previously downsampled. Ycc2rgb uses the listed factors to conduct upsampling of the YCbCr component planes prior to RGB pixel conversion. If all the H,V factors are set to 1 then no upsampling is required; this is equivalent to omitting the option. (See YCbCr Options below.)
The color components of YCbCr pixels in a raw pixmap file may be interleaved or non-interleaved. Color components are interleaved when a pixel's Y, Cb, and Cr components are sequentially adjacent in the image byte stream, ie. YCbCrYCbCrYCbCr... . If the color components are non-interleaved, then all Y components in the image are sequentially adjacent in the image byte stream, followed by all Cb components, and then lastly followed by all Cr components. Each complete sequence of color components is called a plane. The utilities intr2not and not2intr convert between interleaved and non-interleaved color components. By default, ycc2rgb assumes interleaved color pixels. Note that interleaved input produces interleaved output, and likewise, non-interleaved input produces non-interleaved output. Results from non-interleaved input should be explicitly stored in a raw pixmap file, because the IHead format only supports interleaved pixels.
Ycc2rgb converts color YCbCr images to the RGB colorspace. A common compression technique for YCbCr images is to downsample the Cb & Cr component planes. Ycc2rgb can handle a limited range of YCbCr downsampling schemes that are represented by a list of component plane factors. These factors together represent downsampling ratios relative to each other. The comma-separated list of factor pairs correspond to the Y, Cb, and Cr component planes respectively. The first value in a factor pair represents the downsampling of that particular component plane in the X-dimension, while the second represents the Y-dimension. Compression ratios for a particular component plane are calculated by dividing the maximum component factors in the list by the current component's factors. These integer factors are limited between 1 and 4. H,V factors all set to 1 represent no downsampling. For complete details, ycc2rgb implements the downsampling and interleaving schemes described in the following reference:
W.B. Pennebaker and J.L. Mitchell, "JPEG: Still Image Compression Standard," Appendix A - "ISO DIS 10918-1 Requirements and Guidelines," Van Nostrand Reinhold, NY, 1993, pp. A1-A4.
For example the option specification:
-YCbCr 4,4:2,2:1,1
indicates that there has been no downsampling of the Y component plane (4,4 are the largest X and Y factors listed); the Cb component plane has been downsampled in X and Y by a factor of 2 (maximum factors 4 divided by current factors 2); and the Cr component plane has been downsampled in X and Y by a factor of 4 (maximum factors 4 divided by current factors 1). The utility rgb2ycc converts RGB pixmaps to the YCbCr colorspace, and it conducts downsampling of the resulting YCbCr component planes upon request. Note that downsampling component planes is a form of lossy compression. If downsampling was applied to an input image, ycc2rgb takes the downsamples planes and upsamples them prior to RGB conversion. Note that even without downsampling, the conversion from RGB to YCbCr and back to RGB will not result in the same exact image. Some pixels values will be slightly perturbed due to the round-off of the floating point transformations that are applied.