You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Jan Tošovský <j....@tiscali.cz> on 2009/03/29 00:42:55 UTC

Rasterizing of SVG file with the linked graphics fails if CMYK icc profile is specified

Hello Everyone,

I try rasterize my SVG file - it is composed from simple vector objects and
linked JPEG images. It is generated via script so I have full control over
it. It will be printed on commercial press so I try to use CMYK colors and
to apply the same ICC profile to the linked sRGB images.

I have defined cmyk profile in defs section:
<svg:color-profile name="cmyk" rendering-intent="perceptual"
xlink:href="EuropeISOCoatedFOGRA27.icc"/>

If the color of any vector object is specified using "rgb(255, 0, 0)
icc-color(cmyk, 0, 1, 1, 0)", it works fine (to tell the truth, while colors
in PDF file are great, in JPEG output they are quite shifted - red has more
magenta for example).

I've tried to specify color-profile to one linked JPEG file using
color-profile="cmyk" (similarly to colorProfile.svg in Example files, but
with CMYK profile), but during rasterizing to JPEG or PDF I am getting error
Input image and asociated color profile have mismatching number of color
components: conversion is not possible.

Does it mean that such operation is impossible? Or should I set something
else? 

Thanks in advance for any response.

Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Rasterizing of SVG file with the linked graphics fails if CMYK icc profile is specified

Posted by Helder Magalhães <he...@gmail.com>.
Hi Jan,


> I have defined cmyk profile in defs section:
> <svg:color-profile name="cmyk" rendering-intent="perceptual"
> xlink:href="EuropeISOCoatedFOGRA27.icc"/>
>
> If the color of any vector object is specified using "rgb(255, 0, 0)
> icc-color(cmyk, 0, 1, 1, 0)", it works fine (to tell the truth, while colors
> in PDF file are great, in JPEG output they are quite shifted - red has more
> magenta for example).
>
> I've tried to specify color-profile to one linked JPEG file using
> color-profile="cmyk" (similarly to colorProfile.svg in Example files, but
> with CMYK profile), but during rasterizing to JPEG or PDF I am getting error
> Input image and asociated color profile have mismatching number of color
> components: conversion is not possible.

Without deep knowledge on this, according to a tightly related thread
[1] (which provides significant background on this), it sounds like
Batik may not yet support this; a patch [2] may help workaround some
(all?) of these limitations. Maybe Thomas can confirm and add up more
interesting feedback? :-)


> Does it mean that such operation is impossible? Or should I set something
> else?

Also, if you are trying to use SVG for page composition, you may want
to take a look at FOP [3], which appears to support this (at least,
this is hinted from a fixed issue [4] which the related thread [1]
refers). Jeremias can probably provide more information on this. ;-)


> Thanks in advance for any response.
>
> Jan

Hope this helps,
 Helder


[1] http://www.nabble.com/fop---svg---icc-(and-cmyk-color)-td6772954.html
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=27248
[3] http://xmlgraphics.apache.org/fop/
[4] https://issues.apache.org/bugzilla/show_bug.cgi?id=40729

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Rasterizing of SVG file with the linked graphics fails if CMYK icc profile is specified

Posted by Jan Tošovský <j....@tiscali.cz>.
> > I've supposed (maybe wrong) if CMYK ICC profile is 
> > applied to RGB image (offset printing in my case), it will 
> > be displayed on monitor (or exported to any format) similarly
> > to the printed output (~ soft proof). 

> No, this use of icc-profiles is to specify what color space the 
> data in the file is really described in.  In other words it's for 
> specifying an input profile, you want to specify an output profile. 

Ok, so for most of images it needn't to be specified as default value 'auto'
reads this info directly from image.

> > if JPEG is converted into CMYK:
> > - in Photoshop: it is read in Batik, but on my PC both JPEG 
> > and PDF outputs are in negative.
 
> Did you try applying the ICC profile in this case? 

In that time no. As written above, it should work correctly as profile from
image should be read automatically by default (written in SVG
specification).

I've tested it now with color-profile specified, but I am getting old known
warning message ... mismatching number of components... and raster image is
ignored in the output. 

When trying ImageMagick's identify -verbose flower_ps.jpg, I am getting 4
cmyk channels and cmyk profile included. Image converted into cmyk using
ImageMagick has similar 4 channel info & profile included, but Batik
conversion fails with error JPEG URL is corrupt or unsupported variant. In
both cases there is Endianess: Undefined. I remeber one problem in OpenGL,
where bitmap is not stored in RGB order and values of each pixel had to be
swapped. But it is not negative like in this case.
Files can found at 
http://nio.astronomy.cz/batik/flower_ps.jpg (Photoshop CMYK)
http://nio.astronomy.cz/batik/flower_im.jpg (ImageMagick CMYK)
http://nio.astronomy.cz/batik/flower_orig.jpg (original in RGB)

