Answers for "how to write an img file python"

0

how to make images in python

#Here is an example of creating a flag:
from PIL import Image

def flag(c,w=100,h=100):
	c1,c2,c3 = c.split()
	img = Image.new("RGB", (w*3,h), c1)
	lay1 = Image.new("RGB", (w,h), c2)
	lay2 = Image.new("RGB", (w,h), c3)
	img.paste(lay1,(w,0))
	img.paste(lay2,(w*2,0))
	img.show()

flag("gold blue pink",200,350)
Posted by: Guest on November-23-2021
0

how to write a script to display an image in python

>>> from PIL import Image                                                                                
>>> img = Image.open('test.png')
>>> img.show()
Posted by: Guest on January-12-2020

Code answers related to "how to write an img file python"

Python Answers by Framework

Browse Popular Code Answers by Language