A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/075777.html below:

I need to convert PNG images to JPG..can python help

I need to convert PNG images to JPG..can python help I need to convert PNG images to JPG..can python helpFredrik Lundh fredrik at pythonware.com
Wed Apr 18 14:20:13 EDT 2001
Chris Richard Adams wrote:

> I've been using ImageMagick on Linux to convert images from PNG to JPG,
> but now need to include that code in a python script.  My options 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 os
os.system("convert ...")

or, using PIL (http://www.pythonware.com/products/pil):

import Image
im = Image.open("infile.png")
im.save("outfile.jpg")

Cheers /F



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4