You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Frangoo <fr...@yahoo.de> on 2010/08/25 11:10:46 UTC

PDF: Disable converting color to "Device Gray"

Hi users,

I have a problem with a color space.
I generate a PDF with FOP 1.0, and one page within is completely black.
But FOP generates a PDF, where the black page is not black, but dark gray.
With other XSL-FO engines I found out, that they have an option do select
different color-changing-features. When I deselect all, I get a nice black -
but if I enable "DeviceGray", I get there also the dark gray color.

After that I guess, that FOP is generating PDFs in general with that option
"Convert colors to DeviceGray".
My two questions:
1) Am I right?
2) Where can I disable that / or get anther solution?

Google & FOP-Pages didn't brought me any help.

Thanks very much to everybody who writes back !!


Regards,

Frangoo
-- 
View this message in context: http://old.nabble.com/PDF%3A-Disable-converting-color-to-%22Device-Gray%22-tp29530173p29530173.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: PDF: Disable converting color to "Device Gray"

Posted by Frangoo <fr...@yahoo.de>.
Hi,
first: thanks a LOT to all of your replies!!
And sorry for my late answer, I was busy with other stuff. But I was
following the answers and trying out your tips.
As I am a digital-web-person, I'm not that familiar with all the
color-profile-stuff so I didn't understood everything 100%.
I "solved" the problem now for my special situation, but I wanted to let you
know, maybe my information helps someone to go one with that problem (or to
ignore it in case everything was just ignorance on my side *argh*).

Because by a fluke, one of two images of the PDF-Page wasn't included in the
document, and than the background-color came out as real black :-) There was
something wrong with the image, so I changed it (was an transparent PNG)
with an JPG, and the background-color was still black. Great! BUT: Only in
the PDF-Reader. By printing, depending on the printer, the background-color
came out again not in a 100% black color.
So I made an ugly hack and put a black JPG as a background-image in the
page.

Regards

Frangoo
-- 
View this message in context: http://old.nabble.com/PDF%3A-Disable-converting-color-to-%22Device-Gray%22-tp29530173p29879268.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: PDF: Disable converting color to "Device Gray"

Posted by Craig Ringer <cr...@postnewspapers.com.au>.
On 30/08/10 22:47, Jeremias Maerki wrote:
> FOP doesn't have such an option. The PDF 1.4 spec says in chapter 6.2.1:
> "A gray level is equivalent to an RGB value with all three components
> the same."
> 
> And therefore we render gray values in the DeviceGray color space. That
> this doesn't work in your case is a bit surprising. But I've heard
> something similar just two weeks ago from a company that does photo
> books with FOP/Batik. But they had to do strange things like using CMYK
> and adding Magenta in addition to the K=1.0 value. They still just get
> an approximate black. I guess that's an issue of the printer they use. I
> suspect your case may be similar: a printer issue.

It's often an issue with the RIP or preflight tools, rather than the
printer/press its self.

ICC-aware RIPs will use ICC color space transforms to convert RGB
colours in a given space to the output device space - usually a custom
CMYK profile for the printer/press. /DeviceGray is a different colour
space to /DeviceRGB and the /DeviceGray to CMYK conversion is a
different mapping to the RGB one, potentially done with different
profiles. Some RIPs just convert /DeviceGray to /DeviceRGB then do the
transform from RGB, but that's not necessarily correct, especially in a
tagged document where there are mulitiple colour spaces in the same
co-ordinate system, like sRGB and AdobeRGB.

A proper configuration will use a greyscale profile that matches the RGB
profile. That's not very common, though, and really only works out where
the assumed greyscale curve happens to match the chosen or assumed RGB
profile.

If the RGB profile being used to interpret input RGB values has neutral
greys on the same curve as the profile being used for DeviceGray you'll
get the same CMYK result (barring colour manager quirks) - but if the
RGB profile doesn't have neutral grays, has a different gamma, etc then
you'll get different results. This is particularly the case where GCR or
UCR settings are involved on the output side; it's not uncommon to see
"rich" CMYK blacks produced for RGB input, but pure-K channel blacks
produced for greyscale input. Unsurprisingly, this looks horrid.

While proper RIP configuration - in particular, supplying a greyscale
profile that matches the RGB profile - will fix this, in practice it's
often best to stick to using one colour space in your document,
generally tagged RGB.

So, honestly, I don't think it's at all ideal to emit /DeviceGray in an
otherwise colour document. I'd certainly want the option to specify the
colour co-ordinate system(s) used - /DeviceGray only,
/DeviceGray+/DeviceRGB, or /DeviceRGB only.

