[reportlab-users] transparency in unicode reportlab

Robin Becker robin at reportlab.com
Sat Jan 28 08:33:49 EST 2006


Jerome Alet wrote:
> On Sat, Jan 28, 2006 at 10:34:49AM +0000, Robin Becker wrote:
>> I've just checked with the trunk code and there at least the pdfgen 
>> images are OK with the mask working fine for GIF at least for a specifed 
>>  colour and also 'auto'. I think there's something wrong with jpeg 
>> support for transparency though. I will have to do some more testing. 
>> Unfortunately we still seem to have two paths through to images, 
>> probably because of the need to support pre-defined a85 images.
>>
>> Can you say what is broken?
> 
> hmm, probably jpeg.
> 
> I'll try to see if gif support is OK and I'll tell you ASAP.
> 
> bye
> 
> Jerome Alet
.....
jpeg is defintely not working at the moment so we turned it off.

The problem lies in this note on page 278 of the PDF-1.4 Spec.

Note: When color key masking is specified, the use of a DCTDecode filter 
for the stream is not recommended. DCTDecode is a lossy filter, meaning 
that the output is only an approximation of the original input data. 
This can lead to slight changes in the color values of image samples, 
possibly causing samples that were intended to be masked to be 
unexpectedly painted instead, in colors slightly different from the mask
color.

I can turn the colour masking back on and then see that the above is 
very true even with very simple images I get bad transparency. Could the 
problem also relate to the implicit RGB-->YUV transform for dctdecode?

-- 
Robin Becker



More information about the reportlab-users mailing list