Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

XY coordinates and color ref

New Here ,
Aug 28, 2015 Aug 28, 2015

Hi,

First of all i want to say i'm not a IT so i just try to do the best of me.

I’m working on a script to obtain a .csv document with the information about the colour RGB/CMYK and the XY coordinates for this colour to update in a BBDD.

I have a problem, i found a script that only shows one colour that I pick up with the eyedropper tool (Photoshop).

How can I pick different colours? how can I integrated the XY ref.?

Thanks in advance

Paula

TOPICS
Actions and scripting
2.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 01, 2015 Sep 01, 2015

By whatever means, get the x & y values for the location of the color sample. The below show how to get the different color values. You don't need to change the document color space to get these different values. I don't know about getting Panetone values.

#target photoshop

var doc = activeDocument

x=200

y=150

doc.colorSamplers.removeAll();

var cS = doc.colorSamplers.add([x,y])

var cR = cS.color.rgb.red;

var cG = cS.color.rgb.green;

var cBl = cS.color.rgb.blue;

var cC = cS.color.cmyk.cyan

var c

...
Translate
Adobe
Community Expert ,
Aug 28, 2015 Aug 28, 2015

Could you please post a sketch/mock-up or screenshots to clarify what you are trying to achieve?

The Color Sampler Tool can be used to create measurements for several locations.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2015 Sep 01, 2015

This is my demo picture.

I open Photoshop and I convert the workplace to CMYK. I need to get the color code of a series of pixels (that i whant to select with the eyedropper tool).

Then I want to obtain the position of the pixel (XY) with the CMYK, RGB and LAB values for every pixel that i select and save theses values in a .txt document or excel.

If is it possible, i would like to obtain at the same time the Pantone but if is not possible, i can save the color like a new swatches and then, export the swatches fil and cross the to files to obtain the complete reference of color/pixel.

imagescript.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2015 Sep 01, 2015

By whatever means, get the x & y values for the location of the color sample. The below show how to get the different color values. You don't need to change the document color space to get these different values. I don't know about getting Panetone values.

#target photoshop

var doc = activeDocument

x=200

y=150

doc.colorSamplers.removeAll();

var cS = doc.colorSamplers.add([x,y])

var cR = cS.color.rgb.red;

var cG = cS.color.rgb.green;

var cBl = cS.color.rgb.blue;

var cC = cS.color.cmyk.cyan

var cM = cS.color.cmyk.magenta

var cY = cS.color.cmyk.yellow

var cK = cS.color.cmyk.black

var cL = cS.color.lab.l

var cA = cS.color.lab.a

var cB = cS.color.lab.b

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 02, 2015 Sep 02, 2015

Hi Chuck,

I tried the script and it doesn’t work. Or I made a mistake running the script.

I tried in the CS6 version and it works but only create a document with X=200 Y=150 values, no mine colour selection. I tried as well in the last PS version (trial version from adobe website) and appear the messages “Make doesn’t exist”.

Can you revise please? I want to obtain the X Y reference for 10 different colour sampler with the different colour values.

Grateful

Paula

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 02, 2015 Sep 02, 2015
I want to obtain the X Y reference for 10 different colour sampler

Then use a for-clause to work through those and amend the line

  1. var cS = doc.colorSamplers.add([x,y]) 

accordingly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 02, 2015 Sep 02, 2015

Yes, as c.pfaffenbichler pointed out, you need to add your own code to find the X & Y locations you want to sample. The code I posted was just to show you how to get the values. Use my code to plug into your code just to get the various color values you want.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 05, 2015 Sep 05, 2015

paulaSTpaulahave you been able to amend the code to conform to your expectations?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 07, 2015 Sep 07, 2015

I asked a friend, she is working on it.

I know what I want but not how to get it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2015 Sep 10, 2015
LATEST

If your friend should be stuck on something concerning the Scripting of this task they should post their code here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines