forked from cyChop/pixel2svg-fork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
132 lines (95 loc) · 3.64 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
"""pixel2svg Setup Script
Copyright Florian Berger <[email protected]>
"""
# This file is part of pixel2svg.
#
# pixel2svg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pixel2svg is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pixel2svg. If not, see <http://www.gnu.org/licenses/>.
# Work started on Thu Jul 21 08:08:38 CEST 2011.
import distutils.core
import pixel2svg
LONG_DESCRIPTION = """About
-----
pixel2svg converts pixel art to SVG - pixel by pixel.
For example, here is an icon from the `Tango Icon
Set <http://tango.freedesktop.org/>`_:
.. figure:: http://static.florian-berger.de/tango-heart.png
:align: center
:alt: tango heart
tango heart
If you scale this up for a nice blocky print, you might get a dithered
result:
.. figure:: http://static.florian-berger.de/tango-heart-400px-dithered.png
:align: center
:alt: tango heart 400px dithered
tango heart 400px dithered
Of course you can turn dithering off. But sometimes you might want a
vector file, especially for large prints. For these cases, pixel2svg
produces this SVG file (try clicking to find out whether your browser
supports SVG):
`tango-heart.svg <http://static.florian-berger.de/tango-heart.svg>`_
Here is a screenshot of the SVG in `Inkscape <http://inkscape.org/>`_:
.. figure:: http://static.florian-berger.de/tango-heart-inkscape.png
:align: center
:alt: tango heart inkscape
tango heart inkscape
Nice, pure vector data.
Prerequisites
-------------
Python 2.x `http://www.python.org <http://www.python.org>`_
Python Imaging Library (PIL)
`http://www.pythonware.com/products/pil/ <http://www.pythonware.com/products/pil/>`_
svgwrite
`http://pypi.python.org/pypi/svgwrite/ <http://pypi.python.org/pypi/svgwrite/>`_
Installation
------------
Unzip the file, then at the command line run
::
python setup.py install
Usage
-----
::
Usage: pixel2svg [--overlap] IMAGEFILE
Options:
--version show program's version number and exit
-h, --help show this help message and exit
--squaresize=SQUARESIZE
Width and heigt of vector squares in pixels, default: 40
--overlap If given, overlap vector squares by 1px
Running
::
pixel2svg.py IMAGE.EXT
will process IMAGE.EXT and create IMAGE.svg.
EXT can be any format (png, jpg etc.) that can be read by the Python
Imaging Library.
License
-------
pixel2svg is licensed under the GPL. See the file COPYING for details.
Author
------
(c) Florian Berger
"""
distutils.core.setup(name = "pixel2svg",
version = pixel2svg.VERSION,
author = "Florian Berger",
author_email = "[email protected]",
url = "http://florian-berger.de/en/software/pixel2svg/",
description = "pixel2svg - Convert pixel art to SVG",
long_description = LONG_DESCRIPTION,
license = "GPL",
py_modules = [],
packages = [],
requires = ["PIL", "svgwrite"],
provides = ["pixel2svg"],
scripts = ["pixel2svg.py"],
data_files = [("", ["COPYING"])])