Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Open CV
  • scikit-image
  • pycairo
  • Pyglet
  • Python
  • Numpy
  • Pandas
  • Python Database
  • Data Analysis
  • ML Math
  • Machine Learning
  • NLP
  • Deep Learning
  • Deep Learning Interview Questions
  • ML Projects
  • ML Interview Questions
  • 100 Days of Machine Learning
Open In App
Next Article:
Python OpenCV - setWindowTitle() Function
Next article icon

Python OpenCV - resizeWindow() Function

Last Updated : 03 Jan, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

resizeWindow() method in Python OpenCV is used to resize window displaying images/videos to a specific size. The specified window size is for images excluding toolbars. This only works for created windows having flags other than CV_WINDOW_AUTOSIZE.

Syntax: cv2.resizeWindow(window_name, width, height)

Parameters:

  • window_name: Name of the window that will display image/video
  • width: New window width (integer type)   
  • height: New window height (integer type)

Return Value: It doesn't return anything

Image used for below examples:

Example 1:

Python3
# Python program to explain cv2.resizeWindow() method  # Importing cv2 import cv2  # Path path = 'C:/Users/art/OneDrive/Desktop/geeks.png'  # Reading an image in default mode image = cv2.imread(path)  # Naming a window cv2.namedWindow("Resized_Window", cv2.WINDOW_NORMAL)  # Using resizeWindow() cv2.resizeWindow("Resized_Window", 300, 700)  # Displaying the image cv2.imshow("Resized_Window", image) cv2.waitKey(0) 

Output:

Example 2:

Python3
# Python program to explain cv2.resizeWindow() method  # Importing cv2 import cv2  # Path path = 'C:/Users/art/OneDrive/Desktop/geeks.png'  # Reading an image in grayscale mode image = cv2.imread(path, 0)  # Naming a window cv2.namedWindow("Resize", cv2.WINDOW_NORMAL)   # Using resizeWindow() cv2.resizeWindow("Resize", 700, 200)  # Displaying the image cv2.imshow("Resize", image) cv2.waitKey(0) 

Output:


Next Article
Python OpenCV - setWindowTitle() Function
author
vibhutijain99
Improve
Article Tags :
  • Python
  • OpenCV
  • Python-OpenCV
Practice Tags :
  • python

Similar Reads

  • Python OpenCV - setWindowTitle() Function
    Python OpenCV setWindowTitle() method used for giving the title of the windows. It takes 2 parameters that are windows name and the title that needs to be given. Both the parameters are expected to be of string type. Syntax: cv2.setWindowTitle( winname, title )  Parameters: winname: windows nametitl
    1 min read
  • Wand resize() function in Python
    Resize image refers to change dimensions of original image in order to convert original image in dimensions that are perfect to use.Scaling Down refers to decrease dimensions of images and make image size smaller. While Scaling Up refers to increase dimensions of an image, and making image size larg
    2 min read
  • Python OpenCV - startWindowThread() Function
    This article will discuss how to use the python OpenCV startWindowThread() function. Do you want to display images and videos using a simplified interface through an OpenCV code? Then, you must check out the OpenCV startWindowsThread() function, which lets you use the high GUI windows, i.e., a simpl
    3 min read
  • Python OpenCV - selectroi() Function
    In this article, we are going to see an interesting application of the OpenCV library, which is selectROI(). With this method, we can select a range of interest in an image manually by selecting the area on the image. Syntax:  cv2.selectROI(Window_name, source image) Parameter: window_name:  name of
    3 min read
  • Python OpenCV - waitKey() Function
    waitkey() function of Python OpenCV allows users to display a window for given milliseconds or until any key is pressed. It takes time in milliseconds as a parameter and waits for the given time to destroy the window, if 0 is passed in the argument it waits till any key is pressed.  Examples 1: Disp
    1 min read
  • Python OpenCV - waitKeyEx() Function
    Python OpenCv waitKeyEx() method is similar to waitKey() method but it also returns the full key code. The key code which is returned is implementation-specific and depends on the used backend: QT/GTK/Win32/etc. Syntax: cv2.waitKey(delay) Parameters: delay: The time in milliseconds after which windo
    2 min read
  • turtle.window_width() function in Python
    The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.window_width() This function is used to return the width of the turtle windo
    1 min read
  • Wand adaptive_resize() function - Python
    The adaptive_resize() function is an inbuilt function in the Python Wand ImageMagick library which is used to resize the image by mesh interpolation technique. It is present in class wand.image. Syntax: adaptive_resize(columns, rows) Parameters: This function accepts two parameters as mentioned abov
    2 min read
  • Python | Window size Adjustment in Kivy
    Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. Kivy provides you the functionality to write the code for once and run it on different platforms. It is basically used to develop the Android application, but it does not mean that it can not
    4 min read
  • Wand transform() function in Python
    In order to resize and crop an image at the same time transform() function is used in wand. First crop operation is performed and then resize operation. Syntax : wand.image.transform(crop='', resize='') Parameters : Parameter Input Type Description crop basestring A geometry string defining a subreg
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences