Python imaging alternatives

Paul McMillan picture Paul McMillan · Sep 18, 2009 · Viewed 9.9k times · Source

I have python code that needs to do just a couple simple things to photographs: crop, resize, and overlay a watermark. I've used PIL, and the resample/resize results are TERRIBLE. I've used imagemagick, and the interface and commands were designed by packaging a cat in a box, and then repeatedly throwing it down a set of stairs at a keyboard.

I'm looking for something which is not PIL or Imagemagick that I can use with python to do simple, high-quality image transformations. For that matter, it doesn't even have to have python bindings if the command line interface is good.

Oh, and it needs to be relatively platform agnostic, our production servers are linux, but some of our devs develop on windows. It can't require the installation of a bunch of silly gui code to use as a library, either.

Answer

bobince picture bobince · Sep 18, 2009

I've used PIL, and the resample/resize results are TERRIBLE.

They shouldn't be, as long as you:

  1. use only Image.ANTIALIAS filtering for downscaling operations
  2. use only Image.BICUBIC filtering for upscaling operations.
  3. remember to convert to 'RGB' colour mode before the resize if you are using a paletted image
  4. don't use .thumbnail(). it's crap
  5. set the quality= level to something appropriate when saving JPEGs (the default is quite low)