thumbnails

Creating thumbnails from video files with Python

Creating thumbnails from video files with Python Question: I need to create thumbnails for a video file once I’ve uploaded to a webapp running python. How would I go about this… I need a library that can basically either do this for me, or that can read the image frames out of video files (of …

Total answers: 9

PIL: Thumbnail and end up with a square image

PIL: Thumbnail and end up with a square image Question: Calling image = Image.open(data) image.thumbnail((36,36), Image.NEAREST) will maintain the aspect ratio. But I need to end up displaying the image like this: <img src=”/media/image.png” style=”height:36px; width:36px” /> Can I have a letterbox style with either transparent or white around the image? Asked By: Paul Tarjan …

Total answers: 7

How do I generate circular thumbnails with PIL?

How do I generate circular thumbnails with PIL? Question: How do I generate circular image thumbnails using PIL? The space outside the circle should be transparent. Snippets would be highly appreciated, thank you in advance. Asked By: ohnoes || Source Answers: The easiest way to do it is by using masks. Create a black and …

Total answers: 5

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

How do I resize an image using PIL and maintain its aspect ratio? Question: Is there an obvious way to do this that I’m missing? I’m just trying to make thumbnails. Asked By: saturdayplace || Source Answers: Define a maximum size. Then, compute a resize ratio by taking min(maxwidth/width, maxheight/height). The proper size is oldsize*ratio. …

Total answers: 23