python-pillow-graphics

python-pillow-graphics is a skill for Claude Code, Codex from cxcscmu/SkillLearnBench. It costs 25 tokens per session (831 once invoked), scanned A, original, MIT.

A Python-based tool for creating images such as diagrams, posters, and technical graphics. It uses Pillow, a Python library for making and editing images, with control over colors, shapes, and text.

In plain words
What is it for?
Use it to generate diagrams, posters, and other technical visuals with Python. It supports drawing rectangles, circles, lines, polygons, and text onto images.
Why use it?
It helps when you need repeatable, precisely sized graphics without drawing them by hand. You can set exact colors, lines, shapes, and typography in code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to generate diagrams, posters, and other technical visuals with Python. It supports drawing rectangles, circles, lines, polygons, and text onto images.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cxcscmu/skilllearnbench/python-pillow-graphics
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cxcscmu/SkillLearnBench --skill python-pillow-graphics
Clone the repo
git clone --depth 1 https://github.com/cxcscmu/SkillLearnBench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-pillow-graphics

README.md
[![agentmods](https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/python-pillow-graphics/github.svg)](https://agentmods.dev/skills/cxcscmu/skilllearnbench/python-pillow-graphics)
Your own site
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/python-pillow-graphics"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/python-pillow-graphics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-pillow-graphics

Your own site · 80×15
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/python-pillow-graphics"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/python-pillow-graphics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 831 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.00831
Opus 5.5 $0.00010 $0.00332
Sonnet 5.5 $0.00005 $0.00166
Haiku 4.5 $0.00003 $0.00083

Measured 1mo ago against content hash 900048eeae2d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-pillow-graphics scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/b1-one-shot-claude-haiku-4-5/anthropic-poster-design/python-pillow-graphics/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Pillow Graphics Generation

Overview

Pillow (PIL) is the standard Python library for image manipulation and creation. It's ideal for generating technical diagrams, posters, and graphics with precise control over colors, shapes, and text.

Installation

pip install Pillow

Key Concepts

Image Creation

from PIL import Image, ImageDraw, ImageFont

# Create a new image with specific background color
width, height = 1920, 1200
background_color = (240, 240, 240)  # RGB tuple
image = Image.new('RGB', (width, height), background_color)
draw = ImageDraw.Draw(image)

Color Management

  • RGB Tuples: (R, G, B) where each value is 0-255
  • Hex to RGB Conversion:
    def hex_to_rgb(hex_color):
        hex_color = hex_color.lstrip('#')
        return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4))
    

Drawing Shapes

# Rectangles
draw.rectangle([x1, y1, x2, y2], fill=color, outline=color, width=stroke)

# Circles/Ellipses
draw.ellipse([x1, y1, x2, y2], fill=color, outline=color)

# Lines
draw.line([(x1, y1), (x2, y2)], fill=color, width=stroke_width)

# Polygons (for 3D perspective)
draw.polygon([(x1, y1), (x2, y2), (x3, y3)], fill=color, outline=color)

Typography

# Load system fonts or TTF files
try:
    font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", size=48)
except:
    font = ImageFont.load_default()

# Draw text
draw.text((x, y), "TEXT", fill=color, font=font, anchor="lm")  # anchor: "lm"=left-middle

Best Practices

  • Use anchor parameter for precise text positioning
  • Work with RGB tuples consistently throughout
  • Set image DPI metadata for high-quality output
  • Use layers approach: background → shapes → text → details
  • Save as PNG for transparency or high-quality technical graphics

Saving Output

image.save('/path/to/image.png', quality=95, dpi=(300, 300))

Advanced Techniques

Creating 3D Perspective

Use polygons and shading to create depth:

# Front face (lighter)
draw.polygon([(x1, y1), (x2, y2), (x3, y3), (x4, y4)], fill=light_color)
# Side face (darker for depth)
draw.polygon([(x2, y2), (x3, y3), (x5, y5), (x6, y6)], fill=dark_color)

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 104 lines · 25 tokens per session scan A 900048eeae2d

Subscribe to this mod's changes

python-pillow-graphics is a skill published in the GitHub repository cxcscmu/SkillLearnBench (88 stars, last pushed 17d ago), licensed MIT. It adds 25 tokens to every session and 831 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

rdkit

Cheminformatics toolkit for fine-grained molecular control. SMILES/SDF parsing, descriptors (MW, LogP, TPSA), fingerprints, substructure search, 2D/3D generation, similarity, reactions. For standard workflows with simpler interface, use datamol (wrapper around RDKit). Use rdkit for advanced control, custom…

benchflow-ai/skillsbench · 80 tokens

pcap-analysis

Guidance for analyzing network packet captures (PCAP files) and computing network statistics using Python, with tested utility functions.

benchflow-ai/skillsbench · 28 tokens

memory-optimization

Optimize Python code for reduced memory usage and improved memory efficiency. Use when asked to reduce memory footprint, fix memory leaks, optimize data structures for memory, handle large datasets efficiently, or diagnose memory issues. Covers object sizing, generator patterns, efficient data structures, and memory…

benchflow-ai/skillsbench · 60 tokens

python-parallelization

Transform sequential Python code into parallel/concurrent implementations. Use when asked to parallelize Python code, improve code performance through concurrency, convert loops to parallel execution, or identify parallelization opportunities. Handles CPU-bound (multiprocessing), I/O-bound (asyncio, threading), and…

benchflow-ai/skillsbench · 68 tokens

trl

Reference for the TRL (Transformer Reinforcement Learning) library codebase. Use proactively before reading or editing any file under trl/ so you have the intended contracts and invariants in mind, not just what the current code says. Covers trainer hierarchy (SFT, DPO, GRPO, KTO), shared utility functions…

benchflow-ai/skillsbench · 100 tokens

parallel-processing

Parallel processing with joblib for grid search and batch computations. Use when speeding up computationally intensive tasks across multiple CPU cores.

benchflow-ai/skillsbench · 28 tokens