colorjs / color-space

Math & data behind color spaces and color conversions.
http://colorjs.github.io/color-space
The Unlicense
325 stars 25 forks source link

PMS #17

Open dy opened 8 years ago

dy commented 8 years ago

Pantone color system may have legal issues using it in open-source. Thought here it would require some neural network to calc the formula.

olehmelnyk commented 6 years ago

Looks like PANTONE is not a color system but a handpicked color standardization, and I'm not sure if there's a system

We can search by hex here, at the official site https://store.pantone.com/eu/en/colorfinder/index/search/q/#ffffff where #ffffff is color hex this search request returns up to 100 samples

I tried to fetch() pages but looks like they load search result async with delay and maybe do some checks to prevent crawling/parsing - or maybe I'm just doing something wrong

some PANTONE to RGB / CMYK / HEX tables can be found online but I'm not sure they are complete For example:

olehmelnyk commented 6 years ago

All designer software installs with color libraries, right?

For example, Adobe store libraries in its own proprietary binary format - .acb (Adobe Color Book) There are .acb libs for:

I have found acb2xml convertor (source code in C++ https://github.com/atesgoral/acb2xml and compiled .exe file https://magnetiq.ca/pages/freeware/#acb2xml for Windows console);

Also, I have found a topic at the Adobe forums (https://forums.adobe.com/thread/435262) where in one of the comments I have found a link to ExtendScript (Adobe version of JS v1.6 with custom DOM/BOM for Adobe software, that allows writing scripts/extensions for Adobe software) - this script runs directly from Photoshop/InDesign etc. and can convert Adobe's .acb file to .json format; - here's the link for that script - http://www.tonton-pixel.com/scripts/utility-scripts/parse-color-book-file/; The problem is that this script was written for Adobe CS3 and dosn't work in modern CC out of the box - there are errors... I commented lines that produce errors (LOL) and was able to get .json files from .acb but can't be sure if the file were converted properly since there were errors in the outdated code...

But maybe we don't need to do any conversions and can directly read .acb files as binary (I don't know how to work with binaries, especially in JS); The problem is that we might have problems because of publishing and distribute reverse-engineered Adobe files with 3rd party color pallets... So it might be better to create a website/web service with REST API that will store color libs info...


Affinity Designer from Serif (haven't checked Affinity Photo yet) installs with PANTONE libs as .csv files (Yay!!!) and also contains some Pantone libs that Adobe is missing, such as:

UPD: 3) There are a lot of color variations like: 148 and 1485 149 and 1495 150 and 1505 where 5 at the end represents a darker version of the same shade/hue also, there are colors like: 185 and 185 2X 1788 and 1788 2X where 2x also represents a darker version

UPD: 4) Pantone Numbering Explained https://www.pantone.com/pantone-numbering-explained


Need to check if other software (Corel, Autodesk, Sketch, etc.) has color libs that can be examined UPD: Software Licensees https://www.pantone.com/software-licensees


UPD: .csv format is probably the best text format for storing color libs as we can read file line-by-line while searching for value or do a RegExp for entire file

olehmelnyk commented 6 years ago

OK, I'm probably doing it all wrong, but it works, somehow (at least for now, lol)

You need to have CORS enabled in your [Chrome] browser (with a plugin or with a flag --disable-web-security or something like that)

get HEX/RGB/CMYK by Pantone code (parse official Pantone website search result) - https://gist.github.com/olehmelnyk/40f46c7f05bf2fdd6d897338a48755c6

Parsing 3rd party website for RGB to Pantone https://gist.github.com/olehmelnyk/0aff52f300ef6f778b3a9ab03b5f7bfd

Parse from search result, manually, browser-only https://gist.github.com/olehmelnyk/1c3dd06a57dab0cc721a41bcbe06de26

dy commented 6 years ago

@olehmelnyk https://en.wikipedia.org/wiki/Pantone#Intellectual_property — the problem is not technical, but legal, unfortunately. I wonder if we approximate pantone with some intellectual algo — would it be considered an intellectual infringement or not. We can reverse-engineer pantone and release it open-source, but that is a bit useless − not sure who may need hacked pantone system, that is just not serious, business-wise.

olehmelnyk commented 6 years ago

Yeah, I think we should understand the difference between color mode that can be calculated and color pallet which might be just a set of handpicked values, names and be an intellectual property... So I suggest to split this library into two - one for color modes only and the other for color pallets.

olehmelnyk commented 6 years ago

Looks like Pantone allows to share its libraries with a workgroup: https://www.pantone.com/help/?t=Sharing-Libraries-from-PANTONE-Color-Manager-with-Workgroup

How can I share PANTONE Color Manager Libraries with Others? While PANTONE Color Manager is single-user, the PANTONE libraries may be shared with other users without license restriction. -- says in its official website

Now I got all the latest and greatest libraries/pallets/swatches from PANTONE Color Manager as .acb files - all with LAB color values as it has wider gamut compared to sRGB and CMYK

So, theoretically, we can share .acb files on the server, so our workgroup [all across the globe] can have access to them. Of course, we will disable indexing of this folder so nobody except our workgroup with direct links can find them... Then we can read those files as binaries - here's unofficial .acb specification https://magnetiq.ca/pages/acb-spec/ and here's acb2xml source code in C++ https://github.com/atesgoral/acb2xml from the same author