letmaik / rawpy

📷 RAW image processing for Python, a wrapper for libraw
https://pypi.python.org/pypi/rawpy
MIT License
587 stars 67 forks source link

Support per-channel black level corrections #176

Open junyongjeon opened 2 years ago

junyongjeon commented 2 years ago

To crop noise in low grayscale regions, I want to use 'user_black' to crop very low grayscale regions, but since I can only set one int value for 'user_black', I can't subtract a separate value for each color. As a result, it gives the image an awkward color. Is there any method to provide separate 'user_black' for each color channel?

letmaik commented 2 years ago

libraw (which rawpy is built on) does support per-channel black level corrections via user_cblack[4]. So in principle this could be exposed as a new parameter in rawpy. Could you give an example of how you would determine the per-channel correction values that you would use in this case?