• + 1 comment

    How did you figure out that the average value of all pixels in image must be compared against 80. I was thinking about setting comparison value to 255/2 as (I think) avg > 127.5 would be day and night otherwise.