Optimising Gain

Check if you need a filter ny method given in following How-to:

Do I Need A Filter?

 

UPDATE to How-to

Use following commands to install imaging package on Raspberry Pi

(1) For Raspberry Pi OS Bookworm and Bullseye :

sudo apt install python3-pil

(2) For Raspbian Buster :

sudo apt-get install python-pil

(3) For Raspbian Stretch and Jessie :
sudo apt-get install python-imaging