[reportlab-users] Image Quality in Drawing

Robin Becker robin at reportlab.com
Fri May 12 10:59:40 EDT 2006


chadsjunkmail at mac.com wrote:
......
> 
>> c = Drawing(img_width, img_height)
>> c.add(Image(0,0,img_width, img_height, image_file.name))
>> c.add(wrappedString(text_x,text_y,text_w,text_h,text))
>> format = 'jpg'
>> return c.asString(format)
> 
> Thanks in advance for your help.  I have been a subscriber to the list 
> for quite some time, and although this is the first time I have asked a 
> question, I have learned a great deal from the experts here.
> 
> -Chad
.....

There's no support on the asString drawing method , but there may be support at 
the next level down.

Try doing renderPM.drawToString(drawing,fmt='jpg',configPIL={...})
where the configPIL argument is a format  specific set of keywords that is 
passed into PIL. I don't know what the needed keywords might be.

I think you should know that renderPM renders through a 3 plane bitmap only, so 
the best outcome you can get would be by using a lossless format. It may be that 
the jpeg doesn't translate very well into rgb.
-- 
Robin Becker


More information about the reportlab-users mailing list