Hi Peter

I did some experiments mixing PTOCA-built backgrounds with GOCA-built
rectangles and SVG converted to bitmaps (see attached FO). When I look
into the generated file, all three elements use the same RGB values
(#FFCC00).

What we need to keep in mind here is that all colors are interpreted in
sRGB color space. But that information doesn't make it into the AFP file
due to lack of extended color support for AFP output in FOP. The colors
in the AFP are therefore interpreted in a device-dependent way. Still,
I'd expect all RGB values to be interpreted in the same way.

When I check with the usual AFP viewers, I don't see any mismatched
colors. Maybe the printer you're using does have some kind of extended
color management (which the viewers may not have) but maybe not for all
elements. That would suggest that the PTOCA colors and the image colors
in your case are somehow interpreted differently.

In the end, I have absolutely no idea what could cause the color
mismatch. :-( You may need to ask the printer manufacturer.

On 05.08.2010 13:07:47 Peter Hancock wrote:
> Hi,
> 
> I am having colour problems with AFP and wonder if the FOP community
> can help me.
> 
> I have a fo:block with a non-white background- colour (an arbitrary
> #AFA) and I have modified FOP  to overlay an image that is largely
> composed of the same colour.  The image is defined within the
> AFPPainter using
> a  org.apache.xmlgraphics.java2d.Graphics2DImagePainter2D; the
> Graphics2D drawing commands being defined in the pai
> nt method.  This is then wrapped in a
> org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D and passed to
> AFPPainter.drawImage.  This method is responsible for rendering the
> image: A stack trace shows that a call
> org.apache.xmlgraphics.image.loader.impl.ImageConverterG2DBitmap.convert
> is responsible for generating a BufferedImage.  FOP then uses
> AFPImageHandlerRenderedImage to handle the image: the bytes of the
> buffered image are directly written to the AFP and the image is tagged
> as an FS11 IOCA.
> 
> When I print the afp there is a visible difference in the blocks
> background colour and the images background colour and so I would like
> to know what sort of steps and considerations are required to resolve
> this.  I am currenty unclear exactly how the coloured areas of block
> like elements are represented in the AFP and how I can synchronize
> this with image creation.  Whilst I research this further myself, it
> would be great to have the  knowledge confirmed by other FOP
> developers with experience here.
> 
> This issue has cropped whilst working on a FOP extension for drawing
> rounded corners as my solution for generating them for AFP is to use
> corner images.  I am not using GOCA due to print server support
> issues.
> 
> I would be very grateful for any of your thoughts.
> 
> Thanks,
> 
> Pete




Jeremias Maerki

Attachment: color-mix.fo
Description: Binary data

Reply via email to