Image Resizing using OpenCV | Python Last Updated : 30 Oct, 2025 Comments Improve Suggest changes 39 Likes Like Report OpenCV provides the cv2.resize() function, which allows you to resize images efficiently. By selecting different interpolation methods, you can control the balance between image quality and resizing speed.Syntax:cv2.resize(src, dsize[, dst[, fx[, fy[, interpolation]]]])Parameters:src: Source/input image.dsize: Desired size (width, height). Order is width first, then height.dst(Optional): Output image, rarely used explicitly.fx(optional): Scale factor along the horizontal axis.fy(optional): Scale factor along the vertical axis.interpolation(optional): Interpolation method to use.Return Value: Returns a resized image as a NumPy array, which can be displayed, saved, or further processed.Note: Use either dsize or fx/fy for scaling, dsize: when you know exact width & height and fx/fy: when you want to scale by a factor. Do not set both together (unless dsize=None)Interpolation MethodsInterpolation is the method used to decide pixel colors when an image is resized. Below are some methods:Method When to Use Descriptioncv2.INTER_AREAShrinking Minimizes distortion while downscaling.cv2.INTER_LINEARGeneral resizingBalances speed and qualitycv2.INTER_CUBICEnlargingHigher quality for upscalingcv2.INTER_NEARESTFast resizingQuick but lower qualityExample: Resizing images using OpenCV Python import cv2 import matplotlib.pyplot as plt image = cv2.imread("grapes.jpg") small = cv2.resize(image, None, fx=0.1, fy=0.1, interpolation=cv2.INTER_AREA) large = cv2.resize(image, (1050, 1610), interpolation=cv2.INTER_CUBIC) medium = cv2.resize(image, (780, 540), interpolation=cv2.INTER_LINEAR) titles = ["Original", "10% (INTER_AREA)", "1050x1610 (INTER_CUBIC)", "780x540 (INTER_LINEAR)"] images = [image, small, large, medium] plt.figure(figsize=(10, 8)) for i in range(4): plt.subplot(2, 2, i + 1) plt.imshow(cv2.cvtColor(images[i], cv2.COLOR_BGR2RGB)) # Convert BGR → RGB plt.title(titles[i]) plt.axis("off") plt.tight_layout() plt.show() OutputOutput representing different way to resize imageExplanation:cv2.imread(): Loads the image in BGR format.cv2.resize(): Resizes the image using either scale factors (fx, fy) or exact dimensions (dsize). INTER_AREA: Downscaling, INTER_CUBIC: Upscaling (smooth results) and INTER_LINEAR: General resizingcv2.cvtColor(): Converts image from BGR to RGB for correct Matplotlib display.plt.subplot(): Arranges multiple images in a 2×2 grid.plt.title(): Adds a title for each image.plt.axis("off"): Hides axis lines and labels.plt.tight_layout(): Adjusts spacing between images.Related Articles:Crop Image with OpenCVColor Conversion in OpenCVImage Cropping in OpenCV Create Quiz Image Resizing using OpenCV in Python Comment S Sourabh_Sinha Follow 39 Improve S Sourabh_Sinha Follow 39 Improve Article Tags : Python Image-Processing OpenCV Python-OpenCV Explore Python FundamentalsPython Introduction 2 min read Input and Output in Python 4 min read Python Variables 4 min read Python Operators 4 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 5 min read Python Functions 5 min read Recursion in Python 4 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 4 min read Python Tuples 4 min read Python Dictionary 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 5 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 3 min read Python MySQL 9 min read Python Packages 10 min read Python Modules 3 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 4 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 3 min read StatsModel Library - Tutorial 3 min read Learning Model Building in Scikit-learn 6 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 6 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 5 min read Build a REST API using Flask - Python 3 min read Building a Simple API with Django REST Framework 3 min read Python PracticePython Quiz 1 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like