nasa-apod-desktop icon indicating copy to clipboard operation
nasa-apod-desktop copied to clipboard

Keep the aspect ratio through ImageOps.fit

Open milot-mirdita opened this issue 13 years ago • 1 comments

With the use of ImageOps.fit the aspect ratio of the picture isn't distorted. This cuts off (in a pretty dumb way) that is outside of the center. A better approach might be something based on image entropy to cut out "uninteresting" parts of the images. Reddit uses a setup similar to this to make good thumbnails.

milot-mirdita avatar Jul 30 '12 00:07 milot-mirdita

You can also do this:

imgsize = 900, 900
img.thumbnail(imgsize, Image.ANTIALIAS)

Which will preserve the aspect ratio intelligently.

ranman avatar Aug 04 '12 03:08 ranman