image2gcode 2.9.6__py3-none-any.whl → 2.9.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- image2gcode/__init__.py +1 -1
- image2gcode/__main__.py +1 -0
- image2gcode/boundingbox.py +6 -0
- image2gcode/image2gcode.py +2 -2
- {image2gcode-2.9.6.dist-info → image2gcode-2.9.8.dist-info}/METADATA +4 -1
- image2gcode-2.9.8.dist-info/RECORD +11 -0
- image2gcode-2.9.6.dist-info/RECORD +0 -11
- {image2gcode-2.9.6.dist-info → image2gcode-2.9.8.dist-info}/LICENSE +0 -0
- {image2gcode-2.9.6.dist-info → image2gcode-2.9.8.dist-info}/WHEEL +0 -0
- {image2gcode-2.9.6.dist-info → image2gcode-2.9.8.dist-info}/entry_points.txt +0 -0
image2gcode/__init__.py
CHANGED
image2gcode/__main__.py
CHANGED
|
@@ -107,6 +107,7 @@ def main() -> int:
|
|
|
107
107
|
type=int, help="maximum laser power while drawing (as a rule of thumb set to 1/3 of the maximum of a machine having a 5W laser)")
|
|
108
108
|
parser.add_argument('--poweroffset', default=cfg["poweroffset_default"], metavar="<default:" +str(cfg["poweroffset_default"])+ ">",
|
|
109
109
|
type=int, help="pixel intensity to laser power: shift power range [0-maxpower]")
|
|
110
|
+
parser.add_argument('--noinvert', action='store_true', default=False, help='do not invert the image' )
|
|
110
111
|
parser.add_argument('--size', default=None, nargs=2, metavar=('gcode-width', 'gcode-height'),
|
|
111
112
|
type=float, help="target gcode width and height in mm (default: not set and determined by pixelsize and image source resolution)")
|
|
112
113
|
parser.add_argument('--offset', default=None, nargs=2, metavar=('X-off', 'Y-off'),
|
image2gcode/boundingbox.py
CHANGED
|
@@ -63,6 +63,12 @@ class Boundingbox:
|
|
|
63
63
|
return ( point.x >= self._bbox.lowerleft.x and point.y >= self._bbox.lowerleft.y
|
|
64
64
|
and point.x <= self._bbox.upperright.x and point.y <= self._bbox.upperright.y )
|
|
65
65
|
|
|
66
|
+
def size(self) -> float:
|
|
67
|
+
"""
|
|
68
|
+
get bounding box size
|
|
69
|
+
"""
|
|
70
|
+
return (self._bbox.upperright.x - self._bbox.lowerleft.x) * (self._bbox.upperright.y - self._bbox.lowerleft.y)
|
|
71
|
+
|
|
66
72
|
if __name__ == '__main__':
|
|
67
73
|
p = Point(0,0)
|
|
68
74
|
print(f"type: {type(p)}")
|
image2gcode/image2gcode.py
CHANGED
|
@@ -27,7 +27,7 @@ class Image2gcode:
|
|
|
27
27
|
Class Image2gcode handles the conversion of an image to gcode.
|
|
28
28
|
"""
|
|
29
29
|
|
|
30
|
-
def __init__(self, power: Callable[[UInt8,int,bool],int] = None,
|
|
30
|
+
def __init__(self, power: Callable[[UInt8,int,int,bool],int] = None,
|
|
31
31
|
transformation: Callable[[Tuple[float,float]],Tuple[float,float]] = None):
|
|
32
32
|
|
|
33
33
|
# init
|
|
@@ -243,7 +243,7 @@ class Image2gcode:
|
|
|
243
243
|
|
|
244
244
|
# draw this pixel line
|
|
245
245
|
for count, pixel in enumerate(line):
|
|
246
|
-
laserpow = self._power(pixel, args["maxpower"], args["poweroffset"])
|
|
246
|
+
laserpow = self._power(pixel, args["maxpower"], args["poweroffset"], not args["noinvert"])
|
|
247
247
|
|
|
248
248
|
if count == 0:
|
|
249
249
|
# delay emit first pixel (so all same power pixels can be emitted in one sweep)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: image2gcode
|
|
3
|
-
Version: 2.9.
|
|
3
|
+
Version: 2.9.8
|
|
4
4
|
Summary: image2gcode: convert an image to gcode.
|
|
5
5
|
Keywords: engraving,laser,image,laser engraving,PWM,gcode
|
|
6
6
|
Author-email: Johannes Noordanus <mailjohannes.mailnoordanus@gmail.com>
|
|
@@ -37,6 +37,8 @@ Some people noticed incorrect low burn levels at the edges of objects within an
|
|
|
37
37
|
|
|
38
38
|
It is possible to calibrate your laser machine now: option ```--genimages pixel-width pixel-height write``` generates a set calibration files that can be used as input for ```image2gcode``` to experiment with settings like ```--pixelsize```, ```--speed and ```--maxpower``` to get the right setup! For example use ```image2gcode --showimage --genimages 200 200 0``` to generate test images of 200 by 200 pixels that show up in the viewer (but are not written to the file system). See chapter *calibrate* below.
|
|
39
39
|
|
|
40
|
+
Please consider supporting me, so I can make this application better and add new functionality to it: <http://paypal.me/johannesnoordanus/5,00>
|
|
41
|
+
|
|
40
42
|
To summarize:
|
|
41
43
|
|
|
42
44
|
Optimized gcode
|
|
@@ -105,6 +107,7 @@ options:
|
|
|
105
107
|
maximum laser power while drawing (as a rule of thumb set to 1/3 of the maximum of a machine having a 5W laser)
|
|
106
108
|
--poweroffset <default:0>
|
|
107
109
|
pixel intensity to laser power: shift power range [0-maxpower]
|
|
110
|
+
--noinvert do not invert the image
|
|
108
111
|
--size gcode-width gcode-height
|
|
109
112
|
target gcode width and height in mm (default: not set and determined by pixelsize and image source resolution)
|
|
110
113
|
--offset X-off Y-off laser drawing starts at offset in mm (default not set, --center cannot be set at the same time)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
image2gcode/__init__.py,sha256=Y9kGBm8TPsstUodUgFVFYMgmGKTuRfDgrg2aaGAfHEY,70
|
|
2
|
+
image2gcode/__main__.py,sha256=gPgLxy7HhCbtS_V7Yzl5Z0z63JCTSH3I1jJaBYz5vwQ,10063
|
|
3
|
+
image2gcode/boundingbox.py,sha256=862ZKdoBARd10can3IKnJaJW7HbcU4JxGNy-2itE9-c,3250
|
|
4
|
+
image2gcode/image2gcode.py,sha256=uoEW4uj-gO6k4U_sTsV_1I5n8P5BlLtg2YqWoYLO7xw,13069
|
|
5
|
+
image2gcode/imagegen.py,sha256=my2kBHoMq1kjnDKTQ_L-f4ymwmXJSCyhxqZ5dFzhRwc,14270
|
|
6
|
+
image2gcode/newimage2gcode.py,sha256=lQCWvZatuiaCE2kv8sxSA-4dYlIZNfO9iFNfXxjDShs,13043
|
|
7
|
+
image2gcode-2.9.8.dist-info/entry_points.txt,sha256=j5b4eYXSOUdPSgAydKBbAWUbkow4iEvV1DMfNi77B9E,57
|
|
8
|
+
image2gcode-2.9.8.dist-info/LICENSE,sha256=ghSxQl_EUJUTiu712NkZkroJHvgOrR0j4CddAq8Y7Tc,1085
|
|
9
|
+
image2gcode-2.9.8.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
10
|
+
image2gcode-2.9.8.dist-info/METADATA,sha256=zJw10KKQFBnHs2_eB3s75n_vDYWvqfLzzrgyS05nE3U,12468
|
|
11
|
+
image2gcode-2.9.8.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
image2gcode/__init__.py,sha256=pXm19Oxi-px5xxN1x8iQzNSAy_LGGI76PH_MpNOjCJU,70
|
|
2
|
-
image2gcode/__main__.py,sha256=KcgeCEZIOTgph9VVheS2EkxFBIeCcSlQ4a30fCYRBCc,9956
|
|
3
|
-
image2gcode/boundingbox.py,sha256=qSUufnzpSpcrCbtBp0P9FHov6dRYQmYeFvdxgKYNtb0,3047
|
|
4
|
-
image2gcode/image2gcode.py,sha256=lQCWvZatuiaCE2kv8sxSA-4dYlIZNfO9iFNfXxjDShs,13043
|
|
5
|
-
image2gcode/imagegen.py,sha256=my2kBHoMq1kjnDKTQ_L-f4ymwmXJSCyhxqZ5dFzhRwc,14270
|
|
6
|
-
image2gcode/newimage2gcode.py,sha256=lQCWvZatuiaCE2kv8sxSA-4dYlIZNfO9iFNfXxjDShs,13043
|
|
7
|
-
image2gcode-2.9.6.dist-info/entry_points.txt,sha256=j5b4eYXSOUdPSgAydKBbAWUbkow4iEvV1DMfNi77B9E,57
|
|
8
|
-
image2gcode-2.9.6.dist-info/LICENSE,sha256=ghSxQl_EUJUTiu712NkZkroJHvgOrR0j4CddAq8Y7Tc,1085
|
|
9
|
-
image2gcode-2.9.6.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
10
|
-
image2gcode-2.9.6.dist-info/METADATA,sha256=Gkfkmy9qgEQdzRu_mwchpQ_HZTJv37yI4muF7ifbna0,12275
|
|
11
|
-
image2gcode-2.9.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|