Search the Community
Showing results for tags 'color shift'.
-
I could use a bit of math help. What I'd like to do is sample a 5x5 pixel area with PixelChecksum. I would then sample again a few seconds later to check for a change as seems to be the normal usage. Can I do any useful maths on the PixelChecksum results? For instance, if I subtracted the two sample values would it tell me anything about pixel color content? Might I know that a color shift has happened to maybe Blue or Red for instance? Or would I have to do that on a per pixel sample? And if that is the case... what math would i use to compare an RGB value against another to detect a shift in color from neutral towards Red or Blue? From the docs: Func _testShift() ; with PixelChecksum Local $toler=5 Local $PCS1 = PixelChecksum($x + $toler, $y + $toler, $x - $toler, $y - $toler, 1, $windowHandle , 0) Sleep(200) Local $PCS2 = PixelChecksum($x + $toler, $y + $toler, $x - $toler, $y - $toler, 1, $windowHandle , 0) If $PCS1 <> $PCS2 Then ; How to compare these meaningfully for colorshift? ; or with single pixel.... Local $px1 = PixelGetColor($x, $y, $windowHandle) Local $pxRGB1 = _ColorGetRGB($px1) Sleep(200) Local $px2 = PixelGetColor($x, $y, $windowHandle) Local $pxRGB2 = _ColorGetRGB($px2) If $px1 <> $px2 Then If $pxRGB1[0] < $pxRGB2[0] Then Red? If $pxRGB1[2] < $pxRGB2[2] Then Blue? EndFunc
- 3 replies
-
- pixel
- pixelchecksum
-
(and 2 more)
Tagged with: