# processing-images
> Best practices and tools for processing images for worksheets (trimming, transparency, resizing).
- Author: elwrush
- Repository: elwrush/lesson-plan-agent
- Version: 20260129101738
- Stars: 0
- Forks: 0
- Last Updated: 2026-02-06
- Source: https://github.com/elwrush/lesson-plan-agent
- Web: https://mule.run/skillshub/@@elwrush/lesson-plan-agent~processing-images:20260129101738
---
---
name: processing-images
description: Best practices and tools for processing images for worksheets (trimming, transparency, resizing).
---
# Processing Images for Documents
## Purpose
To ensure images used in Typst or other documents are visually clean, print-friendly (grayscale/photocopier safe), and layout-efficient by removing unnecessary whitespace and backgrounds.
## The Constraints
1. **No Gradients**: Backgrounds must be solid (preferably white/transparent) for clear photocopying.
2. **Transparent PNGs**: Any non-rectangular graphic (icons, motifs) must have a transparent background.
3. **No Fake Checkerboards**: **CRITICAL**. Some images have a "fake" gray-and-white checkerboard pattern baked into the pixels. You MUST remove this before placing in Typst.
4. **Trimmed Whitespace**: Generated images often have huge unnecessary margins. These MUST be trimmed to the content bounding box to avoid destroying document flow.
5. **Aspect Ratio**: Never distort aspect ratios (squashing) to fit a space. Use specific image dimensions or `width: 100%, height: auto`.
## The Tool: `.agent/skills/processing-images/scripts/trim_image.py`
Use this script to auto-process images.
### Usage
```bash
python .agent/skills/processing-images/scripts/trim_image.py