Bitmap Vector Conversion¶
- class obi.macros.bmp2vector.BitmapVectorPattern(path)[source]¶
Converts an image to an array of vector points (as
VectorPixelCommand
). For high resolution images, this process can be quite resource intensive. This class usesmultiprocessing.Pool
to speed up conversion by executing multiple threads.- im[source]¶
See https://pillow.readthedocs.io/en/stable/reference/Image.html
- Type:
PIL.Image
- pattern_seq[source]¶
Populated by
vector_convert()
- Type:
bytearray | None
- Parameters:
path – Path to a PIL-compatible image file
- rescale(resolution, max_dwell, invert)[source]¶
Rescale the image to specified resolution, upsampling or downsampling as necessary. Rescale dwell times such that the brightest pixel has dwell time max_dwell.
Important
By default, white pixels (brightness 255) correspond to the maximum dwell time, and black pixels (brightness 0) correspond to no dwell time and will be skipped.