femto.rasterimage module#
- class RasterImage(name=None, scan=1, speed=1.0, samplesize=(100, 50), x_init=-2.0, y_init=0.0, z_init=None, shrink_correction_factor=1.0, lsafe=2.0, speed_closed=5, speed_pos=0.5, cmd_rate_max=1200, acc_max=500, end_off_sample=True, _x=<factory>, _y=<factory>, _z=<factory>, _f=<factory>, _s=<factory>, px_to_mm=0.01, img_size=(0, 0))#
Bases:
LaserPath
Class representing a laser path in the xy-plane of a b/w rastered image.
- px_to_mm: float = 0.01#
- img_size: tuple[int, int] = (0, 0)#
- property path_size: list[float]#
Path size.
- Returns:
(x, y) size of the laser path [mm].
- Return type:
list(float)
- image_to_path(img)#
Convert image to path.
The function takes an image, converts it to a boolean matrix, and create a laser path with ablation lines representing only the black pixels of the image.
- Parameters:
img (Image.Image) – Image.Image - the image to be converted to a path
img – Image to convert to laserpath.
- Return type:
None