> > It discouraged me from trying to make very basic 'soft 
> > proof' of SVG file in Batik. I'll use RGB images. 
 
> Sorry, It would be difficult to make Batik support images 
> with anything other than 3 color bands.

No problem. I understand it is open source. BTW, very nice piece of
software. Thanks for it.

Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Rasterizing of SVG file with the linked graphics fails if CMYK icc profile is specified

Posted by th...@kodak.com.
Hi Jan,

> > I don't think Batik supports 4 channel colorspaces for Raster content 
> > (for a number of SVG features I think this would be undefined, in
> > particular Filters and Masks). 

> > > but during rasterizing to JPEG or PDF I am getting error
> > > Input image and asociated color profile have mismatching number of 
color
> > > components: conversion is not possible.
> 
> > I should say that the above error sounds like your JPEG doesn't 
> > have 4 channels

Jan To?ovský <j....@tiscali.cz> wrote on 03/30/2009 01:13:46 PM:

> Yes, JPEG has only RGB channels. 
> 
> BTW, I've supposed (maybe wrong) if CMYK ICC profile is applied to RGB 
image
> (offset printing in my case), it will be displayed on monitor (or 
exported
> to any format) similarly to the printed output (~ soft proof).

   No, this use of icc-profiles is to specify what color space the
data in the file is really described in.  In other words it's for
specifying an input profile, you want to specify an output profile.


> > (although it's also possible that our JPEG reader doesn't 
> > know how to load 4 channels). 
> 
> For those who are interested, if JPEG is converted into CMYK:
> - in Photoshop: it is read in Batik, but on my PC both JPEG and PDF 
outputs
> are in negative.

   Did you try applying the ICC profile in this case?

> It discouraged me from trying to make very basic 'soft proof' of SVG 
file in
> Batik. I'll use RGB images. 

   Sorry, It would be difficult to make Batik support images with anything
other than 3 color bands.

RE: Rasterizing of SVG file with the linked graphics fails if CMYK icc profile is specified

Posted by Jan Tošovský <j....@tiscali.cz>.
Hi Thomas,

> I don't think Batik supports 4 channel colorspaces for Raster content 
> (for a number of SVG features I think this would be undefined, in
particular 
> Filters and Masks). 
	
> > but during rasterizing to JPEG or PDF I am getting error
> > Input image and asociated color profile have mismatching number of color
> > components: conversion is not possible.
	
> I should say that the above error sounds like your JPEG doesn't 
> have 4 channels

Yes, JPEG has only RGB channels. 

BTW, I've supposed (maybe wrong) if CMYK ICC profile is applied to RGB image
(offset printing in my case), it will be displayed on monitor (or exported
to any format) similarly to the printed output (~ soft proof). I know it
from Photoshop where the mode can be switched from RGB to CMYK. You can
observe color changes without necessity to have original image saved in CMYK
mode. If image have to be distributed, yes, it must be saved first (jpeg or
tiff format).

> (although it's also possible that our JPEG reader doesn't 
> know how to load 4 channels). 

For those who are interested, if JPEG is converted into CMYK:
- in Photoshop: it is read in Batik, but on my PC both JPEG and PDF outputs
are in negative.
- via ImageMagick: Batik complains that JPEG URL is corrupt or unsupported
variant

It discouraged me from trying to make very basic 'soft proof' of SVG file in
Batik. I'll use RGB images. 

Thanks to all for response.

Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Rasterizing of SVG file with the linked graphics fails if CMYK icc profile is specified

Posted by th...@kodak.com.
Hi Jan,

Jan To?ovský <j....@tiscali.cz> wrote on 03/28/2009 07:42:55 PM:

> I've tried to specify color-profile to one linked JPEG file using
> color-profile="cmyk" (similarly to colorProfile.svg in Example files, 
but
> with CMYK profile)[...]

     I don't think Batik supports 4 channel colorspaces for Raster content
(for a number of SVG features I think this would be undefined, in 
particular
Filters and Masks).

> but during rasterizing to JPEG or PDF I am getting error
> Input image and asociated color profile have mismatching number of color
> components: conversion is not possible.

> Does it mean that such operation is impossible? Or should I set 
something
> else? 

   I should say that the above error sounds like your JPEG doesn't
have 4 channels (although it's also possible that our JPEG reader doesn't
know how to load 4 channels).