---
title: "Adjust image opacity"
description: "You need to make hundreds of images semi-transparent for backgrounds, overlays, or watermarks."
url: "https://www.pixeltable.com/notebooks/img-adjust-opacity"
updated: "2026-04-10"
---

# Adjust image opacity

You need to make hundreds of images semi-transparent for backgrounds, overlays, or watermarks.

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

## How it works

You adjust image transparency using a custom UDF that modifies alpha channels (relies on PIL/Pillow). This gives you precise control over transparency levels.

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 opacity adjustment to all images in your table.

## What it covers

- Set image opacity (transparency level)
- Test transformations before applying
- Apply to multiple images automatically

## What it uses

- **Install:** `pip install pixeltable`
- **Pixeltable calls:** `pxt.create_table()`, `@pxt.udf`, `insert()`, `add_computed_column()`

## Open it

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