The PIL handbook shows 30 or more formats. The tutorial has more to say
about details. Very good. Thanks. John Fouhy wrote: 2009/1/23 Wayne Watson <sierra_mtnv...@sbcglobal.net>:Continuing. The code that is eventually used to do the save is: =================== def SaveGIF(self): if self.current_path: default_path = splitext(basename(self.current_path))[0] + ".gif" path = asksaveasfilename(defaultextension=".gif", title="Save as GIF", initialfile=default_path, filetypes=GIF_FILE_TYPES) else: path = asksaveasfilename(defaultextension=".gif", title="Save as GIF", filetypes=GIF_FILE_TYPES): if not path: return gif = self.current_image.convert("RGB") gif.save(path) ==================I would think convert makes the conversion. If so, then it must know a lot of formats. How do I know which ones it has available? If it has a small set, is there some way to find another "convert" that produces, say, a 'pcx" formated file. Apparently, "RGB" and "GIF" mean the same thing. Seems a bit odd.Well, "RGB" stands for "Red Green Blue". I'm not much of a graphics format guy, but I think it means basically a bitmap, where each pixel has an associated tuple (red, green, blue) containing the proportion of each (on a range from 0..255). (as opposed to vector formats like EPS, or layered formats that programs like photoshop use) It is possible that the save() function inspects the file name extension and produces output appropriately. At any rate, your question seems more to do with the image library you are using, and nothing at all to do with tkFileDialog.asksaveasformat. It's probably PIL -- the Python Image Library. See the documentation here: http://www.pythonware.com/library/pil/handbook/index.htm --
Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time) "The creation of the world did not occur at the beginning of time; it occurs every day." -- M. Proust Web Page: <www.speckledwithstars.net/> |
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor