1

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

Community
  • 1
  • 1
Koffee
  • 317
  • 1
  • 2
  • 10
  • Doing image scaling well is a hard task, I wouldn't bother reinventing the wheel. Installing PIL takes one line of code, and resizing an image takes four. – mbatchkarov Apr 06 '13 at 13:35

1 Answers1

1

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.

Borian
  • 622
  • 10
  • 19
  • All right i'll install it then, it seems more reasonnable. Do you know if C code absolutely requires some installation ? I can try do dig into the code, but it seems C code can't be embeded in Python as is. – Koffee Apr 06 '13 at 16:39
  • I have not done this before, but there is always help in the [docs](http://docs.python.org/2/extending/extending.html) – Borian Apr 06 '13 at 23:09