1

I have been searching the net for a while, but to no avail! Is there an image editing library for python that will allow me to convert 4:3 pictures to 16:9?

Any information and/or links are much appreciated!

Thanks!

Scholfield
  • 23
  • 2
  • Are you looking to crop, resize, ...? – Seth Johnson Jul 14 '11 at 22:01
  • 1
    Are you planning on cropping the image, or stretching the image? – MatBailie Jul 14 '11 at 22:01
  • 2
    The answer to most "Is it possible" question is "Yes." Please fix the question so the answer isn't a trivial "Yes." Perhaps you should ask something more focused on what you're trying to do and what code you've written so far. – S.Lott Jul 14 '11 at 22:15

2 Answers2

2

For naive resizing using one of a few various filter types, you can use Image.resize from the PIL:

im.resize(size) => image

im.resize(size, filter) => image

Returns a resized copy of an image. The size argument gives the requested size in pixels, as a 2-tuple: (width, height).

The filter argument can be one of NEAREST (use nearest neighbour), BILINEAR (linear interpolation in a 2x2 environment), BICUBIC (cubic spline interpolation in a 4x4 environment), or ANTIALIAS (a high-quality downsampling filter). If omitted, or if the image has mode "1" or "P", it is set to NEAREST.

Daniel DiPaolo
  • 55,313
  • 14
  • 116
  • 115
0

The Python Imaging Library has the ability to do this.

wberry
  • 18,519
  • 8
  • 53
  • 85