This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Computer Graphics with Photoshop > May 2006 > Script To Find Color At Coordinates X,Y





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Script To Find Color At Coordinates X,Y
cppaddict

2006-05-08, 6:16 pm

Right now, if I want to find the RGB value of a pixel at X,Y, I just
use the magnifying tool and mouse over the pixel. But when I need a
number of pixel values at different places on the image, this is time
consuming.

Is there any way to write a script in which I could input a number of
X,Y values, and the script would output the color at each location?

Thanks for any ideas,
cpp
Larry Scripts

2006-05-08, 6:16 pm

Here is a script that I wrote for a Biologist.

It allows you to save multiple sample points and then write those samples out to an Excel spreadsheet file.

http://home.comcast.net/~larryscrip...veColorData.ZIP

There is a README.pdf file inside the zip file that contains instructions for setting up and using these script.

It requires at least Photoshop CS.

Larry


cppaddict

2006-05-08, 6:16 pm


>It requires at least Photoshop CS.


Larry,

I have PS 7. Is there any way to make it work with that?

Mike Russell

2006-05-08, 6:16 pm

"cppaddict" <hello@hello.com> wrote in message
news:ul4v52ls94csuo3rpvv2lpa7va5346lb6m@4ax.com...
> Right now, if I want to find the RGB value of a pixel at X,Y, I just
> use the magnifying tool and mouse over the pixel. But when I need a
> number of pixel values at different places on the image, this is time
> consuming.
>
> Is there any way to write a script in which I could input a number of
> X,Y values, and the script would output the color at each location?


The Curvemeister demo will do this - you can save sample points in a file,
load them, display the color values, and do a number of things with those
values - delta E and std dev calculations for example.
--
Mike Russell
www.mike.russell-home.net


cppaddict

2006-05-08, 6:16 pm


>The Curvemeister demo will do this - you can save sample points in a file,
>load them, display the color values, and do a number of things with those
>values - delta E and std dev calculations for example.



Mike,

How do you use CM to do this?

Thanks...
Larry Scripts

2006-05-08, 10:16 pm

I would have to rewrite it to work with Photoshop 7. I don't know if I can do that. I'm working on a complex script at this time
and don't have the time to rewrite.

It should work in CS2. CS2 is a good upgrade. Lots of great new stuff like smart objects. Time to upgrade!

I'm not writing any scripts for Photoshop 7. I'm concentrating on CS2.

Sorry.

Larry


Mike Russell

2006-05-09, 3:15 am

"cppaddict" <hello@hello.com> wrote in message
news:07bv529op16eujb7fh4gktulf1buo08og2@4ax.com...
>
>
> Mike,
> How do you use CM to do this?


First install the demo:
http://www.curvemeister.com/downloads/cmdemo/index.html

Start Curvemeister using the Filters menu. Then Alt click on the points you
want to measure, and right click on the image and save the sample points in
a file.

Later you can load the sample file, and the sample points will reappear in
their original locations. That will do the trick if all you want are
individual color values. There are additional commands for pinning to a
particular reference color and calculating deltaE, etc, which is what this
functionality is designed for.

Here's an example image that uses this technique to evaluate deltaE for a
ColorChecker.
http://mike.russell-home.net/tmp/JohnC
--
Mike Russell
www.curvemeister.com



cppaddict

2006-05-11, 6:17 pm


>It allows you to save multiple sample points and then write those samples out to an Excel spreadsheet file.
>
>http://home.comcast.net/~larryscrip...veColorData.ZIP
>
>There is a README.pdf file inside the zip file that contains instructions for setting up and using these script.


Larry,

In this script, you have to select the samply points. I am going to
be using the same set of (x,y) points and getting the color data for
those points on multiple images. Is there any way to automate the
process? With your script, it seemed that you have to manually select
the sample points each time. Am I missing something?

Thanks.
Larry Scripts

2006-05-12, 6:16 pm

There is a way to sample the color at a specific x,y coordinate. It is slow. You want to sample the same point in multiple files?
How do you want the output? You can put your photos into a folder and then I can process all the files in the folder and create an
Excel comma-delimited file. Is this what you need?

Larry


cppaddict

2006-05-12, 6:16 pm


>There is a way to sample the color at a specific x,y coordinate. It is slow. You want to sample the same point in multiple files?
>How do you want the output? You can put your photos into a folder and then I can process all the files in the folder and create an
>Excel comma-delimited file. Is this what you need?


Yes. I want to sample the same *set* of points in multiple files.
Excel output would be fine, but the output would need to include the
filenames. Alternatively, and perhaps preferably, I could run the
script on the current active file in PS. That is, click some sort of
hot key, and then the script would spit out an excel file containing
the color data at, for example, the following points:

(1,6)
(23,89)
(148,23)
etc.

Thanks for any further help,
cpp

Larry Scripts

2006-05-12, 6:16 pm

You don't need a script. You can use the "Color Sampler" tool to sample up to 4 points.
Open up the info palette. Select the "Color Sampler" tool and record an action.
The X,Y coordinates will show in the info palette. Click and the color value with appear in the info palette.
Sample up to 4 points. Stop recording action. Open up another file and run the action you just made.
The color samples will appear in the info palette.

Larry


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews