[reportlab-users] Transparent png

Robin Becker robin at reportlab.com
Wed May 24 05:19:34 EDT 2017


OK it turns out to be LA which is kind of what I suspected.




On 24/05/2017 09:22, Arkadi Colson wrote:
> Hi
>
> I'm not really sure how to get the mode. I attached the image. Perhaps you can
> give it a try?
> Thanks a lot!
>
in python

C:\code\hg-repos\reportlab\tmp>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> from PIL import Image
 >>> im=Image.open('gray-alpha.png')
 >>> im.mode
'LA'
 >>>



> Arkadi
>
>
> On 24-05-17 10:01, Robin Becker wrote:
>>
>> On 24/05/2017 08:17, Arkadi Colson wrote:
>>> I tried it and the result is this:
>>>
>>> The black square should be a transparent image and looks like this:
>>>
>>> Both are png images.
>>> The first one which is appearing correctly is "PNG image data, 48 x 48,
>>> 8-bit/color RGBA, non-interlaced". The black square is "PNG image data, 48 x 48,
>>> 8-bit gray+alpha, non-interlaced".
>>>
>>> Any idea why the "gray+alpha" isn't showing up correctly?
>>>
>>> Thx!
>>>
>>
>> Hi Arkadi,
>>
>> I'm almost sure that we don't support lots of stuff regarding colour mappings
>> especially with images.
>>
>> Since PNG is not native for PDF I think we're just doing this for PNG
.........
>>>> that means.
>>>>
>


-- 
Robin Becker


More information about the reportlab-users mailing list