Skip to main content

Import and resize pictures into amazon S3 storage

Project description


A python module to import and resize pictures into amazon S3 storage.


Typical usecase: fetch a bunch of image and generate thumbnails of various sizes for each of them, stored in S3.

from s3imageresizer import S3ImageResizer

from boto import s3
s3_conn = s3.connect_to_region(...)

# Initialize an S3ImageResizer:
i = S3ImageResizer(s3_conn)

urls = [

for url in urls:

    # Fetch image into memory

    # Apply the image EXIF rotation, if any

    # Resize this image, store it to S3 and return its url
    url1 = i.resize(

    # Do it again, with a different size
    url2 = i.resize(

More explanation

For method parameters, see the code (there isn't much of it ;-)

S3ImageResizer does all image operations in-memory, without writing images to disk.

S3ImageResizer uses PIL, has reasonable defaults for downsizing images and handle images with alpha channels nicely.


s3imageresizer requires Pillow, which in turn needs external libraries. On ubuntu, you would for example need:

sudo apt-get install libjpeg8 libjpeg8-dev libopenjpeg-dev


pip install s3imageresizer

Source code


Erwan Lemonnier

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

s3imageresizer-0.0.28.tar.gz (4.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page