Transcription of Python Imaging Library Overview
{{id}} {{{paragraph}}}
|March12,2002|FredrikLundh, ,anefficientinternalrepresentation, ' ,convertbetweenfileformats,printimages, , ,youcanuseJackJansen' ,there' ,includingpointoperations,filteringwitha setofbuilt-inconvolutionkernels, , ' , , ;eitherbyloadingimagesfromfiles,processi ngotherimages, ,usetheopenfunctionintheImagemodule.>>> import Image>>> im = (" ")Ifsuccessful, >>> print , , (512, 512) , (inpixels).Themodeattributedefinesthenum berandnamesofthebandsintheimage, "L"(luminance)forgreyscaleimages,"RGB"fo rtruecolourimages,and"CMYK" , , ,let'sdisplaytheimagewejustloaded: >>> ()(Thestandardversionofshowisnotveryeffi cient, 'thavexvinstalled,itwon' ,itisveryhandyfordebuggingandtests.) , ' , , , :ConvertfilestoJPEG import os, sysimport Imagefor infile in [1:]: outfile = (infile)[0] + ".jpg" if infile != outfile: try: (infile).save(outfile) except IOError: print "cannot convert", ,youmustalwaysspecifytheformatthisway:Ex ample:CreateJPEGT humbnailsimport os, sysimport Imagefor infile in [1:]: outfile = (infile)[0] + ".
Python Imaging Library Overview PIL 1.1.3 | March 12, 2002 | Fredrik Lundh, Matthew Ellis Introduction The Python Imaging Library adds image processing capabilities to your Python
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}