moduleĀ pixeltable.functions.image
Pixeltable UDFs forImageType.
Example:
iteratorĀ tile_iterator()
Signature
tile_size, and the tiles will be
iterated over in row-major order (left-to-right, then top-to-bottom). An optional overlap parameter may be
specified. If the tiles do not exactly cover the image, then the rightmost and bottommost tiles will be padded with
blackspace, so that the output images all have the exact size tile_size.
Parameters:
image(typing.Any): Image to split into tiles.tile_size(tuple[int, int]): Size of each tile, as a pair of integers[width, height].overlap(tuple[int, int], default:(0, 0)): Amount of overlap between adjacent tiles, as a pair of integers[width, height].
tbl with a column img of type pxt.Image. Create a view that splits all images into 256x256 tiles with 32 pixels of overlap:
udfĀ alpha_composite()
Signature
im2 over im1.
Equivalent to PIL.Image.alpha_composite()
udfĀ b64_encode()
Signature
img(pxt.Image): imageimage_format(pxt.String): image format supported by PIL
udfĀ blend()
Signature
PIL.Image.blend()
udfĀ composite()
Signature
PIL.Image.composite()
udfĀ convert()
Signature
PIL.Image.Image.convert().
Parameters:
mode(pxt.String): The mode to convert to. See the Pillow documentation for a list of supported modes.
udfĀ crop()
Signature
PIL.Image.Image.crop()
udfĀ effect_spread()
Signature
PIL.Image.Image.effect_spread()
Parameters:
distance(pxt.Int): The distance to spread pixels.
udfĀ entropy()
Signature
PIL.Image.Image.entropy()
Parameters:
mask(pxt.Image | None): An optional mask image.extrema(pxt.Json | None): An optional list of extrema.
udfĀ get_metadata()
Signature
udfĀ getbands()
Signature
PIL.Image.Image.getbands()
udfĀ getbbox()
Signature
PIL.Image.Image.getbbox()
Parameters:
alpha_only(pxt.Bool): IfTrue, and the image has an alpha channel, trim transparent pixels. Otherwise, trim pixels when all channels are zero.
udfĀ getchannel()
Signature
PIL.Image.Image.getchannel()
Parameters:
channel(pxt.Int): The channel to extract. This is a 0-based index.
udfĀ getcolors()
Signature
maxcolors.
Equivalent to
PIL.Image.Image.getcolors()
Parameters:
maxcolors(pxt.Int): The maximum number of colors to return.
udfĀ getextrema()
Signature
PIL.Image.Image.getextrema()
udfĀ getpalette()
Signature
PIL.Image.Image.getpalette()
Parameters:
mode(pxt.String | None): The mode to convert the palette to.
udfĀ getpixel()
Signature
xy is a tuple containing the x and y coordinates.
Equivalent to
PIL.Image.Image.getpixel()
Parameters:
xy(pxt.Json): The coordinates, given as (x, y).
udfĀ getprojection()
Signature
PIL.Image.Image.getprojection()
udfĀ height()
Signature
udfĀ histogram()
Signature
PIL.Image.Image.histogram()
Parameters:
mask(pxt.Image | None): An optional mask image.extrema(pxt.Json | None): An optional list of extrema.
udfĀ mode()
Signature
udfĀ point()
Signature
PIL.Image.Image.point()
Parameters:
lut(pxt.Json): A lookup table.
udfĀ quantize()
Signature
PIL.Image.Image.quantize()
Parameters:
colors(pxt.Int): The number of colors to quantize to.method(pxt.Int | None): The quantization method. See the Pillow documentation for a list of supported methods.kmeans(pxt.Int): The number of k-means clusters to use.palette(pxt.Image | None): The palette to use.dither(pxt.Int): The dithering method. See the Pillow documentation for a list of supported methods.
udfĀ reduce()
Signature
PIL.Image.Image.reduce()
Parameters:
factor(pxt.Int): The reduction factor.box(pxt.Json | None): An optional 4-tuple of ints providing the source image region to be reduced. The values must be within (0, 0, width, height) rectangle. If omitted or None, the entire source is used.
udfĀ resize()
Signature
PIL.Image.Image.resize()
udfĀ rotate()
Signature
PIL.Image.Image.rotate()
Parameters:
angle(pxt.Int): The angle to rotate the image, in degrees. Positive angles are counter-clockwise.
udfĀ thumbnail()
Signature
PIL.Image.Image.thumbnail()
Parameters:
size(pxt.Json): The size of the thumbnail, as a tuple of (width, height).resample(pxt.Int): The resampling filter to use. See the Pillow documentation for a list of supported filters.reducing_gap(pxt.Float | None): The reducing gap to use.
udfĀ transpose()
Signature
PIL.Image.Image.transpose()
Parameters:
method(pxt.Int): The transpose method. See the Pillow documentation for a list of supported methods.
udfĀ width()
Signature