0

What i want is just to resize an image using PythonMagick 0.9.1.

Unfortunately there is no documentation yet. I found this link where user uses resize() with PythonMagick 0.9.3. There is no resize() function in the 0.9.1 version and I don't want to upgrade for know.

Ιs there any way to do it? Thanks in advance.

Community
  • 1
  • 1
ilstam
  • 1,473
  • 4
  • 18
  • 32
  • http://stackoverflow.com/questions/1740158/documents-and-examples-of-pythonmagick seems to answer this. – Gareth Latty Dec 25 '11 at 23:38
  • sorry if I'm wrong but I can't see where my question being answered there. I dont' want to use pythonmagickwand too. – ilstam Dec 26 '11 at 00:31

2 Answers2

3

Instead of using the resize method, you can use the transform method:

image = PythonMagick.Image(<filename>)
image.transform('<width>x<height>')
jcollado
  • 39,419
  • 8
  • 102
  • 133
1

Finally, the following is the suggested way:

i = PythonMagick.Image(img)
i.sample('!<width>x<height>')

Same thing without the exclamation mark would maintain aspect ratio as well.

ilstam
  • 1,473
  • 4
  • 18
  • 32