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 top
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) was
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 an
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 long
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 lef
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 lef
> 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
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 dictionary).
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:
http://runtime-revolution.27830
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 dictionary).
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 v
I have asked this befor, but for the first time did not get any answer on
my post. So I hope you don't mind that I try again :-)
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 under the cursor. What I need is
to get the RGB of
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 unde
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 under the cursor. What I need is
to get the RGB of a specific screen location - I need to make an avarage of
e.g. 5x5 pixels. So how do I get the RGB numbers of e.g. location "30,2
14 matches
Mail list logo