Re: Get RGB color of a specific screen location

2019-01-09 Thread hh via use-livecode
Looking again at your problem my experiences with both statistics and images say that the *median* would be a better average than the *arithmeticMean*. So you could try and compare both averages (more exactly: location parameters of your WxH-color-distribution). local t="temp" -- hL,vL is the

Re: Get RGB color of a specific screen location

2019-01-09 Thread Beat Cornaz via use-livecode
I have used the export snapshot and then the averaging. Works great. I had forgotten about the export function (have been away from coding for 3 years). I also had to implement Phil Davis' "set the screenMouseLoc to globalLoc(tLocWithinMyStack)". The average I got first (with only the mouseLoc)

Re: Get RGB color of a specific screen location

2019-01-09 Thread Beat Cornaz via use-livecode
Thanks everyone for the many suggestions. I will try them out and see which one will work best. Appreciate the multitude of ideas. Cheers, Beat ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe

Re: Get RGB color of a specific screen location

2019-01-07 Thread Håkan Liljegren via use-livecode
Well, he could, if he didn’t wanted an average value of some more pixels, and, calculating an average via screenMouseLoc is really slow. Exporting a rect to an image is fairly quick though Found the following in a stack: # Calculates the average color value for an image # pID should be the

Re: Get RGB color of a specific screen location

2019-01-07 Thread hh via use-livecode
Sorry, my last post had a typo. Now it is correct. > Beat C. wrote: > What I need is to get the RGB of a specific screen > location - I need to make an avarage of e.g. 5x5 pixels. Make a new small stack with a button. Script it as given below. On mouseUp the average is taken from the 5x5-rect

Re: Get RGB color of a specific screen location

2019-01-07 Thread hh via use-livecode
Sorry, my last post had a typo. Now it is correct. > Beat C. wrote: > What I need is to get the RGB of a specific screen > location - I need to make an avarage of e.g. 5x5 pixels. Make a new small stack with a button. Script it as given below. On mouseUp the average is taken from the 5x5-rect

Re: Get RGB color of a specific screen location

2019-01-07 Thread hh via use-livecode
> Beat C. wrote: > What I need is to get the RGB of a specific screen > location - I need to make an avarage of e.g. 5x5 pixels. Make a new small stack with a button. Script it as given below. On mouseUp the average is taken from the 5x5-rect left of the topleft of your stack. - begin button

Re: Get RGB color of a specific screen location

2019-01-07 Thread hh via use-livecode
Try if there is no img "temp" then create invisible img "temp" export snapshot from rect to img "temp" as PNG Then average the imagedata of that image. If you would like to use transparency then also use the alphadata. This is for desktop, on mobile there are some specials (see the

Re: Get RGB color of a specific screen location

2019-01-07 Thread dunbarxx via use-livecode
A kluge, but couldn't you: on mouseUp set the screenMouseLoc to "200,200" answer the mouseColor end mouseUp I just threw this together, so you might want to restore the original mouseLoc, and locking the screen might be useful. Craig Newman -- Sent from:

Re: Get RGB color of a specific screen location

2019-01-07 Thread hh via use-livecode
Try if there is no img "temp" then create invisible img "temp" export snapshot from rect to img "temp" as PNG Then average the imagedata of that image. If you would like to use transparency then also use the alphadata. This is for desktop, on mobile there are some specials (see the

Re: Get RGB color of a specific screen location

2019-01-07 Thread Lagi Pittas via use-livecode
Seems like it was answered the same day by Phil Davis Lagi Phil Davis via use-livecode Mon, 31 Dec 2018, 17:51 (7 days ago) to Beat, Phil set the screenMouseLoc to globalLoc(tLocWithinMyStack) put the mouseColor into tTheColorAtThatScreenLoc Phil Davis On Mon, 7 Jan 2019 at 12:10, Beat Cornaz

Re: Get RGB color of a specific screen location

2018-12-31 Thread Phil Davis via use-livecode
set the screenMouseLoc to globalLoc(tLocWithinMyStack) put the mouseColor into tTheColorAtThatScreenLoc Phil Davis On 12/31/18 9:24 AM, Beat Cornaz via use-livecode wrote: How do I get the RGB color of a pixel of an image? I know the function the MouseColor, which gives me the RGB numbers