[reportlab-users] painting an image over another

Michele Simionato michele.simionato at gmail.com
Fri Feb 4 04:00:56 EST 2005


On Fri, 4 Feb 2005 07:50:43 -0000, Andy Robinson <andy at reportlab.com> wrote:
> 
> From reortlab/pdfgen/canvas:
>     def drawImage(self, image, x, y, width=None, height=None, mask=None):
>         """Draws the image (ImageReader object or filename) as specified.
> 
>         "image" may be an image filename or a ImageReader object.  If width
>         and height are not given, the "natural" width and height in pixels
>         is used at a scale of 1 point to 1 pixel.
> 
>         The mask parameter takes 6 numbers and defines the range of
>         RGB values which will be masked out or treated as transparent.
>         For example with [0,2,40,42,136,139], it will mask out any
>         pixels with a Red value from 0-2, Green from 40-42 and
>         Blue from 136-139  (on a scale of 0-255)
> 

The docstring is not that clear to me. For instance, setFillColorRGB expects
the colors in range 0..1 , not 0..255 (?). I wanted to make the white color
transparent, so I tried mask=[254,255,254,255,254,255] but it didn't worked :-(
Still trying ...

     Michele Simionato


More information about the reportlab-users mailing list