So I don't have any code cooked up yet as this is still in the theoretical stage. Just looking for some advice.
My current idea is to resize the image to 1x1 pixel, probably using _GDIPlus_ImageResize, and read the color of the resulting pixel to obtain an admittedly very general sense of brightness. Does anyone think this could work?
We have a CCTV system running at home using some home made cameras (raspberry pi) and we're trying to automate toggling settings for day/night time. We s
Well I appreciate the code there @Nine, but I was offline for a few days and cooked this up in the meantime.
Func _GetImageBrightness($sFile) ; Return: 0 black -> 100 white
Local $hBitmap, $hBitMapResized, $iColor, $R, $G, $B
$hBitmap = _GDIPlus_BitmapCreateFromFile($sFile)
$hBitMapResized = _GDIPlus_ImageResize($hBitmap, 1, 1)
$iColor = BitAND(_GDIPlus_BitmapGetPixel($hBitMapResized, 0, 0), 0xffffff)
$R = BitShift(BitAND($iColor, 0xff0000), 16)
$G