]>
Commit | Line | Data |
---|---|---|
d14a1e28 RD |
1 | #---------------------------------------------------------------------- |
2 | # Name: wxPython.tools.img2png | |
3 | # Purpose: Convert an image to PNG format | |
4 | # | |
5 | # Author: Robin Dunn | |
6 | # | |
7 | # RCS-ID: $Id$ | |
8 | # Copyright: (c) 2002 by Total Control Software | |
9 | # Licence: wxWindows license | |
10 | #---------------------------------------------------------------------- | |
11 | ||
12 | """ | |
13 | img2png.py -- convert several image formats to PNG format | |
14 | ||
15 | Usage: | |
16 | ||
17 | img2png.py [options] image_files... | |
18 | ||
19 | Options: | |
20 | ||
21 | -o <dir> The directory to place the .png file(s), defaults to | |
22 | the current directory. | |
23 | ||
24 | -m <#rrggbb> If the original image has a mask or transparency defined | |
25 | it will be used by default. You can use this option to | |
26 | override the default or provide a new mask by specifying | |
27 | a colour in the image to mark as transparent. | |
28 | ||
29 | -n <name> A filename to write the .png data to. Defaults to the | |
30 | basename of the image file + '.png' This option overrides | |
31 | the -o option. | |
32 | """ | |
33 | ||
34 | ||
35 | import sys | |
36 | import img2img | |
37 | from wxPython import wx | |
38 | ||
39 | def main(): | |
40 | # some bitmap related things need to have a wxApp initialized... | |
41 | if wx.wxGetApp() is None: | |
42 | app = wx.wxPySimpleApp() | |
43 | img2img.main(sys.argv[1:], wx.wxBITMAP_TYPE_PNG, ".png", __doc__) | |
44 | ||
45 | if __name__ == '__main__': | |
46 | main() | |
47 | ||
1fded56b | 48 | |
1fded56b | 49 |