
- Python Pillow - Home
- Python Pillow - Overview
- Python Pillow - Environment Setup
- Basic Image Operations
- Python Pillow - Working with Images
- Python Pillow - Resizing an Image
- Python Pillow - Flip and Rotate Images
- Python Pillow - Cropping an Image
- Python Pillow - Adding Borders to Images
- Python Pillow - Identifying Image Files
- Python Pillow - Merging Images
- Python Pillow - Cutting and Pasting Images
- Python Pillow - Rolling an Image
- Python Pillow - Writing text on image
- Python Pillow - ImageDraw Module
- Python Pillow - Concatenating two Images
- Python Pillow - Creating Thumbnails
- Python Pillow - Creating a Watermark
- Python Pillow - Image Sequences
- Python Pillow Color Conversions
- Python Pillow - Colors on an Image
- Python Pillow - Creating Images With Colors
- Python Pillow - Converting Color String to RGB Color Values
- Python Pillow - Converting Color String to Grayscale Values
- Python Pillow - Change the Color by Changing the Pixel Values
- Image Manipulation
- Python Pillow - Reducing Noise
- Python Pillow - Changing Image Modes
- Python Pillow - Compositing Images
- Python Pillow - Working with Alpha Channels
- Python Pillow - Applying Perspective Transforms
- Image Filtering
- Python Pillow - Adding Filters to an Image
- Python Pillow - Convolution Filters
- Python Pillow - Blur an Image
- Python Pillow - Edge Detection
- Python Pillow - Embossing Images
- Python Pillow - Enhancing Edges
- Python Pillow - Unsharp Mask Filter
- Image Enhancement and Correction
- Python Pillow - Enhancing Contrast
- Python Pillow - Enhancing Sharpness
- Python Pillow - Enhancing Color
- Python Pillow - Correcting Color Balance
- Python Pillow - Removing Noise
- Image Analysis
- Python Pillow - Extracting Image Metadata
- Python Pillow - Identifying Colors
- Advanced Topics
- Python Pillow - Creating Animated GIFs
- Python Pillow - Batch Processing Images
- Python Pillow - Converting Image File Formats
- Python Pillow - Adding Padding to an Image
- Python Pillow - Color Inversion
- Python Pillow - M L with Numpy
- Python Pillow with Tkinter BitmapImage and PhotoImage objects
- Image Module
- Python Pillow - Image Blending
- Python Pillow Useful Resources
- Python Pillow - Quick Guide
- Python Pillow - Function Reference
- Python Pillow - Useful Resources
- Python Pillow - Discussion
Python Pillow - ImageDraw.point() Function
The ImageDraw.point() method is used to draw points, which are individual pixels, at specified coordinates on an image. The Python Pillow library provides this point() method within its ImageDraw module to draw points on images using the Draw object created by the Draw() class.
Syntax
Following is the syntax of the function −
ImageDraw.point(xy, fill=None)
Parameters
Here are the details of this function parameters −
xy − This parameter represents the coordinates of the points to be drawn. It can be specified as a sequence of either 2-tuples like [(x, y), (x, y), ...] or numeric values like [x, y, x, y, ...]. Each tuple or pair of numeric values corresponds to the (x, y) coordinates of a point.
fill − The color to use for the points. This parameter specifies the color of the drawn points.
Examples
Example 1
In this example, points are drawn at specified coordinates, and the fill color is set to yellow.
from PIL import Image, ImageDraw # Create a new image with a white background image = Image.new("RGB", (700, 300), "green") draw = ImageDraw.Draw(image) # Specify coordinates for points point_coordinates = [(100, 100), (200, 100), (100, 200), (200, 200), (150, 100), (200, 100), (150, 200), (200, 200), (250, 100), (300, 100), (250, 200), (300, 200), (350, 100), (400, 100), (350, 200), (400, 200), (450, 100), (500, 100), (450, 200), (500, 200), (550, 100), (600, 100), (550, 200), (600, 200)] # Set fill color for the points point_fill_color = "yellow" # Draw points on the image draw.point(point_coordinates, fill=point_fill_color) # Display the image image.show() print('The points are drawn successfully...')
Output
The points are drawn successfully...
Output Image

Example 2
The following example demonstrates drawing points on a black background in a grid pattern using a loop.
from PIL import Image, ImageDraw # Create a new image with a black background image_width, image_height = 700, 300 image = Image.new("RGB", (image_width, image_height), "black") draw = ImageDraw.Draw(image) # Set fill color for the points point_fill_color = "yellow" # Define step size and range for coordinates step = 20 x_range = range(step, image_width, step) y_range = range(step, image_height - step, step) # Draw points on the image for n in x_range: for x in y_range: draw.point((n, x), fill=point_fill_color) # Display the image image.show() print('The points are drawn successfully...')
Output
The points are drawn successfully...
Output Image

Example 3
This example demonstrates how to use the point() function to draw more number of points in random positions.
from PIL import Image, ImageDraw import random # Create a new image with a white background image_width, image_height = 700, 300 image = Image.new("RGB", (image_width, image_height), "white") draw = ImageDraw.Draw(image) # Set fill color for the points point_fill_color = "blue" # Draw 1000 randomly positioned points on the image num_points = 200 for temp in range(num_points): x = random.randint(0, image_width - 1) y = random.randint(0, image_height - 1) draw.point((x, y), fill=point_fill_color) # Display the image image.show() print('The points are drawn successfully...')
Output
The points are drawn successfully...
