Image storage

KCM Core keeps track of repeatedly inserted images and stores each image only once in the result document. This is done regardless of the dimensions and placement parameters of the image.

If images are obtained from external sources or stored with excessively high resolutions, you can store a downsampled copy of the image with a resolution that better matches the purpose of the document. If the document is processed further, such printed or converted to PDF, you should include the original image.

The resample parameter controls how the image is stored.

  • "" / omitted : the image is stored without modifications.
  • number or number,png : the image is downsampled to the indicated resolution and stored in the PNG format.
  • number;jpeg : the image is downsampled to the indicated resolution and stored in the JPEG format.

The PNG image format uses lossless compression but is less efficient than the JPEG compression. You should not recompress JPEG images as this can result in recompression artifacts and significant quality loss.

Images are never upsampled. If the image is rendered at a resolution below the resample value, this option is ignored and the original image is stored.

An example is provided here.

 @(insert_image (watermark;
resample:="600;jpeg"))

The preceding example includes the image and downsamples it to a 600 DPI JPEG file.