---
title: "init(rawPixelFormatType:rawFileType:processedFormat:processedFileType:)"
framework: avfoundation
role: symbol
role_heading: Initializer
path: "avfoundation/avcapturephotosettings/init(rawpixelformattype:rawfiletype:processedformat:processedfiletype:)"
---

# init(rawPixelFormatType:rawFileType:processedFormat:processedFileType:)

Creates a photo settings object for capture in both RAW format and a processed format with the specified output file types.

## Declaration

```swift
convenience init(rawPixelFormatType: OSType, rawFileType: AVFileType?, processedFormat: [String : Any]?, processedFileType: AVFileType?)
```

## Parameters

- `rawPixelFormatType`: The Bayer RAW pixel format type to use for capture. This value must be one of the format identifiers listed in the doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoOutput/availableRawPhotoPixelFormatTypes-5fatm array of your photo capture output.
- `rawFileType`: The container file format for eventual output of the RAW image. If you have no preferred file format, pass nil and the photo output will automatically choose a default file format appropriate to the rawPixelFormatType parameter.
- `processedFormat`: A dictionary of Core Video pixel buffer attributes or AVFoundation video settings constants (see Video Settings). To capture a photo in an uncompressed format, such as 420f, 420v, or BGRA, set the key doc://com.apple.documentation/documentation/CoreVideo/kCVPixelBufferPixelFormatTypeKey in the format dictionary. The corresponding value must be one of the pixel format identifiers listed in the doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoOutput/availablePhotoPixelFormatTypes-6eyb array of your photo capture output. To capture a photo in a compressed format, such as JPEG, set the key doc://com.apple.avfoundation/documentation/AVFoundation/AVVideoCodecKey in the format dictionary. The corresponding value must be one of the codec identifiers listed in the doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoOutput/availablePhotoCodecTypes array of your photo capture output. For a compressed format, you can also specify a compression level with the key doc://com.apple.avfoundation/documentation/AVFoundation/AVVideoQualityKey.
- `processedFileType`: The container file format for eventual output of the processed image. If you have no preferred file format, pass nil and the photo output will automatically choose a default file format appropriate to the processedFormat parameter.

## Return Value

Return Value A new photo settings object.

## Discussion

Discussion Use this initializer to capture an image in both RAW format and a processed format (such as JPEG). For RAW-only capture, use the init(rawPixelFormatType:) initializer instead. Requesting both formats adds requirements for other photo settings: see the format property for processed format requirements and the rawPhotoPixelFormatType property for RAW format requirements. The capture output validates these requirements when you call the capturePhoto(with:delegate:) method. If your settings and delegate do not meet these requirements, that method raises an exception.

## See Also

### Creating photo settings

- [init(format:)](avfoundation/avcapturephotosettings/init(format:).md)
- [init(rawPixelFormatType:)](avfoundation/avcapturephotosettings/init(rawpixelformattype:).md)
- [init(rawPixelFormatType:processedFormat:)](avfoundation/avcapturephotosettings/init(rawpixelformattype:processedformat:).md)
- [init(from:)](avfoundation/avcapturephotosettings/init(from:).md)
