Spot color support.
Open, WishlistPublic

Description

If you read around on missing features in open source image authoring programs, one of the things that pops up is spot colors.

What are spot colors?

Spot colors are basically a list of colors that a paint company can reliably recreate. Within a digital context, what is important is that spot colors are treated properly by the color management, and thus display properly on the screens of those who care about color management.

There are two parts to spot color implementation:

Getting the color.

Spot colors are typically stored in ICC profiles. LCMS can open these files and read out the NamedColorList inside. Furthermore, our new palette format, KPL, can store non-srgb values perfectly fine.

However, it currently isn't possible to get KoColorSet to link to lcms and then to teach it how to open icc profiles due the way the source code is laid out.

When we have our list of colornames, what should be done is that we request the user how the PCS is interpreted(Either LAB or XYZ), and then use the PCS values as the color space for the color. We should take as high a bitdepth as possible. Then, with the colornames and everything, we'll create a KoColorSetEntry out of each color and store the result as

Spot color workflows.

Krita, as a raster painting program, mostly exists with the idea of mixing colors in mind, and as such spot color access is for most artists sufficient.

However, spot colors in print are not just colors. Rather, they are often used as a mask for a certain area of color, so that the printer can make that area glossy, or with only gold paint or other printing tricks.

In photoshop, spot colors are therefore implemented as a seperate channel. They are masks for a specific color, without any mixing. For Krita's example, this is quite like a fill layer filled with a single color, that then, upon export is converted to a grayscale image indicating coverage.

We will need to do more research into DTP and similar printing techniques to really figure out what we can do for people using spot colors in a printing workflow.

woltherav created this task.Nov 3 2017, 1:57 PM
rempt added a subscriber: rempt.EditedNov 3 2017, 2:49 PM

When checking which file formats support spot colors, I found this:

https://helpx.adobe.com/photoshop/using/printing-spot-colors.html

So it's at least PSD, DCS 2.0 (never heard of that) or PDF. I'm not sure whether Poppler supports spot colors, though, and we don't have PDF export anyway. PoDoFo probably is the right library to use.

PDF export using PoDoFo would make a great, though rather hard-core gsoc project.

scottpetrovic added a subscriber: scottpetrovic.EditedNov 3 2017, 4:19 PM

For the time I have spent doing print work (my dad owns a screen printing company), I will say that spot colors are usually much more important with vector applications than raster applications. The edge colors with the spot color needs to be exact, so having things like anti-aliasing is usually not a good idea. Krita does have vector layers, so I could see it be useful if people are doing more vector-centric artwork.

Having artwork in a vector format is usually strongly preferred when doing spot colors. If I ever got artwork in a raster format, I would always have to vectorize it before I could put it on a film to "shoot" the screen for printing. Anything raster usually becomes a 4-color process (CMYK) to get it to print right...which is obviously much more expensive as it turns a job into a 4 color job instead of just 1.

Spot colors are pretty important for company logos which sometimes just use digital printers, so I think it would still be a useful feature for people working with print

Deevad added a subscriber: Deevad.Nov 4 2017, 2:38 PM

I worked before 2007 for a company and we used a single "spot color": a mustard/yellow specific one related to the logo of the company. So, in a similar way mentioned by @scottpetrovic , we used to setup the spot color with Illustrator (vector) or directly in Indesign/QuarkXpress (vector too but for desktop publishing).

In case of a raster artwork, we did:

  • Creation of the base raster document in CMYK with Ps.
  • Keeping the yellow/mustard color on a layer.
  • Export a CMYK version.
  • Export another version with the layer containing the yellow/mustard mask (greyscale).
  • In vector/desktop publishing app we added both export on top of each other.
  • The greyscale was filled to our spot color channel...

From what I read of @woltherav, it's now possible to set the channel directly in Photoshop, save as PSD/PDF and embed directly it in InDesign without further tweaks. It's probably a cool feature for a marketing department but I don't know if it's not outside Krita's vision for digital painting. Because in last ten years, I never reused this "color spot" again. The print/color situation I had was mostly cleaning CMYK documents: cleaning white from accidental yellow/magenta/black/cyan dots ; or transforming the black into the "Rich-Black" setting of the printer (often a mix of Cyan and Black); also cleaning orange and green to use more yellow because they tend to be quickly dull in CMYK. So, I'm a bit shared about how useful this feature can be for a digital painter creating digital art files from scratch.

woltherav added a comment.EditedNov 4 2017, 2:42 PM

Right, so it sounds like the only real spot color support we need to provide then is just open the colorswatches in icc profiles so that Iris Illustrator can get to pantone blush pink #3 as requested by Max Marketingperson to paint the flowers in.

Deevad added a comment.Nov 4 2017, 3:33 PM

@woltherav That would be useful, yes.

