Python imaging alternatives

后端 未结 9 1212
渐次进展
渐次进展 2021-01-31 12:31

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

相关标签:
9条回答
  • 2021-01-31 13:03

    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.

    0 讨论(0)
  • 2021-01-31 13:04

    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

    0 讨论(0)
  • 2021-01-31 13:09

    GIMP has a reasonable command-line interface, I think.

    0 讨论(0)
提交回复
热议问题