Skip to main content
Skip table of contents

Downsampling of masked images


Introduction

When using makoconverter with output parameters that control image downsampling, the results are not always as expected. This may be because the image content is a masked image. For example, converting a PDF containing 300dpi color images, one might expect to use:

Downsampling

CODE
makoconverter MyInput.pdf MyOutput.pdf ColorImageDownsamplingResolution=96 ColorImageDownsamplingThreshold=96

However, masked color images will not be downsampled. Instead, it's necessary to downsample the mask, and Mako will apply the same downsampling to the related image. Use these parameters to achieve that end.

Settings to retain the mask at 1-bit per pixel

CODE
makoconverter MyInput.pdf MyOutout.pdf MonoImageDownsamplingResolution=96 MonoImageDownsamplingThreshold=96 MonoImageDownsamplingMethod=subsample

Setting the downsampling method ensures the mask can be compressed correctly (using CCITT) for the output, but this means a hard edge to the mask. To retain as a soft mask, use the following alternative:

Settings to retain a soft mask, ie 8-bits per pixel

CODE
makoconverter MyInput.pdf MyOutout.pdf MonoImageDownsamplingResolution=96 MonoImageDownsamplingThreshold=96 GrayImageCompression=flate

These settings can be combined to cover both cases.

Image downsampling

CODE
makoconverter MyInput.pdf MyOutput.pdf ColorImageDownsamplingResolution=96 ColorImageDownsamplingThreshold=96 MonoImageDownsamplingResolution=96 MonoImageDownsamplingThreshold=96 GrayImageCompression=flate

Controlling downsampling of the mask and image separately

A setting introduced in Mako 4.6.0 and later allows the mask and the image to be treated separately (that is, the image and the mask could be downsampled to different resolutions).

For example:

Use of UseMaskResolutionForMaskedImages

CODE
makoconverter MyInput.pdf MyOutput.pdf UseMaskResolutionForMaskedImages=false MonoImageDownsamplingResolution=72 MonoImageDownsamplingThreshold=72 GrayImageCompression=flate ColorImageDownsamplingResolution=150 ColorImageDownsamplingThreshold=150  

These settings would result in the image resampled to 150dpi while the mask is at 72dpi.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.