Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3316598
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:29:17+00:00 2026-05-17T22:29:17+00:00

I’m currently using PIL to display images in Tkinter. I’d like to temporarily resize

  • 0

I’m currently using PIL to display images in Tkinter. I’d like to temporarily resize these images so that they can be viewed more easily. How can I go about this?

Snippet:

self.pw.pic = ImageTk.PhotoImage(Image.open(self.pic_file))
self.pw.pic_label = TK.Label(self.pw , image=self.pw.pic,borderwidth=0)         
self.pw.pic_label.grid(column=0,row=0)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:29:18+00:00Added an answer on May 17, 2026 at 10:29 pm

    Here’s what I do and it works pretty well…

    image = Image.open(Image_Location)
    image = image.resize((250, 250), Image.ANTIALIAS) ## The (250, 250) is (height, width)
    self.pw.pic = ImageTk.PhotoImage(image)
    

    There you go 🙂

    EDIT:

    Here is my import statement:

    from Tkinter import *
    import tkFont
    from PIL import Image
    

    And here is the complete working code I adapted this example from:

    im_temp = Image.open(Image_Location)
    im_temp = im_temp.resize((250, 250), Image.ANTIALIAS)
    im_temp.save("ArtWrk.ppm", "ppm") ## The only reason I included this was to convert
    ## The image into a format that Tkinter woulden't complain about
    self.photo = PhotoImage(file="ArtWrk.ppm") ## Open the image as a tkinter.PhotoImage class()
    self.Artwork.destroy() ## Erase the last drawn picture (in the program the picture I used was changing)
    self.Artwork = Label(self.frame, image=self.photo) ## Sets the image too the label
    self.Artwork.photo = self.photo ## Make the image actually display (If I don't include this it won't display an image)
    self.Artwork.pack() ## Repack the image
    

    And here are the PhotoImage class docs: http://www.pythonware.com/library/tkinter/introduction/photoimage.htm

    Note…
    After checking the pythonware documentation on ImageTK’s PhotoImage class (Which is very sparse) I appears that if your snippet works than this should as well as long as you import the PIL “Image” Library an the PIL “ImageTK” Library and that both PIL and tkinter are up-to-date. On another side-note I can’t even find the “ImageTK” module life for the life of me. Could you post your imports?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.