Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4157

Camera board • (Solution) Re: PiCamera 2 and PIL Pillow Draw Text

$
0
0

Code:

image = self.picam2.capture_image("main")        draw = ImageDraw.Draw(image)        # font = ImageFont.truetype(<font-file>, <font-size>)        font = ImageFont.truetype("fonts/segoe-ui-light.ttf", 16)        # draw.text((x, y),"Sample Text",(r,g,b))        draw.text((0, 0),"Sample Text",(255,255,255),font=font)        #img.save('test.png')
Problem solved.

Statistics: Posted by Monogram — Mon Jan 06, 2025 3:28 am



Viewing all articles
Browse latest Browse all 4157

Trending Articles