I have a question about python's image processing module (Pillow).

Asked 2 years ago, Updated 2 years ago, 154 views

I executed the following code to take a screenshot with Pillow.However, both the x-axis and y-axis of the computer screen are captured in half.1000px by 1000px will capture only 500px by the top left of the screen as the starting position.I would appreciate it if you could let me know the improvements.
(The result was the same when you specified pixels.It's expected to recognize the entire screen up to half the width.)

 from PIL import ImageGrab
defmain():
    extraction=ImageGrab.grab()
    extraction.show()
    if__name__=="__main__":
main()

python pillow

2022-09-30 18:21

1 Answers

There was a Windows user who encountered the same problem at home SO and solved it.
https://stackoverflow.com/questions/24370228/python-imaging-library-fails-to-grab-whole-screen
According to him

  • Open the directory where Python executables reside (for example, c:/python27/)
  • right-click python.exe to select properties
  • Select Compatibility Tab
  • Press Change Settings for All Users
  • Check Disable Display Scaling in High DPI Settings

The above steps will make it work properly.
Give it a try.


2022-09-30 18:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.