0

I am using the method ImageGrab.grabclipboard() of the library PIL(Python Imaging Library), to extract some pictures from my Excel file, but for some pictures I want to increase the size of image, how I can do this?
For example the following picture in the Excel file is like this:

image1

but I want it to be like this:

image2

wovano
  • 4,543
  • 5
  • 22
  • 49
Curious
  • 139
  • 2
  • 5
  • Does this answer your question? [How do I resize an image using PIL and maintain its aspect ratio?](https://stackoverflow.com/questions/273946/how-do-i-resize-an-image-using-pil-and-maintain-its-aspect-ratio) – wovano Oct 22 '21 at 08:25
  • 1
    Please share your code. And also a decent size grab of your Excel file rather than the 5-pixel high image you currently show. Also, what has the clipboard got to do with screen-grab? Thank you. – Mark Setchell Oct 22 '21 at 10:44
  • @MarkSetchell, why should the question be updated with code if it's a duplicate that has alread a lot of (highly upvoted) answers? And the Excel file is not relevant if the question is about image resizing. It should focus on ONE question at a time. Reading Excel files and resizing images are two different topics. – wovano Oct 22 '21 at 10:50
  • @wovano I'm not aware it is a duplicate - it doesn't show as closed on my machine - or even any votes to close. The Excel file seems highly relevant to me because I have no idea how that single line can hope to become the expected result so there must presumably be something wrong with the screen-capture and if that is the case, no amount of resizing will help. – Mark Setchell Oct 22 '21 at 10:55
  • @MarkSetchell, I agree it might be a different question now that I see the images (after my edit). In that case I think the question title is highly misleading and should be updated, since resizing an image has been discussed already thousands of times (see my first comment to one of the possible duplicates), but the problem seems to be with retrieving the image data from the Excel file. – wovano Oct 22 '21 at 10:58
  • @Curious, please clarify your question (try to focus on ONE specific problem), and indeed add some code, as already requested by Mark ;-) – wovano Oct 22 '21 at 10:59

1 Answers1

0

You can use Image.resize() to return a resized copy of this image.