Wobblester
Wobblester

Reputation: 740

Enlarging a text to be put onto a picture

For the chosen a picture, I am using a for loop and if statements to set the the values of green, red, and blue to 50, if they are below 120. Then I am putting a text on to on the picture, then the picture is saved if desired. I would like to increase the font size of the text which is being put on the picture but not sure how to. I didn't google it did find some thing but hav

My Code:

import media
pic=media.load_picture("C:/Users/ramanujan/Pictures/rj.jpg")

for i in media.get_pixels(pic):
   green=media.get_green(i)
   if green<120:
       green=media.set_green(i,50)

    blue=media.get_blue(i)
    if blue<120:
        blue=media.set_blue(i,50)

    red=media.get_red(i)
    if red<120:
        red=media.set_red(i,50)

media.add_text(pic,150,600,"PICTURE NAME",media.red)
media.show(pic)
media.save_as(pic,)

Upvotes: 1

Views: 115

Answers (1)

Rob Wouters
Rob Wouters

Reputation: 16327

Take a look at Picture.add_text_with_style.

Upvotes: 1

Related Questions