FORUMS: list search recent posts

Photoshop scripting: Need to convert hex color to nearest Pantone, or utilize existing webservice and feed data back to Photoshop

COW Forums : Adobe Photoshop

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Colin James
Photoshop scripting: Need to convert hex color to nearest Pantone, or utilize existing webservice and feed data back to Photoshop
on Jun 26, 2015 at 12:30:33 am

Hey all,

I need a script that if I have a hex color value, I can return a string of the nearest Pantone solid coated color name.

Photoshop (I'm using CS6 still )does this manually through the UI if I am in the color picker and then click on Color Libraries, it'll select the closest Pantone color. I just can't figure out how to do this part via scripting as it seems to be a blackbox, and actions just pick the color that I already had.

If there is no way to do this through scripting natively in photoshop, is it possible to have the script fill in the form data here: http://www.netfront.fr/Services/rgb2pantone/ or here: http://rgb.to/ and return the result back to photoshop?

Thanks for any suggestions!

Blur Studio


Return to posts index

Colin James
Re: Photoshop scripting: Need to convert hex color to nearest Pantone, or utilize existing webservice and feed data back to Photoshop
on Jul 2, 2015 at 5:47:29 pm

Just following up because I found a solution and hopefully someone who is googling how to do this in the future might benefit.

Basically what I ended up doing was the following: I used this script ( http://www.tonton-pixel.com/blog/scripts/utility-scripts/parse-color-book-f... ) to turn the specific Pantone color book I needed into a JSON file.

Then I used this http://www.tonton-pixel.com/blog/json-photoshop-scripting/json-action-manag... JSON parser for photoshop that the same dude wrote to bring in the color book data into photoshop's javascript as an object that I could step through. Be warned, while the JSON file that the colorbook parser spits out is valid json, i had to get rid of a lot of the spaces, carriage returns and some of the earlier entries ( only needed the color data anyway ) for it not to kick up an error when being parsed.

Then I #included this script http://www.rags-int-inc.com/PhotoTechStuff/ColorCalculator/[3] and used its RGB > to lab color space conversion function. Then I used the delta-e 2k color comparison forumla function ( requires lab color space because its a perceptual match ( which is better )). I kept an array of the deltaE results and found the smallest one, then looked up which arrayvalue/color that was associated with and viola there is my pantone color. that's the basic gist.

Saved myself quite a bit of money not having to buy fashion industry plugins/software ( over priced and terrible... ).


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]