[Tutor] A newbie question about running python scripts

ZIYAD A. M. AL-BATLY zamb at saudi.net.sa
Thu Jun 16 06:43:44 CEST 2005

On Wed, 2005-06-15 at 21:23 -0600, Chuck Allison wrote:
> Dear Tutors,
> Here is a query from a student from a corporate class I'm teaching. Do 
> you know of any such modules of the top of your head? Thanks!
> ===
> Quick question since the next class isn't until Monday.  Do you know of 
> any modules in Python that can convert a bitmap from one format to 
> another, specifically .BMPs to .JPGs?
> We have a need to do this conversion.  Our developers have grown fond of 
> screen shots as they give much information that may not be written up in 
> a bug.  However, our most common tool for getting a screen shot is a 
> screen capture in VMWare which only does .BMP format files.  They are 
> about 2.3 Mb apiece.   Where as a .JPG of the same thing is only about 
> 34 - 175 Kb.  The space savings is significant.   So, we need a way of 
> efficiently convert these screenshots.  This class presents me an 
> opportunity to create a utility to do this for us.  Hence, the question.
> ===
> -- Chuck Allison
PIL¹ (Portable Image Library) will do what you want.  However, I have
some humble advice to give.  It appears to me that you're using those
screen shots to read (as in Humans reading English) some info from the
application.  Using JPEG format in these situations is not recommended
as JPEG is a lossy format (in other words, it introduce some artifacts
to the image) which make it very hard for reading (especially, small
fonts).  I recommend using either PNG or BMP after compressing it with
zip, gzip, or bz2.

     1. http://www.pythonware.com/products/pil/

Just my humble answer.

More information about the Tutor mailing list