|
View:
New views
12 Messages
—
Rating Filter:
Alert me
|
|
|
Color Profile not appliedHi,
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
|
|
|
Re: Color Profile not appliedFOP 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://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@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Color Profile not appliedJeremias Maerki a écrit :
> 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://markmail.org/message/3tuims2gjbconya5 > http://markmail.org/message/qithk3gcoyrane3a > > yet another attempt to solve the color saturation "issue" in aircraft manuals. Since your detailed answer (a couple of months ago) I've learned quite a few things (reading the PDF Reference Manual, among others) so I realize now that there are a couple interesting points in your post which I missed at that time. One of them was a hint that "rendering intents" could be a solution. Well, FYI, I've tried a patch in PdfImageXObject to add /Intent /Saturation to the image dictionaries and well... it does not seem to change anything in the way Acrobat Reader renders the document. Now I understand also that sRGB is in a certain way part of the FO "standard" (another point I missed) and that's the reason why it is implemented this way in FOP. But I guess we'll need some kind of local patch, e.g. a rewrite of PNGImageDecoder / Encoder in xmlgraphics-commons, rendering our PNG's in /DeviceRGB, to achieve the result our customer needs. Thanks, any comment or suggestion welcome ! --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Color Profile not appliedExcuse 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 ( test-png-sans-output.pdf) and the original image source (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. So our idea was to simplify the PNG decoder class to avoid image treatment. Could you help us estimate the workload to achieve this ?
|
|
|
Re: Color Profile not appliedOn 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@... > > For additional commands, e-mail: fop-users-help@... > > > > > > > > -- > 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@... For additional commands, e-mail: fop-users-help@... |
|
|
|
|
|
Re: Color Profile not appliedThat's because Foxit Reader doesn't do color management and Adobe Reader
does. On 10.07.2008 15:51:59 Pascal Sancho wrote: > Hi, > I just tried to read the PDF with both Foxit Reader v2.3 and Adobe Reader 8.1.2. > Foxit Reader gives expected color, while Adobe Reader Doesn't. > > HTH, > Pascal > > > -----Message d'origine----- > > De : Jeremias Maerki [mailto:dev@...] > > Envoyé : jeudi 10 juillet 2008 14:29 > > > > 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 ? > > > > Jeremias Maerki Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Color Profile not appliedHi Jeremias,
Here is the PDF file produced by the distiller within Photoshop testATS.pdf
|
|
|
Re: Color Profile not appliedThanks 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@... > >> > For additional commands, e-mail: fop-users-help@... > >> > > >> > > >> > > >> > >> -- > >> 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@... > > For additional commands, e-mail: fop-users-help@... > > > > > > > > -- > 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@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Color Profile not appliedJeremias Maerki a écrit :
> 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). > The first work-around is alas not an option for us [I work with Dominique on this question] at least not in the general sense. Of course we could write some image preprocessor before the FOP generation (there is at least one other such process in the app) but the customer will want to keep the alpha channel in the PNG they generate. We output these images in PDF through FOP, thus on a white background, but we also generate the manuals in HTML format on a background that can be switched black or white (for reading in the cockpit or in an hotel room or according to anyone's particular preference). --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
|
|
Re: Color Profile not applied
Jeremias Maerki a écrit :
This was not clear in our mind since I had a vague feeling I had seen things like gamma correction while browsing the code very quickly, but this may be somewhere else in a totally different context ? This hint helps us a lot. This is second very, very helpful hint. I've been once more through the code of this class; not sure at the moment I grasp everything about the way it works or how it fits in FOP general picture, but at least now I know what to look for and where we should put the effort...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. Well, I guess the customer is desperate to a point where a hack will do the job until in the long term someone (you / us / someone else) comes up with a clean solution.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. So that is not really a problem. |
|
|
Re: Color Profile not appliedPlease note that with my latest discovery this (color profiles) becomes
somewhat irrelevant here. The route to follow is to investigate how to improve the handling of the alpha channel in PDF. I believe we're missing something here. If I had enough time to pursue this, my first task would be to read up on transparency features in PDF 1.4 to get a better picture of how it works. The thing is: the soft mask has the value 0xFF for most pixels which should make most of the image fully transparent. And despite that the image appears as to be behind a veil. On 10.07.2008 22:56:11 Jean-François El Fouly wrote: > Jeremias Maerki a écrit : > > > > 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. > > > > > This was not clear in our mind since I had a vague feeling I had seen > things like gamma correction while browsing the code very quickly, but > this may be somewhere else in a totally different context ? > This hint helps us a lot. > > 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. > > > > > > > This is second very, very helpful hint. I've been once more through the > code of this class; not sure at the moment I grasp everything about the > way it works or how it fits in FOP general picture, but at least now I > know what to look for and where we should put the effort... > > 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. > > > > > Well, I guess the customer is desperate to a point where a hack will do > the job until in the long term someone (you / us / someone else) comes > up with a clean solution. > So that is not really a problem. Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscribe@... For additional commands, e-mail: fop-users-help@... |
| Free Forum Powered by Nabble | Forum Help |