[reportlab-users] reportlab and CMYK images, take 2
Robin Becker
reportlab-users@reportlab.com
Thu, 2 Oct 2003 13:08:52 +0100
In article <3F7C08A4.8060504@gmx.net>, Oliver Bleutgen <myzope@gmx.net>
writes
......
>Well, at least the fact that this conversion is generally done for PIL
>images confused me a little bit. For what I'm wanting to do, I don't
>need PIL at all, I just used it to create a test CMYK image to pass it
>directly into reportlab. When I made a mistake, passed a wrong object,
>and got a traceback about a missing convert method, I got suspicious ;).
>
>> At present I'm sure we aren't planning an immediate effort to add cmyk
>> images, but for JPEGS I see that we allow for the colorspace to default
>> to 'DeviceCMYK' after testing for 1 or 3 color components.
>>
>> When loading from a bitmap type image I guess we ought to allow for
>> testing the number of image components & masking & etc etc etc sigh :(
>
>
>Well, for my application I absolutely need to be sure that the images
>that get added to the pdf are not altered (modulo the size in which they
>are rendered). I'm willing to try come up with something here, the
>question is how to do it the best way.
>
>First, a basic question, does it make sense to try to do that in a way
>that the resulting code could be fed back into reportlab? (Not that
>there's a high probability that someone would want that code, lol). If
>not, I'd try to touch the reportlab code as little as possible.
>
any improvements will be welcomed.
>Now to the technical aspects, from staring at the pdf specification and
>pdfimages.py, it seems that adding a CMYK jpg file is straightforward,
>and nearly done. One thing I stumbled across was an inconsistent use of
>self.colorSpace ( in __init__() and in format() ) vs. colorSpace in
>pg_imagedata(). Seems like a bug, though I don't know if it has
>detrimental effects.
>
>Is it desirable and would it make sense to beef up reportlab's image
>capabilities? Are there any thoughts into what direction one should go
>with this?
>
>cheers,
>oliver
.....
--
Robin Becker