About 2,470,000 results
Open links in new tab
  1. python - ImportError: No module named PIL - Stack Overflow

    On some installs of PIL, you must do. import Image instead of import PIL (PIL is in fact not always imported this way). Since import Image works for you, this means that you have in fact …

  2. python - how to install PIL with pip? - Stack Overflow

    Jul 19, 2021 · Use Pillow which is the "new" or the replacement of PIL, but has the same-named modules to preserve compatibility: pip install pillow Also, as suggested in the comments, …

  3. python - No module named 'PIL' - Stack Overflow

    Mar 13, 2018 · To fix the issue, I uninstalled PIL and Pillow through sudo pip3 uninstall pillow and sudo apt-get purge python3-pil. I then restarted and then used sudo -H pip3 install pillow to …

  4. How to reduce the image file size using PIL - Stack Overflow

    Jun 14, 2022 · The main image manager in PIL is PIL's Image module.. from PIL import Image import math foo = Image.open("path\\to\\image.jpg") x, y = foo.size x2, y2 = math.floor(x ...

  5. Compare images Python PIL - Stack Overflow

    Jun 26, 2018 · You can use ImageChops.difference in combination with getbbox:. from PIL import Image from PIL import ImageChops def are_equal(image_a: Image, image_b: Image) -> bool: …

  6. python - How can I save an image with PIL? - Stack Overflow

    Jan 22, 2013 · Here is what I did to import and then export an bmp image with PIL. def read_img(path): """ Read image and store it as an array, given the image path. Returns the 3 …

  7. How do I resize an image using PIL and maintain its aspect ratio?

    Nov 7, 2008 · You can combine PIL's Image.thumbnail with sys.maxsize if your resize limit is only on one dimension (width or height). For instance, if you want to resize an image so that its …

  8. How do I get the picture size with PIL? - Stack Overflow

    Jun 22, 2011 · Pillow has the same interface as PIL, but works with Python 3. Installation $ pip install Pillow If you don't have administrator rights (sudo on Debian), you can use $ pip install - …

  9. python - Getting list of pixel values from PIL - Stack Overflow

    I'm trying to convert a black & white .jpg image into a list which I can then modulate into an audio signal. I have imported the PIL module and am trying to call the built-in function: list(im.

  10. How do you composite an image onto another image with PIL in …

    Mar 5, 2017 · Try this code below. from PIL import Image # Load the existing image existing_image = Image.open("existing_image.png") # Create a new white image with …

Refresh