AVCapturePhotoOutput color different than preview layer

559 views Asked by At

When capturing an image, the color of the output image is different than what I see on the preview layer. For some reason, the color changes slightly. Has anyone come across this issue before? How can I fix this?

The green is a little bit darker when I get my image from didFinishProcessingPhotoSampleBuffer enter image description here

1

There are 1 answers

0
DobromirM On

Reading the official documentation for AVCapturePhotoOutput I found this:

The AVCapturePhotoOutput class implicitly supports wide-gamut color photography. If the source AVCaptureDevice object’s activeColorSpace value is P3_D65, the capture output produces photos with wide color information (unless your AVCapturePhotoSettings object specifies an output format that does not support wide color).

And also this for activeColorSpace:

By default, a capture session automatically enables wide-gamut capture for supported devices and capture workflows...

So maybe your device supports it by default and that's why in the output you see the image with different colors. Try changing the activeColorSpace and see if that makes a difference.