IDOMImage Filters
📌 Overview
Mako provides several filters that operate on an IDOMImage. These are both convenient and powerful, making complex image processing a matter of a few lines of code.
ℹ️ Table of filters
Filter | Purpose |
|---|---|
| An image filter that presents one of the following:
|
| An image filter that presents an identical image, just with the color space substituted. |
| An image filter that presents a color converted version of an image. The target color space must be a base space; i.e., no DeviceN or Indexed spaces. |
| An image filter that presents an image with the edge pixels repeated.
|
| An image filter that presents a downsampled version of an image, using subsample, average or bicubic downsampling. |
| An image filter that presents an upsampled version of an image, using bicubic or bilinear upsampling. |
| An image filter that presents an image source and color combination as a plain image with an alpha channel, with all pixels colored with the given color. Useful for simplifying an |
| An image filter that presents an image with an Indexed color space as a simple 8-bit image. |
| An image filter that presents an image with a |
| An image filter that merges selected spot components into the process components of an image. This is conceptually similar to
|
| An image filter that presents a bitwise inverted form of the source image. |
| An image filter that removes a Matte and undoes premultiplication for a PDF Matte'd image and soft mask. The resulting image does not have alpha, and can be used with the mask to generate the desired result. |
| An image filter that presents an image as an image with a different bits-per-sample, e.g. converting a 16-bit image to 8-bit. |
| An image filter that presents a masked image where colors within a given range are masked out, analogous to a green screen. The source image must not have a mask or alpha channel. |
| An image filter that applies a PDF/PS style Decode array to the image contents. For details on decode arrays, please see "Decode Arrays" on page 344 of the PDF Reference, version 1.7. The bit depth of the result may be promoted to 8- or 16-bits per component, depending on the situation. |
💪 Usage
For example, when Mako loads a CMYK JPEG, the image is inverted. The simplest way to solve this is to add an inverter:
const IJawsMakoPtr mako = IJawsMako::create();
...
if (newImage->getImageType() == eDITJPEG && newImage->getImageFrame(gMako)->getNumChannels() == 4)
newImage = IDOMFilteredImage::create(mako, newImage, IDOMImageInverterFilter::create(mako));
var mako = IJawsMako.create();
...
if (newImage.getImageType() == eDOMImageType.eDITJPEG && newImage.getImageFrame(mako).getNumChannels() == 4)
newImage = IDOMFilteredImage.create(mako, newImage, IDOMImageInverterFilter.create(mako));
⌨️ Code Examples
For an example that use the IDOMImageBitScalerFilter filter, see Visual Studio Projects/GetPartialImage, Java Projects/GetPartialImage, or Python Projects/GetPartialImage
☑️ Conclusion
The IDOMImage filters in Mako provide a versatile and efficient way to perform complex image processing tasks with minimal code. By leveraging these filters, users can manipulate images in various ways, such as changing color spaces, downsampling, or inverting images. The examples provided demonstrate the practical application of these filters, showcasing their power and convenience.
📚 Additional Resources
If you need additional help, see our API documentation for detailed information on class/method usage, or raise a support ticket via our customer portal.