---
title: "init(jpegDataProviderSource:decode:shouldInterpolate:intent:)"
framework: coregraphics
role: symbol
role_heading: Initializer
path: "coregraphics/cgimage/init(jpegdataprovidersource:decode:shouldinterpolate:intent:)"
---

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

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

## Declaration

```swift
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

Return Value A new CGImage. In Objective-C, you’re responsible for releasing this object by calling CGImageRelease.

## See Also

### Creating images

- [init(width:height:bitsPerComponent:bitsPerPixel:bytesPerRow:space:bitmapInfo:provider:decode:shouldInterpolate:intent:)](coregraphics/cgimage/init(width:height:bitspercomponent:bitsperpixel:bytesperrow:space:bitmapinfo:provider:decode:shouldinterpolate:intent:).md)
- [init(pngDataProviderSource:decode:shouldInterpolate:intent:)](coregraphics/cgimage/init(pngdataprovidersource:decode:shouldinterpolate:intent:).md)
- [init(headroom:width:height:bitsPerComponent:bitsPerPixel:bytesPerRow:space:bitmapInfo:provider:decode:shouldInterpolate:intent:)](coregraphics/cgimage/init(headroom:width:height:bitspercomponent:bitsperpixel:bytesperrow:space:bitmapinfo:provider:decode:shouldinterpolate:intent:).md)
