Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions CLAUDE.md

This file was deleted.

22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# QuickThumb
# quickthumb

QuickThumb is a Python library for programmatic thumbnail, social card, and promo image generation.
quickthumb is a Python library for programmatic thumbnail, social card, and promo image generation.
It is designed for code-first and JSON-first workflows, with a layer-based API that works well for human-authored scripts and AI-generated specs.

## Gallery
Expand All @@ -13,7 +13,7 @@ It is designed for code-first and JSON-first workflows, with a layer-based API t
| --- | --- | --- |
| ![Talking head thumbnail example](examples/youtube_talking_head.png) | ![Reaction thumbnail example](examples/youtube_reaction.png) | ![Tutorial thumbnail example](examples/youtube_tutorial_explainer.png) |

## Why QuickThumb
## Why quickthumb

- Built for thumbnails and social graphics, not just generic image composition
- Works with Python method chaining and JSON serialization/deserialization
Expand Down Expand Up @@ -259,7 +259,7 @@ canvas.render("output.webp", format="WEBP", quality=90)

## JSON-First Workflow

QuickThumb can round-trip most canvases through JSON:
quickthumb can round-trip most canvases through JSON:

```python
from quickthumb import Canvas
Expand All @@ -275,7 +275,7 @@ config = """
},
{
"type": "text",
"content": "Hello QuickThumb",
"content": "Hello quickthumb",
"size": 72,
"color": "#FFFFFF",
"align": "center",
Expand Down Expand Up @@ -304,12 +304,12 @@ Notes:

## AI-Friendly Workflows

QuickThumb is a good target when you want an LLM to generate image specs that are deterministic and easy to validate.
quickthumb is a good target when you want an LLM to generate image specs that are deterministic and easy to validate.

Prompt pattern for Python generation:

```text
Generate QuickThumb Python code for a 1280x720 YouTube thumbnail.
Generate quickthumb Python code for a 1280x720 YouTube thumbnail.
Use layered composition only.
Keep text on the left, subject image on the right, and use high-contrast typography.
Return runnable code that ends with canvas.render("thumbnail.png").
Expand All @@ -318,20 +318,20 @@ Return runnable code that ends with canvas.render("thumbnail.png").
Prompt pattern for JSON generation:

```text
Generate a QuickThumb JSON config with top-level width, height, and layers.
Generate a quickthumb JSON config with top-level width, height, and layers.
Use one background image layer, one dark overlay background layer, two text layers, and one outline layer.
Only use valid QuickThumb layer types and effect names.
Only use valid quickthumb layer types and effect names.
```

Recommended workflow:

1. Have the model produce QuickThumb Python or JSON.
1. Have the model produce quickthumb Python or JSON.
2. Validate or render it locally.
3. Adjust only the content, colors, and assets instead of rewriting layout logic from scratch.

## Environment Variables

QuickThumb looks for fonts using these environment variables:
quickthumb looks for fonts using these environment variables:

- `QUICKTHUMB_FONT_DIR`: directory that contains font files
- `QUICKTHUMB_DEFAULT_FONT`: default font family/name to use when `font` is omitted
Expand Down
Binary file added assets/brand/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/favicon.ico
Binary file not shown.
Binary file added assets/brand/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-167.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/quickthumb-icon-master.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/api/background.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Reference for QuickThumb background layers, including colors, gradients, images, opacity, effects, and render order.
description: Reference for quickthumb background layers, including colors, gradients, images, opacity, effects, and render order.
---

# Background
Expand Down
2 changes: 1 addition & 1 deletion docs/api/canvas.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Reference for QuickThumb Canvas creation, aspect ratios, layer composition, rendering, JSON loading, and image output.
description: Reference for quickthumb Canvas creation, aspect ratios, layer composition, rendering, JSON loading, and image output.
---

# Canvas
Expand Down
2 changes: 1 addition & 1 deletion docs/api/effects.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Reference for QuickThumb effects, including filters, shadows, strokes, blend modes, opacity, and layer compatibility.
description: Reference for quickthumb effects, including filters, shadows, strokes, blend modes, opacity, and layer compatibility.
---

