ic

Image Conversion utility.

ic is a command line tool that converts image files to the optimized Pyramid TIFF format (PTIFF). While Image Serving can process images without conversion, we recommend that you convert all images larger than 512x512 pixels to PTIFF. This conversion ensures optimal server performance and resource usage and minimizes response times.

It is recommended that PTIFF files that contain photographic content be JPEG-encoded (specify -jpegcompress). Computer-generated contents can benefit from lossless compression (either -deflatecompress or -lzwcompress). Unless a color conversion or pixel type conversion is required, JPEG source image data is transferred to the PTIFF without decoding, to avoid quality degradation. In this case, the specified compression options apply only to the lower resolution pyramid levels.

If you are not converting large images you do not have to set the parameters that control how much memory to use. However, if you are, give ic more memory by using the -maxmem setting described below. A good rule of thumb for computing the amount of memory required is to multiply the width of the image times the height of the image times the number of channels. For example, four for an RGB image with alpha times three. In addition, if the channels are 16-bits per component instead of 8 double the final result.

Usage

ic -convert [options]sourceFiledestFile

ic -convert [options]sourceFolderdestFolder

-c -convert [options]sourceFiledestFolder

options

Command options (see below).

sourceFile

Single input image file.

destFile

Single output PTIFF file (not valid if used with SourceDirectory).

sourceFolder

Folder containing input images.

destFolder

Folder to which output PTIFF files are written.

Returns

0 if successful. If an error occurs, a nonzero value is returned and error details are sent to stderr.

Options

-uncompressed

Do not compress the output image.

-deflatecompress

Use deflate (zip) compression (default).

-lzwcompress

Use Lempel-Ziv-Welch (LZW) compression.

-jpegcompress

Use JPEG encoding. Ignored if sourceFile includes alpha data.

-jpegquality < quality >

JPEG quality (0-100; default is 95).

-fullsamplechrominance

Disable JPEG chroma-downsampling (can improve quality of color text and graphics). This has no effect on output images that are CMYK or grayscale.

-usm < amount > < radius > < threshold > < monochrome >

Apply unsharp-masking to subsampled pyramid levels. See op_usm= for details. (Not applied to the full resolution image.)

-applyClippath

Use the clip path in the source file, if any, to create associated alpha data.

-dpi < dpi >

Print resolution (dpi) for destFile ; if not specified, the print resolution of srcFile is copied to destFile .

-autocrop < corner > < mode > < tolerance > < infoFile >

Calculate a crop rectangle to minimize a solid color background. No crop info is output if the auto-crop algorithm would result in the entire image being cropped.

To calculate the crop rectangle without converting the image, specify -autocrop without -convert and without destFile.

corner – ul | ur | ll | lr

Specifies which corner of the image to use a seed point. Ignored if mode is 1.

mode – 0 | 1

Set to 0 to crop based on the color of the specified corner pixel; works on premultiplied color data if alpha data is associated with the source image.

Set to 1 to crop based on alpha data; corner is ignored and 0 is always the seed value; no crop is applied if no alpha data is associated with the source image.

tolerance – Match tolerance. Real value 0.0 to 1.0. Specifies the tolerance for matching pixel component values. Set to 0 for exact matches.

infoFile – Path and name of the XML output file to which crop info data is written.

-embedXmpData

Copy XMP metadata, if available, from sourceFile to destFile without modification.

-embedColorProfile

Embed the ICC color profile in destFile , if available (no profile is embedded by default).

-imageprofile < file >

Path and name of an ICC profile file. Defines the color space of sourceFile and must match its pixel type. Should be specified only if no profile is embedded in sourceFile , as this overrides the embedded profile.

-viewprofile < file >

Path and name of an ICC profile file. Defines the pixel type and color space of destFile . IC converts to this profile if sourceFile has an embedded profile or if -imageprofile is specified as well.

-intentPerceptual

Perceptual render intent for color space conversions.

-intentRelColorimetric

Relative Colorimetric render intent for color space conversions (default).

-intentAbsColorimetric

Absolute Colorimetric render intent for color space conversions.

-intentSaturation

Saturation render Intent for color space conversions.

-cmsNoBlackPointCompensation

