<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGImage/init(jpegDataProviderSource:decode:shouldInterpolate:intent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGImageCreateWithJPEGDataProvider"
  },
  "title" : "init(jpegDataProviderSource:decode:shouldInterpolate:intent:)"
}
-->

# init(jpegDataProviderSource:decode:shouldInterpolate:intent:)

Creates a bitmap image using JPEG-encoded data supplied by a data provider.

```
init?(jpegDataProviderSource source: CGDataProvider, decode: UnsafePointer<CGFloat>?, shouldInterpolate: Bool, intent: CGColorRenderingIntent)
```

## Parameters

`source`

A data provider supplying JPEG-encoded data.

`decode`

The decode array for the image. Typically a decode array is unnecessary, and you should pass `NULL`.

`shouldInterpolate`

A Boolean value that specifies whether interpolation should occur. The interpolation setting specifies whether a pixel-smoothing algorithm should be applied to the image.

`intent`

A CGColorRenderingIntent constant that specifies how to handle colors that are not located within the gamut of the destination color space of a graphics context.

## Return Value

A new CGImage. In Objective-C, you’re responsible for releasing this object by calling [`CGImageRelease`](/documentation/CoreGraphics/CGImageRelease).

## Discussion

---

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)