A few days ago I was browsing reddit r/Xiaomi section and commented on this thread:
https://www.reddit.com/r/Xiaomi/comments/77p2va/i_have_a_note_4x_with_an_omnivision_sensor/dot4b9e/ about the pink tint issue that we are experiencing on Omnivision sensors. To make it short, a redditor (GeorgeKiarie) asked to post samples of the pink tint issue.
I was providing him samples of photos with pink tint and basically running some tests for him. Right off the bat when he saw the photo with pink tint, he came to a conclusion that the black levels in the camera libraries are incorrect. According to GeorgeKiarie, the default black levels was 16 16 on the Omnivision camera libs which is incorrect as it should have been 64 16.
The fix: GeorgeKiarie has modified libmmcamera_ov13855_qtech.so and change the black levels from 16 16 to 64 16.
Requirements:
- TWRP Recovery
- Root(to enable camera2 api obviously)
- Camera2 API
- GCAM version 4.0(attached)
Disclaimer: I have not done extensive testing on this fix. I have only tested this on my device (16/3gb RAM variant) so I cannot guarantee that this will also work for you. I am not responsible for any kind of damage (if any) that it may cause once you've flashed the fix but I will provide a flashable zip to revert back to default just in case. As usual, flash at your on risk.
I've also NOT tested the fix on other GCAM versions besides the one I've attached and the latest GCAM 5.1 but in theory, it should work on all GCAM ports for mido. Take note that most of my tests were done with gcam 4.0. I've also tested it on gcam 5.1 and it seems to work fine but I've only took a few shots with it.
Steps:
1. Download the attachment "Pink Tint Fix.zip"
2. Reboot to recovery and flash zip.
3. Download and install Gcam 4.0 from here:
https://drive.google.com/open?id=0B6OCKwxBBePEQmowWm5mRUR3Tk0
4. Enable HDR+ and enjoy good quality low light photos
Bugs:
- Camera crashes after taking photos in good lighting conditions but only when HDR+ is enabled.
- Random camera crashes even in low light conditions
- Camera stuck in "processing" when taking a photo under good lighting conditions
- Shutter button is greyed out and/or not responding when taking a photo under good lighting conditions
- All other bugs present in Google Cam 4.0 port.
All the above mentioned bugs only happens when HDR+ is enabled. It seems that HDR+ does not work when enabled under good lighting conditions. Please do not ask me to fix it as I am no developer. I only helped in testing. Hopefully someone smarter than me can fix these bugs. Please feel free to post fixes If you've found one and I'd include it in the OP.
All credits go to redditor GeorgeKiarie. I only helped in testing the fix and creating a flashable zip. If you wanna thank him, just visit the reddit link above and message him or something.
PS: As mentioned above, I am not a developer so all these has been written the way I've understood the issue and how it was fixed, I'm just relaying the information provided to me. Please feel free to correct me if you see something wrong and I'd gladly edit my post.