---
title: "Apply image filters"
description: "You need to apply filters to hundreds of images—blur, sharpen, edge detection, and other enhancements."
url: "https://www.pixeltable.com/notebooks/img-apply-filters"
updated: "2026-04-10"
---

# Apply image filters

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

- **Type:** Notebook
- **Group:** Images

## 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:** `pip install pixeltable`
- **Pixeltable calls:** `pxt.create_table()`, `@pxt.udf`, `insert()`, `add_computed_column()`

## A look at the code

```python
# 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))
```

## Open it

- **Open in Colab:** https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/images/img-apply-filters.ipynb
- **Docs page:** https://docs.pixeltable.com/howto/cookbooks/images/img-apply-filters
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/images/img-apply-filters.ipynb