# Effects
Expand Down
2 changes: 1 addition & 1 deletion docs/api/enums.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Reference for QuickThumb enums and gradient models used for alignment, fit modes, shapes, filters, and color transitions.
description: Reference for quickthumb enums and gradient models used for alignment, fit modes, shapes, filters, and color transitions.
---

# Enums & Gradients
Expand Down
2 changes: 1 addition & 1 deletion docs/api/image.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Reference for QuickThumb image layers, including local and remote images, fit modes, positioning, masking, effects, and background removal.
description: Reference for quickthumb image layers, including local and remote images, fit modes, positioning, masking, effects, and background removal.
---

# Image
Expand Down
4 changes: 2 additions & 2 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
description: Explore the QuickThumb API reference for Canvas, layers, backgrounds, text, images, shapes, outlines, effects, enums, and gradients.
description: Explore the quickthumb API reference for Canvas, layers, backgrounds, text, images, shapes, outlines, effects, enums, and gradients.
---

# API Reference

Complete reference for every class, method, and parameter in QuickThumb.
Complete reference for every class, method, and parameter in quickthumb.

## Public imports

Expand Down
2 changes: 1 addition & 1 deletion docs/api/outline.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Reference for QuickThumb outline layers that draw canvas borders with configurable width, color, opacity, and corner radius.
description: Reference for quickthumb outline layers that draw canvas borders with configurable width, color, opacity, and corner radius.
---

# Outline
Expand Down
2 changes: 1 addition & 1 deletion docs/api/shape.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Reference for QuickThumb shape layers, including rectangles, ellipses, fills, gradients, strokes, shadows, and positioning.
description: Reference for quickthumb shape layers, including rectangles, ellipses, fills, gradients, strokes, shadows, and positioning.
---

# Shape
Expand Down
2 changes: 1 addition & 1 deletion docs/api/text.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Reference for QuickThumb text layers, including rich text parts, fonts, alignment, wrapping, strokes, shadows, and sizing.
description: Reference for quickthumb text layers, including rich text parts, fonts, alignment, wrapping, strokes, shadows, and sizing.
---

# Text
Expand Down
Binary file added docs/assets/brand/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/brand/favicon.ico
Binary file not shown.
Binary file added docs/assets/brand/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/brand/quickthumb-icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/brand/quickthumb-icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/brand/quickthumb-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/brand/social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Review QuickThumb release notes and follow version changes, fixes, and new features through GitHub Releases.
description: Review quickthumb release notes and follow version changes, fixes, and new features through GitHub Releases.
---

# Changelog
Expand Down
4 changes: 2 additions & 2 deletions docs/concepts.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Learn QuickThumb's core model for canvases, ordered layers, coordinates, alignment, effects, fonts, rendering, and JSON specs.
description: Learn quickthumb's core model for canvases, ordered layers, coordinates, alignment, effects, fonts, rendering, and JSON specs.
---

# Core Concepts
Expand Down Expand Up @@ -245,7 +245,7 @@ canvas2 = Canvas.from_json(json_str)

## Validation

QuickThumb validates all inputs at construction time using Pydantic. Invalid values raise `ValidationError` immediately, before any rendering occurs.
quickthumb validates all inputs at construction time using Pydantic. Invalid values raise `ValidationError` immediately, before any rendering occurs.

```python
from quickthumb import ValidationError
Expand Down
14 changes: 7 additions & 7 deletions docs/cookbook/ai-workflow.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
description: Generate reliable QuickThumb JSON specs with LLMs, validate them, render images, and iterate on AI-assisted thumbnail workflows.
description: Generate reliable quickthumb JSON specs with LLMs, validate them, render images, and iterate on AI-assisted thumbnail workflows.
---

# AI Workflow

QuickThumb is designed to be a reliable target for LLM-generated image specs. This recipe walks through a full end-to-end workflow: writing a prompt, getting output, rendering it, and iterating.
quickthumb is designed to be a reliable target for LLM-generated image specs. This recipe walks through a full end-to-end workflow: writing a prompt, getting output, rendering it, and iterating.

## Why QuickThumb works well with AI
## Why quickthumb works well with AI

- The schema is flat and typed — no nested ambiguity
- Every layer has a required `type` discriminator
Expand All @@ -18,7 +18,7 @@ QuickThumb is designed to be a reliable target for LLM-generated image specs. Th

```
1. Write a prompt describing the layout
2. Model outputs QuickThumb JSON or Python
2. Model outputs quickthumb JSON or Python
3. Validate locally (ValidationError catches bad specs immediately)
4. Render to a PNG file
5. Review and iterate with targeted instructions
Expand All @@ -29,7 +29,7 @@ QuickThumb is designed to be a reliable target for LLM-generated image specs. Th
### For JSON output

