Capturing image RAW format and and save image data in JPEG format

We trying to capture image RAW format and and save image data in JPEG format(resolution of 1080*1920), but facing issues regarding this image conversion. As per Apple developer documentation RAW image is captured in maximum possible resolution without performing any operations.

To retrieve the RAW image, isRawPhoto check is added in function. 

photoOutput(_:didFinishProcessingPhoto:error:)

But there is no option to set the resolution of the raw photo while capturing the RAW image. While configuring camera session we can set sessionPreset as per our need. But to capture raw image we have to set it to .photo (which captures high photo output). We also tried to capture raw photo in sessionPreset resolution of 1080*1920, but we made changes to capture raw photo so this change will not be applied while photo capture.
A RAW photo is basically a direct dump of the camera sensor's raw data, so it will always be in the full resolution of the sensor.
You need to resize it yourself when you want a smaller version, for instance while converting ("developing") the RAW into a JPEG representation using Core Image. For the best downsampling quality I recommend using the CILanczosScaleTransform filter.
Capturing image RAW format and and save image data in JPEG format
 
 
Q