randomdrake / nasa-apod-desktop

Automatically downloads and sets the NASA picture of the day (APOD) as your desktop in Ubuntu.
Apache License 2.0
148 stars 62 forks source link

Keep the aspect ratio through ImageOps.fit #3

Open milot-mirdita opened 12 years ago

milot-mirdita commented 12 years ago

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.

ranman commented 12 years ago

You can also do this:

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

Which will preserve the aspect ratio intelligently.