```text
Generate a QuickThumb JSON config for a 1280×720 YouTube thumbnail.
Generate a quickthumb JSON config for a 1280×720 YouTube thumbnail.

Schema rules:
- Top-level fields: "width", "height", "layers"
Expand All @@ -51,7 +51,7 @@ Return only the JSON object. No explanation, no markdown fencing.
### For Python output

```text
Generate QuickThumb Python code for a 1280×720 YouTube thumbnail.
Generate quickthumb Python code for a 1280×720 YouTube thumbnail.

Available imports:
from quickthumb import (
Expand Down Expand Up @@ -117,7 +117,7 @@ Image(data=base64.b64decode(b64))
Instead of regenerating the whole spec, give the model the current spec and a specific change:

```text
Here is my current QuickThumb JSON spec:
Here is my current quickthumb JSON spec:

<paste spec>

Expand Down
8 changes: 4 additions & 4 deletions docs/cookbook/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
description: Browse ready-to-run QuickThumb recipes for YouTube thumbnails, Instagram cards, podcast promos, shorts covers, and AI workflows.
description: Browse ready-to-run quickthumb recipes for YouTube thumbnails, Instagram cards, podcast promos, shorts covers, and AI workflows.
---

# Cookbook

Ready-to-run examples for common thumbnail and social card formats. Each recipe uses real QuickThumb code you can copy, adapt, and run locally.
Ready-to-run examples for common thumbnail and social card formats. Each recipe uses real quickthumb code you can copy, adapt, and run locally.

## Gallery

Expand Down Expand Up @@ -33,7 +33,7 @@ Ready-to-run examples for common thumbnail and social card formats. Each recipe

## Prerequisites

All recipes assume QuickThumb is installed:
All recipes assume quickthumb is installed:

```bash
pip install quickthumb
Expand All @@ -47,4 +47,4 @@ pip install "quickthumb[rembg]"

## Asset paths

The code snippets below use placeholder paths like `"background.jpg"` and `"portrait.png"`. Swap these for your own local files or remote URLs — QuickThumb accepts both.
The code snippets below use placeholder paths like `"background.jpg"` and `"portrait.png"`. Swap these for your own local files or remote URLs — quickthumb accepts both.
2 changes: 1 addition & 1 deletion docs/cookbook/instagram-card.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Build a square Instagram news card with QuickThumb using a full-bleed image, gradient overlay, badge, headline, and metadata.
description: Build a square Instagram news card with quickthumb using a full-bleed image, gradient overlay, badge, headline, and metadata.
---

# Instagram Card
Expand Down
4 changes: 2 additions & 2 deletions docs/cookbook/podcast-promo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Build a podcast promo card with QuickThumb using remote images, webfonts, background removal, rich text, and layered composition.
description: Build a podcast promo card with quickthumb using remote images, webfonts, background removal, rich text, and layered composition.
---

# Podcast Promo
Expand Down Expand Up @@ -168,7 +168,7 @@ SHOW_FONT_URL = (

### Remote images

Both the background and the guest portrait are fetched from remote URLs. QuickThumb downloads them at render time and caches them locally. Pass any `http://` or `https://` URL to `image=` or `path=`.
Both the background and the guest portrait are fetched from remote URLs. quickthumb downloads them at render time and caches them locally. Pass any `http://` or `https://` URL to `image=` or `path=`.

### Webfont from URL

Expand Down
2 changes: 1 addition & 1 deletion docs/cookbook/shorts-cover.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Render a vertical shorts cover from a QuickThumb JSON spec, demonstrating a JSON-first workflow for mobile video thumbnails.
description: Render a vertical shorts cover from a quickthumb JSON spec, demonstrating a JSON-first workflow for mobile video thumbnails.
---

# Shorts / Vertical Cover
Expand Down
6 changes: 3 additions & 3 deletions docs/cookbook/webfonts-rembg.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Use QuickThumb webfonts and background removal to load remote typefaces, isolate subjects, and compose polished thumbnail images.
description: Use quickthumb webfonts and background removal to load remote typefaces, isolate subjects, and compose polished thumbnail images.
---

# Webfonts & Background Removal
Expand All @@ -10,7 +10,7 @@ Two features that require a bit of setup but unlock a lot of creative flexibilit

## Webfonts

QuickThumb can load fonts from remote URLs at render time. The font file is downloaded once and cached locally.
quickthumb can load fonts from remote URLs at render time. The font file is downloaded once and cached locally.

### Basic usage

Expand Down Expand Up @@ -83,7 +83,7 @@ os.environ["QUICKTHUMB_DEFAULT_FONT"] = "Roboto"
canvas.text(content="Hello", font="Roboto", size=64, color="#FFFFFF", align="center")
```

QuickThumb searches `QUICKTHUMB_FONT_DIR` for files matching the family name, and falls back to `QUICKTHUMB_DEFAULT_FONT` when `font` is omitted.
quickthumb searches `QUICKTHUMB_FONT_DIR` for files matching the family name, and falls back to `QUICKTHUMB_DEFAULT_FONT` when `font` is omitted.

---

Expand Down
6 changes: 3 additions & 3 deletions docs/cookbook/youtube-thumbnail.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Build YouTube thumbnails with QuickThumb using darkened photos, bold text, outlines, reaction layouts, and tutorial compositions.
description: Build YouTube thumbnails with quickthumb using darkened photos, bold text, outlines, reaction layouts, and tutorial compositions.
---

# YouTube Thumbnails
Expand Down Expand Up @@ -33,7 +33,7 @@ from quickthumb import Canvas, Filter, Stroke, TextPart
effects=[Stroke(width=8, color="#000000")],
),
TextPart(
text="Try QuickThumb Today",
text="Try quickthumb Today",
color="#E0E0E0",
size=48,
effects=[Stroke(width=4, color="#000000")],
Expand Down Expand Up @@ -347,6 +347,6 @@ canvas.render("youtube_tutorial.png")

**Key techniques:**

- `add_step()` helper function keeps repeated badge+label patterns DRY while still using the standard QuickThumb API
- `add_step()` helper function keeps repeated badge+label patterns DRY while still using the standard quickthumb API
- Two gradient backgrounds create a blue glow on the left edge without a visible boundary
- The `"#3B82F630"` color (with `30` alpha) renders the divider as a subtle translucent line
6 changes: 3 additions & 3 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Answers to common QuickThumb questions about installation, fonts, images, rendering behavior, JSON specs, and supported Python versions.
description: Answers to common quickthumb questions about installation, fonts, images, rendering behavior, JSON specs, and supported Python versions.
---

# FAQ
Expand Down Expand Up @@ -93,15 +93,15 @@ canvas.text(
)
```

QuickThumb downloads and caches the font file. Note: when using a webfont URL, `bold`, `italic`, and `weight` are ignored — download separate URLs for bold/italic variants.
quickthumb downloads and caches the font file. Note: when using a webfont URL, `bold`, `italic`, and `weight` are ignored — download separate URLs for bold/italic variants.

---

## Images

### Can I use remote images?

Yes, both `canvas.background(image=...)` and `canvas.image(path=...)` accept `http://` and `https://` URLs. QuickThumb downloads and caches them during rendering.
Yes, both `canvas.background(image=...)` and `canvas.image(path=...)` accept `http://` and `https://` URLs. quickthumb downloads and caches them during rendering.

### My image has a white background I want to remove. How?

Expand Down
Binary file added docs/favicon.ico
Binary file not shown.
Loading