I wasn't aware that fop did RGB to greyscale replacement, and I'm mildly
concerned about it, as I'm working on software that'll be producing PDFs
for pre-press consumption. I can always fix it up with some PitStop
rules in preflight, but I'd rather not need to.

Some time later I'd like to go head down in the FOP code to see if I can
extend it to support multiple colour spaces and CMYK profiles. I'm just
a bit wary about that, given the rather hostile reception I've seen to
contributed changes here; I can't afford to throw that much time away
and can't afford to maintain a parallel branch.

-- 
Craig Ringer

Tech-related writing: http://soapyfrogs.blogspot.com/

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


Re: PDF: Disable converting color to "Device Gray"

Posted by eagleMcMoe <mi...@cewecolor.de>.
Dear  Jeremias,

Thanks for this information. We also had problems with our RIP treating
grayscale black and RGB black differently.
So we first tried your proposal and commented out the if statement. Tada,
gray color was written as RGB. But the main problem was still there: black
still showed up as grayscale black instead of RGB black.
The key was the initial color. The default color is set to black, because
the default in PDF is black - but greyscale black (which should be
equivalent to RGB black, but the RIP is ignoring this). When we switched the
initial color in the Java code to null (in FOP 0.94 it is PDFState, in 1.1
it should be AbstractPaintingState) even black objects had a color differing
from the current one. Thus finally we are getting our RGB black.

So it would be nice to have an option in FOP that forces these RGB colors -
e.g. as a Batik transcoder hint ;-)

Best regards,
Michael



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/PDF-Disable-converting-color-to-Device-Gray-tp14452p39063.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: PDF: Disable converting color to "Device Gray"

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
FOP doesn't have such an option. The PDF 1.4 spec says in chapter 6.2.1:
"A gray level is equivalent to an RGB value with all three components
the same."

And therefore we render gray values in the DeviceGray color space. That
this doesn't work in your case is a bit surprising. But I've heard
something similar just two weeks ago from a company that does photo
books with FOP/Batik. But they had to do strange things like using CMYK
and adding Magenta in addition to the K=1.0 value. They still just get
an approximate black. I guess that's an issue of the printer they use. I
suspect your case may be similar: a printer issue.

I guess we could add such an option to disable that RGB to gray
replacement but I'm not sure if it would help. You can try to disable it
by changing org.apache.fop.pdf.PDFColor.java. Look for:

            boolean same = false;
            if (this.red == this.green && this.red == this.blue) {
                same = true;
            }

Comment out the "if" section and check if it helps. I suspect not.
Please keep me in the loop.

On 25.08.2010 11:10:46 Frangoo wrote:
> 
> Hi users,
> 
> I have a problem with a color space.
> I generate a PDF with FOP 1.0, and one page within is completely black.
> But FOP generates a PDF, where the black page is not black, but dark gray.
> With other XSL-FO engines I found out, that they have an option do select
> different color-changing-features. When I deselect all, I get a nice black -
> but if I enable "DeviceGray", I get there also the dark gray color.
> 
> After that I guess, that FOP is generating PDFs in general with that option
> "Convert colors to DeviceGray".
> My two questions:
> 1) Am I right?
> 2) Where can I disable that / or get anther solution?
> 
> Google & FOP-Pages didn't brought me any help.
> 
> Thanks very much to everybody who writes back !!
> 
> 
> Regards,
> 
> Frangoo
> -- 
> View this message in context: http://old.nabble.com/PDF%3A-Disable-converting-color-to-%22Device-Gray%22-tp29530173p29530173.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 



Jeremias Maerki


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


RE: Disable converting color to "Device Gray"

Posted by Eric Douglas <ed...@blockhouse.com>.
Which jars are you using?
I'm not sure which jar processes that particular tag.  I'm using the
fop.jar from 0.95 with the latest version of the other jars
(xmlgraphics-commons-1.4.jar, batik-all-1.7.jar..).  Output looks pretty
black to me.  What are you getting?

-----Original Message-----
From: Frangoo [mailto:frangoo2000@yahoo.de] 
Sent: Wednesday, August 25, 2010 9:00 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: Disable converting color to "Device Gray"


Hi Eric, OK I got you!

Right, I didn't saw that many variations of reaching out that result.


Eric Douglas wrote:
> 
> Are you using a background-color tag?  Are you pulling in a black 
> image?  I don't know how many other ways you could paint it black.
> You could for instance use svg code.
> 

So - it's only that part, that must be interesting for you:

<layout-master-set>
    <simple-page-master master-name="title-page"
page-height="{$page-height}" page-width="{$page-width}" margin="0mm">
        <region-body margin="0mm" background-color="black" />
    </simple-page-master>
.....


