A filter that performs a conversion of color space, alpha, or pixel format.
- iOS 10.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 10.0+
- Metal Performance Shaders
MPSImage filter allows you to change the alpha encoding or color space of an image. For example, you can convert an image with a premultiplied alpha to non-premultiplied, or change the color space from one variant to another.
As with all Metal Performance Shaders filters, the conversion filter allows for source and destination textures with different pixel formats and, in that case, will convert the source texture's format to the destination texture's format. See Supported Pixel Formats for Image Kernels for a list of supported pixel formats.
Listing 1 shows how you can create an image conversion filter to map the color intensity from the sRGB color space to a linear gamma curve.