1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import Image, ImageDraw, ImageFont dimensions = (400, 200) img = Image.new("RGB", dimensions) # text font = ImageFont.truetype("/usr/local/share/fonts/UbuntuMono-B.ttf", 50) font2 = ImageFont.truetype("/usr/local/share/fonts/UbuntuMono-B.ttf", 25) draw=ImageDraw.Draw(img) draw.text((20, 20), 'Hacker News : ', fill=(255,255,255), font=font) draw.text((30, 100), 'You can paint on Ideone', fill=(200,200,200), font=font2) # ideone output import StringIO output = StringIO.StringIO() img.save(output, 'PNG') contents = output.getvalue() output.close() print contents |
-
upload with new input
-
result: Success time: 0.17s memory: 13008 kB returned value: 0
import Image, ImageDraw, ImageFont dimensions = (400, 300) img = Image.new("RGB", dimensions) # text font = ImageFont.truetype("/usr/local/share/fonts/UbuntuMono-B.ttf", 50) font2 = ImageFont.truetype("/usr/local/share/fonts/UbuntuMono-B.ttf", 25) draw=ImageDraw.Draw(img) draw.text((20, 20), 'Cracker Blues : ', fill=(255,255,255), font=font) draw.text((30, 100), 'You can paint on this', fill=(200,200,200), font=font2) # ideone output import StringIO output = StringIO.StringIO() img.save(output, 'PNG') contents = output.getvalue() output.close() print contents -
result: Success time: 0.16s memory: 13032 kB returned value: 0
import Image, ImageDraw, ImageFont dimensions = (400, 200) img = Image.new("RGB", dimensions) # text font = ImageFont.truetype("/usr/local/share/fonts/UbuntuMono-B.ttf", 50) font2 = ImageFont.truetype("/usr/local/share/fonts/UbuntuMono-B.ttf", 25) draw=ImageDraw.Draw(img) draw.text((20, 20), 'Hacker News : ', fill=(255,255,255), font=font) draw.text((30, 100), 'You can paint on donkeys', fill=(200,200,200), font=font2) # ideone output import StringIO output = StringIO.StringIO() img.save(output, 'PNG') contents = output.getvalue() output.close() print contents -
result: Success time: 0.17s memory: 13064 kB returned value: 0
draw.text((10, 20), 'Hacker News : ', fill=(255,255,255), font=font)
-
result: Success time: 0.17s memory: 13072 kB returned value: 0


