Bantal Python
pip install Pillow
Bazinga
pip install Pillow
from PIL import image
img = image.open('C:\Users\you\path\to\your\image.jpg')
pix = img.getpixel((100,100))
img.putpixel((0,0),(0,0,255))
from PIL import Image
img = Image.open("./my_image.png")
from PIL import Image, ImageDraw
with Image.open("hopper.jpg") as im:
draw = ImageDraw.Draw(im)
draw.line((0, 0) + im.size, fill=128)
draw.line((0, im.size[1], im.size[0], 0), fill=128)
# write to stdout
im.save(sys.stdout, "PNG")
from pil import Image
def newImg():
img = Image.new('RGB', (100, 100))
img.putpixel((30, 60), (155, 155, 55))
img.save(r'C:\Users\lenovo\Desktop\sqr.png')
return img
newImg()