<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGBlendMode",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@E@CGBlendMode"
  },
  "title" : "CGBlendMode"
}
-->

# CGBlendMode

Compositing operations for images.

```
enum CGBlendMode
```

## Overview

These blend mode constants represent the Porter-Duff blend modes. The symbols in the equations for these blend modes are:

- R is the premultiplied result
- S is the source color, and includes alpha
- D is the destination color, and includes alpha
- Ra, Sa, and Da are the alpha components of R, S, and D

You can find more information on blend modes, including examples of images produced using them, and many mathematical descriptions of the modes, in *PDF Reference, Fourth Edition*, Version 1.5, Adobe Systems, Inc. If you are a former QuickDraw developer, it may be helpful for you to think of blend modes as an alternative to transfer modes

For examples of using blend modes see “Setting Blend Modes” and “Using Blend Modes With Images” in [Quartz 2D Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001066).

## Topics

### Constants

[`CGBlendMode.normal`](/documentation/CoreGraphics/CGBlendMode/normal)

Paints the source image samples over the background image samples.

[`CGBlendMode.multiply`](/documentation/CoreGraphics/CGBlendMode/multiply)

Multiplies the source image samples with the background image samples. This results in colors that are at least as dark as either of the two contributing sample colors.

[`CGBlendMode.screen`](/documentation/CoreGraphics/CGBlendMode/screen)

Multiplies the inverse of the source image samples with the inverse of the background image samples, resulting in colors that are at least as light as either of the two contributing sample colors.

[`CGBlendMode.overlay`](/documentation/CoreGraphics/CGBlendMode/overlay)

[`CGBlendMode.darken`](/documentation/CoreGraphics/CGBlendMode/darken)

[`CGBlendMode.lighten`](/documentation/CoreGraphics/CGBlendMode/lighten)

[`CGBlendMode.colorDodge`](/documentation/CoreGraphics/CGBlendMode/colorDodge)

Brightens the background image samples to reflect the source image samples. Source image sample values that specify black do not produce a change.

[`CGBlendMode.colorBurn`](/documentation/CoreGraphics/CGBlendMode/colorBurn)

Darkens the background image samples to reflect the source image samples. Source image sample values that specify white do not produce a change.

[`CGBlendMode.softLight`](/documentation/CoreGraphics/CGBlendMode/softLight)

[`CGBlendMode.hardLight`](/documentation/CoreGraphics/CGBlendMode/hardLight)

[`CGBlendMode.difference`](/documentation/CoreGraphics/CGBlendMode/difference)

[`CGBlendMode.exclusion`](/documentation/CoreGraphics/CGBlendMode/exclusion)

Produces an effect similar to that produced by [`CGBlendMode.difference`](/documentation/CoreGraphics/CGBlendMode/difference), but with lower contrast. Source image sample values that are black don’t produce a change; white inverts the background color values.

[`CGBlendMode.hue`](/documentation/CoreGraphics/CGBlendMode/hue)

Uses the luminance and saturation values of the background with the hue of the source image.

[`CGBlendMode.saturation`](/documentation/CoreGraphics/CGBlendMode/saturation)

Uses the luminance and hue values of the background with the saturation of the source image. Areas of the background that have no saturation (that is, pure gray areas) don’t produce a change.

[`CGBlendMode.color`](/documentation/CoreGraphics/CGBlendMode/color)

Uses the luminance values of the background with the hue and saturation values of the source image. This mode preserves the gray levels in the image. You can use this mode to color monochrome images or to tint color images.

[`CGBlendMode.luminosity`](/documentation/CoreGraphics/CGBlendMode/luminosity)

Uses the hue and saturation of the background with the luminance of the source image. This mode creates an effect that is inverse to the effect created by [`CGBlendMode.color`](/documentation/CoreGraphics/CGBlendMode/color).

[`CGBlendMode.clear`](/documentation/CoreGraphics/CGBlendMode/clear)

`R = 0`

[`CGBlendMode.copy`](/documentation/CoreGraphics/CGBlendMode/copy)

`R = S`

[`CGBlendMode.sourceIn`](/documentation/CoreGraphics/CGBlendMode/sourceIn)

`R = S*Da`

[`CGBlendMode.sourceOut`](/documentation/CoreGraphics/CGBlendMode/sourceOut)

`R = S*(1 - Da)`

[`CGBlendMode.sourceAtop`](/documentation/CoreGraphics/CGBlendMode/sourceAtop)

`R = S*Da + D*(1 - Sa)`

[`CGBlendMode.destinationOver`](/documentation/CoreGraphics/CGBlendMode/destinationOver)

`R = S*(1 - Da) + D`

[`CGBlendMode.destinationIn`](/documentation/CoreGraphics/CGBlendMode/destinationIn)

`R = D*Sa`

[`CGBlendMode.destinationOut`](/documentation/CoreGraphics/CGBlendMode/destinationOut)

`R = D*(1 - Sa)`

[`CGBlendMode.destinationAtop`](/documentation/CoreGraphics/CGBlendMode/destinationAtop)

`R = S*(1 - Da) + D*Sa`

[`CGBlendMode.xor`](/documentation/CoreGraphics/CGBlendMode/xor)

`R = S*(1 - Da) + D*(1 - Sa)`. This XOR mode is only nominally related to the classical bitmap XOR operation, which is not supported by Core Graphics

[`CGBlendMode.plusDarker`](/documentation/CoreGraphics/CGBlendMode/plusDarker)

`R = MAX(0, 1 - ((1 - D) + (1 - S)))`

[`CGBlendMode.plusLighter`](/documentation/CoreGraphics/CGBlendMode/plusLighter)

`R = MIN(1, S + D)`



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)