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 TERRIB
I've used PIL, and the resample/resize results are TERRIBLE.
Resizing in PIL was broken in many ways and PIL is not maintained for a long time. Starting from Pillow 2.7 most of the problems are fixed along with dramatically performance improvement. Make sure you are using latest Pillow.
Last time I compared, this downscaler's output is almost identical to that of GIMP's "cubic" option:
import Image
def stretch(im, size, filter=Image.NEAREST):
im.load()
im = im._new(im.im.stretch(size, filter))
return im
IIRC, the differences are visually indistinguishable -- some pixel values +/-1 due to rounding, and they tend to be round the edges. It's not slow either.
cf: http://www.mail-archive.com/image-sig@python.org/msg00248.html
GIMP has a reasonable command-line interface, I think.