xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: Color Profile not applied
Date Thu, 10 Jul 2008 19:01:18 GMT
Thanks for the PDF. That brought me on the right track. There's
absolutely nothing wrong about the color spaces in FOP. They are the
same as in that Photoshop PDF. The only difference I found was the lack
of a soft mask (transparency layer) for the image.

Your PNG file has 32 bit, i.e. includes an alpha channel (soft mask,
transparency). I realize now that we haven't understood transparency in
PDF well enough, yet, and that I've been chasing a ghost for months. So
I have to take a step back and find some time later to learn more about
this topic. No guarantees as to when that happens since I'm going to be
absorbed with other things at least in the next couple of weeks. Maybe
you can look into it yourself.

The work-around it seems is:
- either to convert the PNG from 32bit to 24bit (removing the alpha
channel)
- or skip generating the alpha channel for PDF output. See
ImageRenderedAdapter.setup(PDFDocument) (the line with "this.softMask ="
can be commented and the colors appear as they should).

On 10.07.2008 18:56:39 Dominique Bourely wrote:
> 
> Hi Jeremias,
> Here is the PDF file produced by the distiller within Photoshop 
> http://www.nabble.com/file/p18386294/testATS.pdf testATS.pdf 
> 
> Jeremias Maerki-2 wrote:
> > 
> > On 10.07.2008 13:28:05 Dominique Bourely wrote:
> >> 
> >> Excuse me for the delay.
> >> More explicetely, the PNG image loses the brilliance when included in PDF
> >> with FOP.
> >> I attach an example of such a PDF ( 
> >> http://www.nabble.com/file/p18380833/test-png-sans-output.pdf
> >> test-png-sans-output.pdf ) and the original image source (
> >> http://www.nabble.com/file/p18380833/img-test.png img-test.png ).
> >> On the opposite, when I use Acrobat Distiller to produce a PDF from the
> >> image (through Photoshop for instance), I am proposed to incorpore a
> >> color
> >> profile, and if (and only if) I accept and choose sRGB, the result is
> >> correct.
> > 
> > Can you send me that PDF that you produced with Photoshop? When I
> > produce PDF through means other than FOP, I get either sRGB with washed
> > out colors or Device RGB or DeviceCMYK.
> > 
> >> So our idea was to simplify the PNG decoder class to avoid image
> >> treatment.
> > 
> > There's no "treatment" or the image itself, just evaluation of
> > information inside the image being loaded. FOP reacts on the and tries
> > to put the right information inside the PDF.
> > 
> >> Could you help us estimate the workload to achieve this ?
> > 
> > You mean you want to write an option to ignore color profiles on images?
> > Here's what would be necessary:
> > 
> > There's already a configuration option that lets you disable the default
> > sRGB color profile which is necessary for making sure all XSL-FO colors
> > are mapped to PDF properly.
> > http://xmlgraphics.apache.org/fop/trunk/configuration.html#pdf-renderer
> > 
> > Switching this on will make it impossible to create PDF/A or
> > PDF/X-3:2003.
> > 
> > The key change is in org.apache.fop.render.pdf.ImageRenderedAdapter (in
> > the case of PNG images) where you'd need to override the ColorSpace
> > sent to the PDF library with the device-specific variant.
> > 
> > Then you'll need a way to signal that into the code. You can define an
> > extension attribute for fo:external-graphic (like
> > fox:ignore-color-profile="true") that is evaluated in
> > PDFRenderer.putImage(). I assume the AbstractImageAdapter will need to
> > be changed to carry that signal.
> > 
> > Please note: I consider this a hack or a desperate measure if all else
> > fails. Ignoring the color management is a way to fall back to
> > device-specific colors which is known to produce the color fidelity you
> > expect on screen. I'd rather find out if there's a bug in the way FOP
> > handles color profiles. But if I see so many other programs fail at
> > producing the colors you expect I have low hopes. Maybe your PDF gives
> > me a clue.
> > 
> >> 
> >> Jeremias Maerki-2 wrote:
> >> > 
> >> > FOP 0.95beta uses the sRGB color space by default (because XSL-FO
> >> > defines all RGB colors in the sRGB color space). FOP always embeds an
> >> > sRGB color profile. So specifying another sRGB color space explicitely
> >> > doesn't have any effect. Can you elaborate on what you mean by "an
> >> issue
> >> > regarding color brilliance"? 
> >> > 
> >> > Please also see my previous answers on similar questions:
> >> > http://www.nabble.com/file/p18380833/test-png-sans-output.pdf
> >> > test-png-sans-output.pdf 
> >> > http://markmail.org/message/3tuims2gjbconya5
> >> > http://markmail.org/message/qithk3gcoyrane3a
> >> > 
> >> > For FOP Trunk, the sRGB disabling option might be something related to
> >> > this:
> >> > http://xmlgraphics.apache.org/fop/trunk/configuration.html#pdf-renderer
> >> > 
> >> > On 30.06.2008 10:35:13 Dominique Bourely wrote:
> >> >> 
> >> >> Hi,
> >> >> 
> >> >> We use FOP extensively and we are facing now an issue regarding color
> >> >> brilliance of some of our included images.
> >> >> To keep this brilliance in the result PDF, we tried to use the sRGB
> >> Color
> >> >> Space Profile.icm in the conf file.
> >> >> But with no effect.
> >> >> 
> >> >> We use FOP 0.95b, along with xml-common-graphics-1.3.1
> >> >> 
> >> >> Has someone any idea ?
> >> >> 
> >> >> 
> >> >> -- 
> >> >> View this message in context:
> >> >>
> >> http://www.nabble.com/Color-Profile-not-applied-tp18190992p18190992.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
> >> > 
> >> > 
> >> > 
> >> 
> >> -- 
> >> View this message in context:
> >> http://www.nabble.com/Color-Profile-not-applied-tp18190992p18380833.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
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Color-Profile-not-applied-tp18190992p18386294.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


Mime
View raw message