Projects tagged ‘bitmap’ and ‘python’


[4 total ]

14 Users

The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.
Created about 1 year ago.

0 Users

This project consists of two (2) files: a python script and an AS class file. You use the python script to create a new XML file describing all your external files (XML, bitmap, video, etc.) by ... [More] simply pointing it at the folder(s) containing those files. Run the python script from the command line (or from an Ant script -- example will be forthcoming soon). Example command line usage: python cachebuilder.py build/images build/xml This script will write out an XML file giving you all the information you need to preload all of these files with accurate information as to how far along you are -- in each folder you care about, if you choose to share that with the user! Download it here: http://flisp.googlecode.com/svn/trunk/cachebuilder.py ...and put it in your project's root folder, then open a terminal window and navigate to that same folder. Then invoke this script using "python cachebuilder.py" followed by the names of the folders you want it to scan for files. So, for example, with the command line: python cachebuilder.py build/jpeg build/swf it might generate a file like: python cachebuilder.py build and it would generate a preloadcache.xml file like this: Now the next step is to write an AS class that knows exactly how to parse this XML doc and sequentially load all the files while firing off a callback announcing (a) the name of the file you're currently loading, (b) the name of the folder you're currently loading, (b) the bytes you've already loaded of the current file, (c) the totalbytes of the current file, (d) the bytes you've loaded of the current folder, (e) the totalbytes of the current folder, (f) the bytes you've already loaded of the whole enchilada, and (g) the totalbytes of the whole enchilada. I'm thinking it'll just make a nice associative array with these properties defined in it, and pass that along to any function you designate as the onLoadProgress handler. so for the example right above, every time more data arrives as part of the load process, you'd fire off the equivalent of this: yourhandlerfunction( { currentfile: "build/jpeg/photo1.jpg", currentfolder: "build", filebytesloaded: 73, filebytesneeded:500, folderbytesloaded:73, folderbytesneeded:2000, totalbytesloaded:73, totalbytesneeded:2000} ); so then the handler could just reach into that object and get its info. For example: myhandlerfunction( info_object: Object ) { var ratio:Number = info_object[ "totalbytesloaded" ] / info_object[ "totalbytestotal" ] ; progressbar.xscale = ratio 100; } [Less]
Created 12 months ago.

0 Users

Bitmap loading and writing utilities in pure Python. Supports drawing many shapes and text. This project was created to add support for image drawing capabilities for Google Appengine. To write text ... [More] onto bitmaps, you first need to create proper python module with make_font.py. For example: python make_font.py -f /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf -s 12The python code would look like this: import bmp import bmpfont_arialbd_12 img = bmp.BitMap( 500, 40, bmp.Color.TEAL.lighten() ) img.setFont(bmpfont_arialbd_12.font_data) img.setPenColor( bmp.Color.BLUE ) img.drawText('abcdefghijklmnoprstuvxyz!@#$^%&^**()_}{\",.?<>', 10, 10) img.drawLine( 0, 0, 10, 10) # save the file img.saveFile( "test.bmp" ) # or get the bitmap as string bitmap = img.getBitmap() [Less]
Created 2 months ago.

0 Users

A simple tool to dump graphical BMP files as C arrays, ready for use in C code.
Created 12 months ago.