yes, you're right. tho I'd say
red_diff= red1-red2
It may be better to make a greyscale image out of both images before comparing, so you can work with the brightnesses only.
now you can compare greyscales directly.
It may be a good idea to increase the images contrast now, to make the shape more visible. You even may increase the contrast that much that you'll have black and white only, but this requires that the images where well balanced before.
Anyway, increasing contrast can be done in many ways, eg:
Don't expect too much help here. Because none of us has been there. Even the more experienced programmers don't know how to do this. If you are a beginner, don't expect that you can sit down and write a super artifical intelligence on a rainy weekend. And especially don't expect other people to do this for you instead. We can help you with the Blitz Commands. The AI info is out there, in the web.
red_diff= red1-red2
It may be better to make a greyscale image out of both images before comparing, so you can work with the brightnesses only.
rgb=readpixelfast(x,y) and $FFFFFF ; separate RGB red=(rgb and $FF0000) shr 16 green=(rgb and $FF00) shr 8 blue= rgb and $FF ; get greyscale (well, not fully correct since green has a higher value than red or blue, but that's peanuts) grey=(red+green+blue)/3
now you can compare greyscales directly.
It may be a good idea to increase the images contrast now, to make the shape more visible. You even may increase the contrast that much that you'll have black and white only, but this requires that the images where well balanced before.
Anyway, increasing contrast can be done in many ways, eg:
if grey>128 then grey=(grey+2)*1.1 else grey=(grey-2)*0.9 endif if grey >255 then grey=255 if grey <0 then grey =0
Don't expect too much help here. Because none of us has been there. Even the more experienced programmers don't know how to do this. If you are a beginner, don't expect that you can sit down and write a super artifical intelligence on a rainy weekend. And especially don't expect other people to do this for you instead. We can help you with the Blitz Commands. The AI info is out there, in the web.