- Timestamp:
- Nov 8, 2010, 8:26:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/python/examples/img2txt.py
r4706 r4708 29 29 GMASK = 0x0000ff00 30 30 BMASK = 0x000000ff 31 AMASK = 0x 0000000031 AMASK = 0xff000000 32 32 BPP = 32 33 33 DEPTH = 4 … … 190 190 #init dither 191 191 try: 192 #convert rgb to rgba 193 if img.mode == 'RGB': 194 img = img.convert('RGBA') 195 #reorder rgba 196 if img.mode == 'RGBA': 197 r, g, b, a = img.split() 198 img = Image.merge("RGBA", (b, g, r, a)) 199 192 200 dit = Dither(BPP, img.size[0], img.size[1], DEPTH * img.size[0], 193 RMASK, GMASK, BMASK, AMASK)201 RMASK, GMASK, BMASK, AMASK) 194 202 except DitherError, err: 195 203 sys.stderr.write("%s\n" % err)
Note: See TracChangeset
for help on using the changeset viewer.