user2995344
user2995344

Reputation: 268

AVCapturePhotoOutput color different than preview layer

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

Upvotes: 5

Views: 621

Answers (1)

DobromirM
DobromirM

Reputation: 2027

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.

Upvotes: 0

Related Questions