Skip to content

Tag: png

How to add dotted or dashed line to png in Python?

Hello I want a draw a dashed or dotted line to png, I couldn’t find How can I do that, Can someone help ? im = Image.new(‘RGB’, (2000,2000),tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4))) print(“…Saving…”) im.save(‘C:\Users\th3m1s\Desktop\Lejant\’+str…

python generate QR code png without file output

I am using pypng and pyqrcode for QR code image generation in django app. When I call getQrWithURL with a url, it produces a file url.png to my directory. Is there a way to only get the image data without producing a file output? thanks for your help. Answer Use a BytesIO as a writable stream: Your variable P…

Creating a PNG file in Python

I have an application where I would like to be able to generate PNG images from data in Python. I’ve done some searching and found “PIL” which looked pretty outdated. Is there some other library that would be better for this? Thanks, Answer Is there some other library that would be better fo…