I tried also Hex (#000000), but nothing changed.

Thanks,

Regards

Frangoo
--
View this message in context:
http://old.nabble.com/PDF%3A-Disable-converting-color-to-%22Device-Gray%
22-tp29530173p29531989.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


RE: Disable converting color to "Device Gray"

Posted by Frangoo <fr...@yahoo.de>.
Hi Eric, OK I got you!

Right, I didn't saw that many variations of reaching out that result.


Eric Douglas wrote:
> 
> Are you using a background-color tag?  Are you pulling in a
> black image?  I don't know how many other ways you could paint it black.
> You could for instance use svg code.
> 

So - it's only that part, that must be interesting for you:

<layout-master-set>
    <simple-page-master master-name="title-page"
page-height="{$page-height}" page-width="{$page-width}" margin="0mm">
        <region-body margin="0mm" background-color="black" />
    </simple-page-master>
.....


I tried also Hex (#000000), but nothing changed.

Thanks,

Regards

Frangoo
-- 
View this message in context: http://old.nabble.com/PDF%3A-Disable-converting-color-to-%22Device-Gray%22-tp29530173p29531989.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


RE: Disable converting color to "Device Gray"

Posted by Eric Douglas <ed...@blockhouse.com>.
I would need to see whatever logic is producing the black background.  I
personally work in the XSL code though others on the list work with the
FO file.
Which piece of code that is depends on how you're trying to paint it
black.  Are you using a background-color tag?  Are you pulling in a
black image?  I don't know how many other ways you could paint it black.
You could for instance use svg code.
 

-----Original Message-----
From: Frangoo [mailto:frangoo2000@yahoo.de] 
Sent: Wednesday, August 25, 2010 8:13 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: Disable converting color to "Device Gray"


Hi Eric,


Eric Douglas wrote:
> 
> Do you have any code example?  I can think of a couple ways to produce

> a page which is entirely black, though I have no idea why you'd want 
> to do that.
> 
> 


thanks for your reply!!

Right now I don't have code example because code is in a big project and
splitted over many files. But of course I can arrange you examples -
which part is interesting for you? FOP-Configuration? Complete FO-File?
Final PDF?

OK, I wrote unclear what I want to do: The page is of course not just
black, it's just the background. White text and an image is included,
too :) But because the image is on the borders fading to black, you
notice, that the background is gray and not black :(

Thanks,

Frangoo
--
View this message in context:
http://old.nabble.com/PDF%3A-Disable-converting-color-to-%22Device-Gray%
22-tp29530173p29531570.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


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


RE: Disable converting color to "Device Gray"

Posted by Frangoo <fr...@yahoo.de>.
Hi Eric,


Eric Douglas wrote:
> 
> Do you have any code example?  I can think of a couple ways to produce a
> page which is entirely black, though I have no idea why you'd want to do
> that.
> 
> 


thanks for your reply!!

Right now I don't have code example because code is in a big project and
splitted over many files. But of course I can arrange you examples - which
part is interesting for you? FOP-Configuration? Complete FO-File? Final PDF?

OK, I wrote unclear what I want to do: The page is of course not just black,
it's just the background. White text and an image is included, too :) But
because the image is on the borders fading to black, you notice, that the
background is gray and not black :(

Thanks,

Frangoo
-- 
View this message in context: http://old.nabble.com/PDF%3A-Disable-converting-color-to-%22Device-Gray%22-tp29530173p29531570.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


RE: Disable converting color to "Device Gray"

Posted by Eric Douglas <ed...@blockhouse.com>.
Do you have any code example?  I can think of a couple ways to produce a
page which is entirely black, though I have no idea why you'd want to do
that.


-----Original Message-----
From: Frangoo [mailto:frangoo2000@yahoo.de] 
Sent: Wednesday, August 25, 2010 5:11 AM
To: fop-users@xmlgraphics.apache.org
Subject: PDF: Disable converting color to "Device Gray"


Hi users,

I have a problem with a color space.
I generate a PDF with FOP 1.0, and one page within is completely black.
But FOP generates a PDF, where the black page is not black, but dark
gray.
With other XSL-FO engines I found out, that they have an option do
select different color-changing-features. When I deselect all, I get a
nice black - but if I enable "DeviceGray", I get there also the dark
gray color.

After that I guess, that FOP is generating PDFs in general with that
option "Convert colors to DeviceGray".
My two questions:
1) Am I right?
2) Where can I disable that / or get anther solution?

Google & FOP-Pages didn't brought me any help.

Thanks very much to everybody who writes back !!


Regards,

Frangoo
--
View this message in context:
http://old.nabble.com/PDF%3A-Disable-converting-color-to-%22Device-Gray%
22-tp29530173p29530173.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


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