Disable blackpoint compensation for certain color conversions

Enabled by default.

-cmsNoDither8

Disable dithering (error diffusion) when color-converting.

-maintainpixeltype

Disable automatic conversion from CMYK to RGB.

- forceJPEGDecompress

Force decoding and re-encoding of JPEG input images.

Caution: Applying this option may reduce image quality.

-downsample2x2

Use standard quality (bi-linear) resampling filter.

-downsample8x8

Use higher quality (Lanczos window) resampling filter (default).

-downsample8x8FlashPix

Use higher quality (FlashPix) resampling filter.

-downsample8x8BicubicSharp

Downsample with Photoshop style 8x8 bicubic-sharp filter.

-nousage

When specified as the first option, suppresses output of usage info when invalid options are encountered.

-overwrite

Allow overwriting an existing destFile . By default, a numeric suffix is appended to the file name to prevent overwriting.

-skiphidden

Ignore hidden source files.

-continueonerror

Do not stop processing when an error occurs. Only has an effect when processing multiple files.

-logfile < file >

Path and name for the log file (defaults to stdout ).

-loglevel < level >

Log level.

< 0 – Logging disabled.

0 – List files to be processed.

1 – Add reporting for unneeded files.

2 – Add progress reporting.

3 – Add reporting on every file encountered.

4 – Add progress reporting at the file level.

-logappend

Append to log file (default).

-nologappend

Overwrite log file.

-logprogressmsec < msec >

Logging interval in msec for loglevel 2 and higher (default is 3000).

-maxmem < bytes >

Memory usage limit. Must be at least 10 MB.

-maxmempercent < percent >

Memory usage limit. Default is 25% of physical memory. If neither maxmem nor maxmempercent are explicitly set uses maxmempercent default.

-version

Return version info for this utility. Specify with no other options.

Supported Input Image Formats

The following table lists the image file formats and format options which are supported by IC.

Format

Pixel Type Bits/Chan

Bits/Chan

Compression

Notes

BMP

(Windows Bitmap)

RGB | indexed

1 | 5/6 | 8

uncompressed | RLE

5/6 bits/channel indicates support for 16-bit RGB (5-5-5 and 5-6-5 bits/channel).

EPS

(Encapsulated Postscript)

CMYK | RGB | gray

8

ASCII | ASCII85 | Binary | JPEG

Only EPS files generated by Photoshop are supported.

CompuServe

GIF

indexed

8

LZW

If present, the transparency value in the palette is converted to alpha.

JPG

(JFIF/JPEG)

CMYK | RGB | gray

8

JPEG

Photoshop

PSD

CMYK | CMYKA | RGB | RGBA | gray | grayA

1 | 8 | 16

uncompressed | compressed

Merged image only; layers and extra channels are ignored.

Macintosh

PICT

RGB

8

RLE

Bitmap data only; vector data is ignored.

PNG

RGB | RGBA | gray | grayA | indexed

1 | 2 | 4 | 8 | 16

compressed

TIFF

CMYK | CMYKA | RGB | RGBA | gray | grayA | indexed

1 | 8 | 16

uncompressed | ZIP | LZW | JPEG | CCITT RLE | CCITT G3 | CCITT G4 | Packbits

With the exception of the first associated alpha channel, extra channels are ignored.

Embedded ICC profiles are recognized in EPS, JPG, PSD, PNG, and TIFF files.

Embedded paths and XMP metadata are recognized in EPS, JPG, PSD, and TIFF files.

Examples

Convert a single image at best quality and keep it in the same folder:

ic -convert src/myFile.png src/myFile.tif

Convert all images in srcFolder to JPEG-encoded pyramid TIFFs and place in destFolder:

ic -convert -jpegcompress -jpegquality 90 -overwrite -continueOnError srcFolder destFolder

Convert all images in srcFolder. The encoded image data of JPG files is used for the full-resolution level, loss-less LZW compression for the remainder of the image pyramid of these images as well as for the entire output image of all non-JPG input files. The pixel types, embedded color profiles, XMP metadata, etc. are maintained.

ic -convert -lzwcompress -embedXmpData -embedColorProfile -maintainpixeltype -overwrite -continueOnError srcFolder destFolder

On this page