Claude
Skills
Sign in
Back

creating-coloring-books

Included with Lifetime
$97 forever

End-to-end coloring book creation, packaging, pricing, and multi-storefront publishing pipeline. Converts a topic/trend into print-ready coloring pages, bundles them for sale, and posts to Etsy, Creative Market, Gumroad, Amazon KDP, and more. Use when: creating coloring books, coloring pages, coloring bundles, converting images to line art for print, packaging digital downloads, listing on storefronts, or when the user provides a topic and wants sellable coloring content. Triggers: "coloring book", "coloring pages", "coloring bundle", "line art", "convert to coloring", "printable coloring", "list on etsy", "sell coloring pages", any topic + "coloring".

Writing & Docsscripts

What this skill does


# Creating Coloring Books

## Overview

**Input:** A topic or trend (e.g. "kpop demon hunters") + optional page count (default 10).

**Output:**

1. Workflow log in `~/d/33GOD/{YYYY-MM-DD}/DigiPopStudios/{topic-slug}/run-{RUNID}/`
2. Quality-checked coloring book pages uploaded to media.delo.sh as PNG+SVG pairs
3. Packaged bundles (PDF, ZIP) ready for sale
4. Listings posted to multiple storefronts with optimized titles, descriptions, and pricing

## Workflow — 9 Phases

Follow each phase and step **exactly**. Do not substitute, skip, or reorder.

---

### Phase 1: Research — Google Images Browse

1. Open the **openclaw browser** (`profile=openclaw`).
2. Navigate to Google Images: `https://www.google.com/search?tbm=isch&q={url-encoded topic}`.
3. Take a snapshot of the results page.
4. Identify 15–20 candidate thumbnails that have strong line-art potential:
   - Prefer: illustrations, anime/manga, vector art, bold outlines, distinct shapes.
   - Avoid: photographs, photorealistic 3D renders, blurry/low-contrast, text-heavy.
5. Log each candidate: thumbnail position, brief description, why selected.

**Hard rules:**

- Source is Google Images only. Do NOT use Pixabay, Vecteezy, or any stock API.
- Do NOT attempt to download images via curl/requests. Screenshots only (Phase 2).

---

### Phase 2: Source Capture — Screenshot & Crop

For each candidate from Phase 1:

1. Click on the thumbnail in Google Images to open the **preview panel** on the right.
2. **Screenshot the full browser window** with the preview panel visible.
3. Save screenshots to `{bundle}/research/sources/src-{NN}.png`.

**CRITICAL — Auto-crop the preview panel before conversion:**

The screenshot includes the entire Google Images page (thumbnail grid, search bar, UI chrome).
You MUST crop to extract only the preview image before feeding to Phase 3.

```python
# Crop the preview panel from each screenshot
import cv2, numpy as np
from pathlib import Path

src_dir = Path('{bundle}/research/sources')
out_dir = src_dir / 'crops'
out_dir.mkdir(exist_ok=True)

for f in sorted(src_dir.glob('src-*.png')):
    img = cv2.imread(str(f))
    h, w = img.shape[:2]
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    _, th = cv2.threshold(gray, 220, 255, cv2.THRESH_BINARY)
    mask = np.zeros_like(th)
    mask[:, int(w * 0.45):] = th[:, int(w * 0.45):]
    num, labels, stats, _ = cv2.connectedComponentsWithStats(mask, 8)
    best = None
    for i in range(1, num):
        x, y, ww, hh, area = stats[i]
        if area < 8000: continue
        score = float(area)
        if hh > ww: score *= 1.3
        if x > w * 0.55: score *= 1.2
        if best is None or score > best[0]:
            best = (score, (x, y, ww, hh))
    if best:
        x, y, ww, hh = best[1]
        pad = int(min(ww, hh) * 0.12)
        crop = img[max(0,y-pad):min(h,y+hh+pad), max(0,x-pad):min(w,x+ww+pad)]
    else:
        crop = img[int(h*0.12):int(h*0.82), int(w*0.62):int(w*0.98)]
    crop = cv2.resize(crop, (1024, 1536), interpolation=cv2.INTER_CUBIC)
    cv2.imwrite(str(out_dir / f.name.replace('src-', 'crop-')), crop)
```

The **cropped images** in `sources/crops/` are what you feed to Phase 3, NOT the raw screenshots.

**The screenshot IS the source asset.** Do not attempt to download the original file.

---

### Phase 3: Convert to Coloring Pages — fal.ai Qwen Image Edit 2511

Use the bundled script on the **cropped** sources:

```bash
source ~/.config/zshyzsh/secrets.zsh
~/.agents/skills/creating-coloring-books/.venv/bin/python \
  ~/.agents/skills/creating-coloring-books/scripts/coloring-convert \
  {bundle}/research/sources/crops/ \
  --output-dir {bundle}/coloring/ \
  --prompt "Convert this image into a clean black and white coloring book page. Keep only the main character(s) and scene; remove UI chrome and website elements. Thick crisp outlines, white background, no grayscale, no text, no logos."
```

