Movatterモバイル変換
[0]ホーム
I need to convert PNG images to JPG..can python help
Chris Richard Adamschrisa at ASPATECH.COM.BR
Wed Apr 18 17:48:06 EDT 2001
Thanks the os.system call seems the simplest. If a have list variablesin my python code (for example, the file name I want to convert) how canI pass that variable to the os.system call. For example... somethinglike thisos.system(" convert FILE1 FILE2 ") - yet FILE1 and FILE2 are stringvariables in my script.Thanks,Chris-----Original Message-----From: Fredrik Lundh [mailto:fredrik at pythonware.com]Sent: Wednesday, April 18, 2001 3:20 PMTo:python-list at python.orgSubject: Re: I need to convert PNG images to JPG..can python helpChris Richard Adams wrote:> I've been using ImageMagick on Linux to convert images fromPNG to JPG,> but now need to include that code in a python script. Myoptions are to> somehow figure out how do call imagemagick's 'convert' from a python> script or to use a library/module within python. Anyone have an> tips/advice?import osos.system("convert ...")or, using PIL (http://www.pythonware.com/products/pil):import Imageim = Image.open("infile.png")im.save("outfile.jpg")Cheers /F--http://mail.python.org/mailman/listinfo/python-list
More information about the Python-listmailing list
[8]ページ先頭