Apply image filters

You need to apply filters to hundreds of images—blur, sharpen, edge detection, and other enhancements.

Images · Notebook · Updated

Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.

How it works

You apply image filters (blur, sharpen, edge detection) to images in your table using custom UDFs that wrap Pillow's ImageFilter module (relies on PIL/Pillow). This gives you control over filter parameters.

You can iterate on transformations before adding them to your table. Use .select() with .collect() to preview results on sample images—nothing is stored in your table. If you want to collect only the first few rows, use .head(n) instead of .collect(). Once you're satisfied, use .add_computed_column() to apply the filter to all images in your table.

What it covers

  • Apply common image filters
  • Test filters before applying
  • Process multiple images in batch

What it uses

Install
terminal
pip install pixeltable
Pixeltable calls
pxt.create_table()@pxt.udfinsert()add_computed_column()

A look at the code

img-apply-filters.ipynb
# Add filter columns
t.add_computed_column(blurred=apply_blur(t.image))
t.add_computed_column(sharpened=apply_sharpen(t.image))
t.add_computed_column(edges=apply_find_edges(t.image))
t.add_computed_column(edge_enhanced=apply_edge_enhance(t.image))

One cell of the notebook, copied as it is. Open it in Colab for the rest.

Browse all 103