Create new image in Python | method

You can create a new image in Python using PIL library’s method.

Syntax:, size, color)

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).


Creating an image of 600×800 size, RGB type

from PIL import Image

newImage ='RGB', (600, 800), color=0) # with default black color

Also See: How to download Instagram Images using Python?

About the Author


A passionate blogger. Love to share solutions and best practices on wordpress hosting, issues and fixes, excel VBA macros and other apps

Leave a Reply

Your email address will not be published. Required fields are marked *