You can create a new image in Python using PIL library’s Image.new() method.
Syntax:
Image.new(mode, size, color)
Parameters:
mode – type of pixel (RGB, HSV etc). Check the modes supported by Python
size – a tuple, (width, height) in pixels
color – color of the new image. default is black (=0).
Example#1
Creating an image of 600×800 size, RGB type
from PIL import Image newImage = Image.new('RGB', (600, 800), color=0) # with default black color newImage.show()
Also See: How to download Instagram Images using Python?