PDA

View Full Version : Image operation in python



adamsnative
January 21st, 2009, 07:04 AM
Is there any method by which i can scale down 8 bit image to 4 bit image in python
This is required to speed up my work as it wont affect the output

Is there any code in python which can do this

Plz help or suggest some method to do it

Wybiral
January 21st, 2009, 07:09 AM
I'm pretty sure PIL (http://www.pythonware.com/products/pil/) has various options when saving in different formats.

eightmillion
January 21st, 2009, 07:20 AM
Is there any method by which i can scale down 8 bit image to 4 bit image in python
This is required to speed up my work as it wont affect the output

Is there any code in python which can do this

Plz help or suggest some method to do it

You might also look at pythonmagick. For example:



import PythonMagick
image = PythonMagick.Image('image.jpg')
image.depth(4)
image.write('image.jpg')

Gina
February 15th, 2010, 01:08 AM
I'm creating a python app and wish to use ImageMagick to produce some graphics for web page use. PythonMagick is mentioned in the IM docs as an API to use with Python but I can't seem to find any more info. Do you know where I can find basic documentation on using the PythonMagic API, please?

Gina
February 16th, 2010, 11:16 AM
Isn't anyone using Python Magick nowadays? I guess the lack of documentation puts people off. I'm now creating a bash script in Python and then running that as a system call. PythonMagick is supposed to be more flexible and powerful... oh well...