Convert RGB Color in SVG to Spot Color in PDF - svg

we are building an web application to design print products online. There are also some special finishes available for print. For example gold foil. There for we have to define the color in the final PDF in a specific way. It has to be a spot color with 100% magenta (c0 m100 y0 k0) and th color name "goldfoil".
In the design tool we are using a color with a hex code that is looking similar to gold in the browser (#9C9475). Our application is creating SVG that is converted via ghostscript to the PDF.
What I now want to achieve is to define a fallback or exchange color for specific hex colors like in this example #9C9475 that will convert this color in the PDF to the above described spot color.
Will this be possible? I found an article that svg 1.1 and above is supporting ICC Profiles and can produce CMYK and ICC named colors. In the documentation it says that I can define spot color in this way:
<color-profile name=„ISOcoated_v2_eci" xlink:href="http://swatches.example.com/ISOcoated_v2_eci.icc"/>
<circle fill=„#9C9475 icc-color(ISOcoated_v2_eci, Goldfolie"/>
But then I am missing the CMYK values.
Can somebody help me in this case?

Related

What technology has been used to generate this dynamic text on SVG and convert them to paths while auto adjusting the width?

he following banner is an example of what i want:
https://top.gg/api/widget/535064930727100427.svg
https://top.gg/api/widget/698275428976164945.svg
It's automatically generated and contains dynamic text which causes the "background color" to automatically adjust its size to it as well as have a border radius.
The text and shapes are all paths when I look at the source.
I would like to know how this has been accomplished as SVG itself does not support a dynamic border radius and background color by default.
Somewhere in the SVG source of the links above it showsid="surface19" and I did some research to see what piece of software or library provides such ID's. The text also seems to automatically be converted to paths, so it's not a hand-written SVG that gets modified programmatically from what it seems.
I did a lot of research before asking this question.

GIMP - Alpha to Color

I have created a simple square using GIMP which color is a shade of blue (#07192c). I lowered the opacity on this square a bit, and realized I like the shade of blue which was now created from lowering the opacity.
My question is, does GIMP have a function which allows you to select (like the eyedropper) the color of a transparent layer? I've searched but can only find 'color to alpha' which is not what I'm looking for.
You can activate the Sample merged option of the Color Picker tool. This will pick the color as it is shown in the image composition.
This setting is available in the tool options for the color picker:
Layer -> Transparency -> Remove Alpha Channel
Colours -> Map -> Colour Exchange...

color blending with GDI+

I am refering to a older question saying color blending with GDI+
Using GDI+ with Windows Forms, I want to be able to draw with a pen and blend color based on the destination pixel color.
For example, if I draw a line and it passes over black pixels, I want it to be a lighter color (like white for example) so that it's visible. When that same line passes over white pixels, it should be a darker color (black for example) so that it's still clearly visible.
the answers says to use a color matrix for transformation
so i started implementing it..
My image is present in raw data format in rgb48
Gdiplus::Bitmap image(input.width,input.height,input.width*6,PixelFormat48bppRGB,(unsigned char*)rgb48);
Gdiplus::Image *images= image.GetThumbnailImage(input.width,input.height);
Gdiplus::TextureBrush brush(images);
Gdiplus::Pen pen(&brush);
Gdiplus::ColorMatrix matrix={
-1.0f,0.0f,0.0f,0.0f,0.0f,
0.0f,-1.0f,0.0f,0.0f,0.0f,
0.0f,0.0f,-1.0f,0.0f,0.0f,
0.0f,0.0f,0.0f,1.0f,0.0f,
1.0f,1.0f,1.0f,0.0f,1.0f,
};
Gdiplus::Graphics gfx(&image1);
Gdiplus::ImageAttributes imageAttr;
imageAttr.SetColorMatrix(&matrix);
gfx.DrawImage(images,Gdiplus::Rect(0,0,input.width,input.height),0,0,1024,1024,Gdiplus::UnitPixel,&imageAttr);
I am not getting what i expect..Can some one help me in finding the mistake i m doing.
You can use the alpha component of a color to specify transparency, so that colors can be combined. However, if you want the combination to be something other than the alpha blend, you must draw the pixels yourself. You could first draw into a transparent bitmap, then render that onto the destination pixel by pixel.

ICC Color Profiles in SVG for webkit wkhtmltopdf or defining spot colours

Does webkit/wkhtmltopdf not support icc-color profiles in fill colours in SVG images?
I have an image that has the colour defined as:
#e22e27 icc-color(U.S.-Web-Coated--SWOP--v2, 0.0558938, 0.95947204, 0.98716716, 0.00204471)
Which is supposed to come out red (and does in inkscape)
However, chrome (and other browsers) just open it as black (I'm guessing because it can't get the fill colour?) and also wkhtmltopdf also comes out as black.
Is there any way of doing this? Or more specifically is there any way of defining a device spot colour in the SVG so that the final PDF can have a spot red (rather than a composite of RGB)?
Thanks
if you open the SVG in Inkscape 0.92 after removing the sRGB value #e22e27 I expect you will see black instead of red. This is because even when using the CMYK colour picker, Inkscape reads and writes fallback sRGB values from/to the SVG file. Native CMYK support is still in Inkscape's future, as far as I can tell.
Among the open source PDF renderers, mPDF supports defining spot colours by CMYK values and also supports embedding a subset of SVG in HTML, suggesting that it can read some SVG syntax natively. This would be a better starting point for a fully open source solution than wkhtmltopdf which does not support CMYK output at all, according to issue #39 on its GitHub project.
Of the proprietary renderers, PDFreactor supports passing CMYK values from an SVG directly to the renderer as long as they are not rasterised, although the syntax does not appear to match the W3C SVG spec and there is no sRGB fallback, so each SVG has to be specially crafted. This is quite easy for simple graphics originated in Inkscape; just replace for example in your SVG:
style="fill:#e22e27 icc-color(U.S.-Web-Coated--SWOP--v2, 0.0558938, 0.95947204, 0.98716716, 0.00204471);fill-opacity:1;fill-rule:nonzero;stroke:none"
with the C, M, Y, K values only:
style="fill:cmyk(0.0558938, 0.95947204, 0.98716716, 0.00204471);fill-opacity:1;fill-rule:nonzero;stroke:none"
I've recently used this technique in an attempt to match colours between SVGs and CMYK values specified in CSS for the document, for example between logos and font colours. See CSS Color Module Level 4 for the emerging device-cmyk syntax; in the meantime PDFreactor uses the non-standard cmyk syntax for CSS, as shown in the SVG example above.
In general, I'm wondering about the value of embedding a colour profile in a natively CMYK SVG. Perhaps the assumption is that we are starting from an sRGB value and need an approximation of it, but in my workflow I'm starting from CMYK values. I'd welcome clarification on that. Besides, it would be rather time-consuming to re-create every SVG file just because the printing machine, continent or paper has changed.

How can I get background color of a layer in Photoshop?

I have a design in .psd format. It is using various layers and diffrent settings for opacity. I am using Photoshop CS3. How can I get background color of the layer. One way is to use in-build Color Palette utility but that doesn't suits me. I want a way by which I can get exact Brush that is used for the background. It may or may not have Gradients.
Not that this is programming related, but use the eye-dropper tool.
http://www.ehow.com/how_2193268_use-eye-dropper-tool-photoshop.html
Once the color is placed into your "foreground color" box, click the box and it will show you the color in RGB, Hex, and pretty much any other way you can display a color value.

Resources