Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

python-imaging-library

How to reduce a jpeg size to a ‘desired size’?

August 19, 2022 by Magenaut

In Python 3.x, I am using PIL to resize images, I know that we can reduce the height or width by subtraction or division by pixels. But, is it possible to resize an image to a desired size, say 200kb and remain its proportions? Assuming the image(s) is larger but the size is unknown.

Categories Python, Q&A Tags image, python, python-imaging-library, resize Leave a comment

How to write PNG image to string with the PIL?

August 19, 2022 by Magenaut

I have generated an image using PIL. How can I save it to a string in memory?
The Image.save() method requires a file.

Categories Python, Q&A Tags python, python-imaging-library Leave a comment

scipy.misc module has no attribute imread?

August 19, 2022 by Magenaut

I am trying to read an image with scipy. However it does not accept the scipy.misc.imread part. What could be the cause of this?

Categories Python, Q&A Tags dependencies, installation, python, python-imaging-library, scipy Leave a comment

Python Image Library fails with message “decoder JPEG not available” – PIL

August 18, 2022 by Magenaut

PIL does support JPEG in my system.

Categories Python, Q&A Tags jpeg, pillow, python, python-imaging-library Leave a comment

Get pixel’s RGB using PIL

August 18, 2022 by Magenaut

Is it possible to get the RGB color of a pixel using PIL?
I’m using this code:

Categories Python, Q&A Tags image, pixel, python, python-imaging-library, rgb Leave a comment

How does perspective transformation work in PIL?

August 18, 2022 by Magenaut

PIL’s Image.transform has a perspective-mode which requires an 8-tuple of data but I can’t figure out how to convert let’s say a right tilt of 30 degrees to that tuple.

Categories Python, Q&A Tags perspective, python, python-imaging-library Leave a comment

Trim whitespace using PIL

August 18, 2022 by Magenaut

Is there a simple solution to trim whitespace on the image in PIL?

Categories Python, Q&A Tags imagemagick, python, python-imaging-library Leave a comment

Convert RGBA PNG to RGB with PIL

August 18, 2022 by Magenaut

I’m using PIL to convert a transparent PNG image uploaded with Django to a JPG file. The output looks broken.

Categories Python, Q&A Tags jpeg, png, python, python-imaging-library, rgba Leave a comment

How to update the image of a Tkinter Label widget?

August 17, 2022 by Magenaut

I would like to be able to swap out an image on a Tkinter label, but I’m not sure how to do it, except for replacing the widget itself.

Categories Python, Q&A Tags python, python-2.7, python-imaging-library, tkinter Leave a comment

Convert image from PIL to openCV format

August 17, 2022 by Magenaut

I’m trying to convert image from PIL to OpenCV format. I’m using OpenCV 2.4.3.
here is what I’ve attempted till now.

Categories Python, Q&A Tags image-processing, opencv, python, python-imaging-library Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … Page5 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress