Raster

From Silhouette Wiki
Jump to navigation Jump to search

Attributes[edit]

Name Description Added
width the width in pixels
height the height in pixels
channels the number of channels
channelMask the mask of channels available in the Raster 7.0
channelSize the number of bytes per channel (1, 2, or 4)
rowBytes the number of bytes per row in the image data
format the pixel format
dod the domain of definition Recti 6.0

Methods[edit]

Name Description Added
crop(roi) returns a new Raster cropped or padded (with black) to the new ROI (same as copy(roi, True)) 6.0
clear(color=Color(0, 0, 0, 0)) clears to the specified Color
getChannel(channel) return a new single-channel Raster containing channel
putChannel(source, channel) replace channel with the contents of the single-channel Raster
copy(roi=None, crop=False) return a copy of the raster, containing roi, with optional crop/pad
save(format, path, aspect=1.0, rate=24.0, options=None) save the image to path using format - store aspect and rate as meta-data if the format supports it