Search code examples
pythonimageresizecrop

Standalone Python script for image resizing


I'm looking for a standalone python script which can perform 2 simple image editing tasks :

  • Resizing
  • Cropping

I browsed some websites this morning and found 2 interesting modules :

Unfortunately those are too complex for my needs and require installation on the server.

Do you guys know if there is any (very) basic Python script that can be embeded in a single file (standalone) outhere ?

If not, would it be complex to code my own image resizing/cropping script in Python ?

UPDATE

I've installed PIL for python 3x

For those interested, here is a nice tutorial on how to install it :

Install PIL in Ubuntu 12.04 Python 2.7 and Python 3.2


Solution

  • Implementing your own cropping and resizing code which is fast and accurate will not be viable. (PIL is 50% C ).

    Implementing the algorithms would be doable (nearest neighbour , bilinear interpolation)
    But handling different images formats with loading and saving is a HUGE task.