rempt added a comment.Jun 7 2019, 9:09 AM

Notes on the meeting with Jan-Peter Hohmann from Freie Farbe (https://www.freiefarbe.de):

  • Their system is lab based: no need to interpret special icc profiles for them.
  • All we'd need to have is a special Fill layer type where people can select a color from their color swatchbook
  • The next step is export to TIFF or PSD with spot color support. Scribus can import tiffs with spot colors.

Spot color discussion on Libtiff ML (Same thread, different archive software) :

https://www.asmail.be/msg0055490945.html
http://maptools-org.996276.n3.nabble.com/Spot-colors-in-TIFF-td13240.html

Spot colors in scribus:
https://graphicdesign.stackexchange.com/questions/92365/pantone-spot-colors-in-scribus

From the description in the libtiff ml I can infer that in scribus this function is responsible for loading the data:
https://github.com/scribusproject/scribus/blob/master/scribus/imagedataloaders/scimgdataloader.cpp#L111

No idea how scribus is handling saving out vectors with spot colors though. The Tiff version is raster based, it seems. God knows what psd does(given these are adobe/psd specific values, proly the same?).

woltherav added a comment.EditedJan 13 2022, 12:24 PM

Some updates on this:

The tiff file from the ML is a multi-layered tiff, and we can load the layers now thanks to Amyspark's layered-tiff work. However, the spot color info is still a bit of a mystery. We'll need to open the tiff in photoshop and see what is going on in the layer and channels dockers to proceed on this (and also, someone who actually builds with libtiff 4.2+ should check what the mystery-structs have in terms of data).

I can't get Scribus to load anything in that tiff beyond the usual preview, which either means that Scribus' appimage isn't being build with libtiff 4.2+, or scribus doesn't actually support this (I think a combo of both, Scribus doesn't seem to have code for anything but RGB, CMYK and Duotone). (Scribus, as far as I can tell from the source code, does support loading spot colors from EPS files, which is a matter of parsing the comments)


After messing with a hex-editor:

  1. the file in question has 3 extra alpha channels, this is cohesive with the base tiff file having 3 extra channels.
    • Said channels are named BLA1, BLA2 and BLA3, as per 0x03ee - Alpha channel names
    • IDs are stored in 0x041d - Alpha IDs, 4 bytes per id (| are my annotations): 38 42 49 4D | 04 1D 00 00 00 00 00 0C | 00 00 00 08 | 00 00 00 09 | 00 00 00 0A
    • 0x042B - (Photoshop CS)Alternate Spot Colors. stores LAB colors to represent these extra alpha channels (| are my annotations): 38 42 49 4D | 04 2B 00 00 00 00 00 2E | 00 01 00 03 | 00 00 00 08 | 00 07 | 14 AE | 0C 80 | 0B B8 | 00 00 || 00 00 00 09 | 00 07 | 15 24 | 15 E0 | 0D AC | 00 00 || 00 00 00 0A | 00 07 | 10 8B | 0B 54 | F4 48 | 00 00 however, this is not the actual place the spot colors are stored. I haven't found this place yet, but I know it's supossedly 'opaque'. (ML suggests that the colors are in HKS space, whose enum value is 10, but I have yet to find this value via hex search)
  2. There's 4 layers inside the tiff file. Three of them are named 'form', suggesting that these have some spot data. These layers are different from the 'hintergrund' layer in that they have additional layer data for SoCo and vmsk (that is solid color sheet and vector mask effect layers). Of these, only vmsk seems to have unique data per layer, suggesting that SoCo is just some extra settings.

EDIT: Ok, I've searched the whole file, but haven't been able to figure out how the vmsks relate to the extra alpha channels, and I cannot find anything about the original HKS values. The former may still be documented somewhere inside those vmsks, I just can't see them, the latter, I somewhat suspect Adobe just doesn't save to tiff (which is odd).

EDIT2: The HKS colors are in the 'display info', which consists of int16 cs, 4*int16 color, int16 opacity (0-100), char kind (selected 0, protected, 1), char padding (https://usermanual.wiki/Document/Photoshop20API20Guide.1445764450/html#pf8f).

04 35 00 00 | 00 00 00 2B | 00 00 00 01 | 00 0A 20 20 20 38 32 5A 00 00 00 32 02 | 00 0A 20 20 20 32 32 5A 00 00 00 32 02 | 00 0A 20 20 20 33 34 5A 00 00 00 32 02 | 00

These follow the aco/colorstruct definition, except for the books, it does the following:
int 16cs, and then a small string.
So 00 0A 20 20 20 38 32 5A is color space 10, HKS, " 82Z", which is an actual shade of red.

similarly, "pantone_solid_coated_reflex_blue_c" becomes 0B F4 52 45 42 4C 55 43 is colorspace 3060, "REBLUC".