The script:

- Uploads each cropped source to fal.ai storage.
- Calls `fal-ai/qwen-image-edit-2511` with the coloring conversion prompt.
- Downloads the resulting coloring page PNG.
- Proceeds to Phase 4 automatically (vectorization).
- Writes per-page metadata JSON and a manifest.

---

### Phase 4: Vectorize — fal.ai Recraft Vectorize

Handled automatically by `scripts/coloring-convert` after Phase 3.

Output pairs:

- `{bundle}/coloring/page-{NN}-coloring.png`
- `{bundle}/coloring/page-{NN}-coloring.svg`

---

### Phase 5: QA — Independent Agent Inspection

Spawn a sub-agent for QA (**use model=opus for visual accuracy**):

```
sessions_spawn(
  task="QA coloring book pages. Inspect in batches of 5 to avoid truncation.
    For each PNG in {bundle}/coloring/page-*-coloring.png:
    1. Analyze the image visually.
    2. Rate 1-5 on: line_quality, complexity_balance, colorable_regions, print_artifacts, age_appropriateness, subject_recognizability.
    3. PASS if average >= 3.5 and no category below 2. Otherwise FAIL with reason.
    4. Write results to {bundle}/qa/qa-report.json.
    5. Write summary to {bundle}/qa/qa-summary.md with ranking and Top 10.
    If a page FAILS, note which source it came from so it can be substituted.",
  mode="run",
  model="opus"
)
```

For any FAILED pages:

1. Return to Phase 1 and find a replacement source.
2. Re-run Phases 2–4 for the replacement.
3. Re-run QA on the replacement only.
4. Repeat until 10 pages pass or the candidate pool is exhausted.

---

### Phase 6: Upload to Piwigo (Asset Gallery)

Upload all passing pages (PNG + vector pairs) to `media.delo.sh` album 1.

**Auth:** username=`delorenj`, password=`Ittr5eesol`

```python
import requests
BASE = "https://media.delo.sh"
s = requests.Session()
s.headers.update({"User-Agent": "Dumply/1.0", "Referer": f"{BASE}/"})
s.post(f"{BASE}/ws.php?format=json", data={
    "method": "pwg.session.login", "username": "delorenj", "password": "Ittr5eesol"
})
# Upload each file
for file_path in files:
    with open(file_path, "rb") as f:
        s.post(f"{BASE}/ws.php?format=json",
            data={"method": "pwg.images.addSimple", "category": "1", "name": display_name},
            files={"image": (file_path.name, f, mime_type)})
```

**SVG upload caveat:** Piwigo rejects SVG. Render SVG → JPG via ImageMagick:

```bash
magick -density 300 page.svg -background white -alpha remove -alpha off -quality 95 page-vector.jpg
```

**Naming:** `{topic-slug}-page-{NN}-raster` and `{topic-slug}-page-{NN}-vector-jpg`

---

### Phase 7: Packaging & Bundling

Create sale-ready bundles in `{bundle}/packages/`:

#### 7a. Digital Download Bundle (ZIP)

```
{topic-slug}-coloring-bundle/
├── README.txt              # License, instructions, credits
├── pages/
│   ├── page-01.png         # High-res coloring pages (300 DPI)
│   ├── page-01.svg         # Vector versions
│   ├── page-02.png
│   ├── page-02.svg
│   └── ...
└── {topic-slug}-complete.pdf  # All pages in one printable PDF
```

#### 7b. Printable PDF Bundle

Generate a print-ready PDF (8.5×11" letter, portrait):

```python
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch

c = canvas.Canvas(output_pdf, pagesize=letter)
w, h = letter  # 612 x 792 points

# Cover page
c.setFont("Helvetica-Bold", 36)
c.drawCentredString(w/2, h*0.6, title)
c.setFont("Helvetica", 18)
c.drawCentredString(w/2, h*0.5, f"{page_count} Coloring Pages")
c.drawCentredString(w/2, h*0.35, "DigiPop Studios")
c.showPage()

# Coloring pages (one per page, centered with margins)
for png in sorted_pages:
    c.drawImage(png, 0.5*inch, 0.5*inch, w - 1*inch, h - 1*inch,
                preserveAspectRatio=True, anchor='c')
    c.showPage()

c.save()
```

#### 7c. Amazon KDP Interior (if 24+ pages)

KDP requires minimum 24 interior pages. For a 10-page bundle:

- Add a title page, copyright page, "how to use" page, and back-of-page blanks
- Total: title + copyright + howto + (10 × 2 sides) + closing = 24 pages minimum
- Format: PDF, 8.5×11" (or 8.25×11.25" with bleed), 300 DP
Files: 3
Size: 24.6 KB
Complexity: 51/100
Category: Writing & Docs

Related in Writing & Docs