android / camera-samples

Multiple samples showing the best practices in camera APIs on Android.
Apache License 2.0
4.95k stars 2.32k forks source link

Incorrect colors - greenish image #579

Closed laheller closed 3 months ago

laheller commented 4 months ago

On my Samsung Galaxy A54 5G device when I try to convert from YUV420 to RGBA, the result image is however correct, but it has a kind of green tint. The way how I do the convert is inspired by the HDRViewFinder demo application's renderscript kernel code. The HDRViewFinder demo app itself gives correct image & correct colors without green tint, but in my case on Xamarin.Android platform I unfortunately cannot use custom renderscipt, because it is not supported.

More info & my sample code in the following stackoverflow post: https://stackoverflow.com/questions/78374905/android-camera2-yuv-420-888-image-to-rgba-bitmap-conversion-produces-a-greenish

@alexcohn I saw your comments and example codes at many many similar questions, you maybe know the reason or just give me some hints, what I am doing wrong.

laheller commented 3 months ago

Problem solved, however not sure, why this helped: Before taking the YUV420 format picture I had to change camera2 WhiteBalance settings from Auto to Fluorescent.