image-annotations
Fungsinya
Tool ini menambahkan panah, kotak, dan label ke gambar. Tool ini membantu menyorot bagian penting dari screenshot atau diagram.
Kapan dipakai
- βUntuk menunjukkan lokasi bug pada sebuah screenshot.
- βUntuk menunjukkan apa yang berubah di antara dua gambar.
- βUntuk menambahkan label pada diagram teknis.
Link skill
https://github.com/github/awesome-copilot/blob/main/skills/image-annotations/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTambahkan panah dan teks 'Login Button' yang menunjuk ke tombol login pada screenshot ini.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Anda memberikan gambarnya dan memberi tahu bagian mana yang ingin disorot. Tool ini menggambar kotak atau panah serta menambahkan teks yang Anda pilih, dengan warna tertentu untuk menunjukkan apakah sesuatu itu baik atau buruk.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Image Annotations
Add visual callouts to any image β screenshots, diagrams, architecture docs, demo frames β using PIL/Pillow. Highlights what changed or what to look at, so reviewers don't have to guess.
When to Use This Skill
Use this skill when you need to:
- Highlight a specific area in a screenshot for a PR description
- Annotate before/after images to show what changed
- Add labels and callouts to diagrams or architecture images
- Create annotated frames for animated GIF demos
Prerequisites
pip install Pillow -q
Color Rules
- Red (
#E63946) β only for "bad" / "removed" things (e.g., circling a bug being fixed) - Yellowish-orange (
#FF9F1C) β for neutral highlights ("look here", "new feature", etc.) - Never use red just because it's eye-catching β red = bad/removed
Font
- Use Ink Free (
C:/Windows/Fonts/Inkfree.ttf) for a handwritten look on Windows - On Linux/macOS, fall back to
ImageFont.load_default() - Size 36 for annotations on ~1400px-wide images
stroke_width=1withstroke_fill=<same color as fill>β gives body without being too thick- Do NOT use white stroke β looks like a bad glow effect
Shapes
- Prefer rounded rectangles over circles/ellipses β less pixelation at edges
draw.rounded_rectangle([x1, y1, x2, y2], radius=14, outline=color, width=5)- Padding 18px around the target content
Reference Snippet
from PIL import Image, ImageDraw, ImageFont
# Setup
font = ImageFont.truetype('C:/Windows/Fonts/Inkfree.ttf', 36) # or load_default()
color = '#FF9F1C' # orange for highlights
stroke = 5
pad = 18
img = Image.open('screenshot.png')
draw = ImageDraw.Draw(img)
# Rounded rect with padding
draw.rounded_rectangle(
[x1 - pad, y1 - pad, x2 + pad, y2 + pad],
radius=14, outline=color, width=stroke
)
# Leader line (same thickness as rect)
draw.line([x2 + pad, cy, x2 + pad + 40, cy - 30], fill=color, width=stroke)
# Label β same-color stroke for body, NO white stroke
draw.text(
(x2 + pad + 45, cy - 60), 'label text',
fill=color, font=font, stroke_width=1, stroke_fill=color
)
img.save('annotated.png')
Algorithmic Annotation β annotate.py
For images with multiple elements to annotate, use the annotate.py module below. Save it next to your script and import from it. It handles automatic label placement without overlapping.
Quick start
from annotate import annotate_image
result = annotate_image(
'screenshot.png',
[
{'elem': (560, 275, 635, 390), 'label': 'button', 'draw_box': True},
{'elem': (105, 453, 236, 470), 'label': 'status text'},
],
debug=True,
)
result.save('annotated.png')
elem:(x1, y1, x2, y2)tight bounding box β must be exact pixel coordinateslabel: text label (supports\nfor multi-line)draw_box: ifTrue, draws a rounded rectangle around the element. IfFalse(default), draws a V-arrowhead pointing at the elementdebug: shows targeting rectangles and candidate heatmap for placement validation
Coordinate grid helper
Always use grid_image() before annotating an unfamiliar image. Scaled-down previews display images smaller than actual pixel dimensions β the error compounds as you move away from (0,0).
from annotate import grid_image
grid = grid_image('screenshot.png', step=100)
grid.save('grid.png')
Then verify with small crops:
from PIL import Image
img = Image.open('screenshot.png')
crop = img.crop((x1 - 20, y1 - 20, x2 + 20, y2 + 20))
crop.save('verify.png')
Algorithm overview
- Ring search: candidates between MIN_ARROW (25px) and MAX_ARROW (120px) from element edge
- Contrast scoring: prefers placements where label text is readable β
abs(avg_brightness - 147) - std * 0.3 - dist * 0.02 - Joint resolution: candidates computed independently, placed greedily (best score first)
- Hard blocks: labels cannot overlap any other annotation's element or breathing box
- Proximity penalty: labels within 40px of other placed boxes get a score penalty
- Arrow crossing penalty: -50 for arrows crossing already-placed arrows
Debug mode colors
| Color | Meaning |
|---|---|
| Cyan | Target element box (elem + padding) |
| Gray | Exclusion zone (MIN_ARROW buffer) |
| RedβGreen | Candidate heatmap (red=bad, green=good) |
| Magenta | Chosen label position |
| Orange | Final rendered annotation |
Arrow styles
β¦
Pertanyaan umum
Bolehkah saya memakai warna apa saja?
Gunakan warna merah hanya untuk menandai sesuatu yang buruk atau dihapus. Gunakan warna kuning-oranye untuk sorotan netral atau fitur baru.
Bagaimana tool tahu di mana harus menempatkan teks?
Tool mencoba mencari posisi terbaik agar teks tidak menutupi area penting, dan menggunakan algoritma untuk mencegah teks saling tumpang tindih.
Apakah saya perlu menginstal sesuatu?
Ya, Anda perlu menginstal library Pillow di lingkungan Python Anda.
Detail
Deskripsi asli dari pembuat
Annotate screenshots, diagrams, and images with callout rectangles, arrows, labels, and color-coded highlights using PIL. Includes rules for animated GIF annotations with timing and pacing.
repo: github/awesome-copilot
Popularitas
- Bintang GitHub
- 40k
- Peringkat
- #7246
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
acquire-codebase-knowledge
40kMembantu agent Anda memahami dan mendokumentasikan proyek kode yang sudah ada. Berguna untuk proses onboarding anggota baru atau mendapatkan gambaran arsitektur.
acreadiness-assess
40kMemungkinkan agent Anda menilai kesiapan proyek untuk AI dan membuat laporannya. Berguna untuk mengetahui seberapa siap proyek menggunakan alat AI.
acreadiness-generate-instructions
40kMembantu agent Anda membuat instruksi untuk alat AI berdasarkan hasil penilaian. Berguna untuk meningkatkan cara AI berinteraksi dengan kode dan menutup celah yang ditemukan.
acreadiness-policy
40kMemungkinkan agent Anda membantu menyusun atau menerapkan kebijakan untuk penilaian proyek AI. Berguna untuk menstandarisasi evaluasi proyek dan memastikan kepatuhan.
Skill serupa
canvas
394kMemungkinkan agent Anda menampilkan widget visual yang di-hosting di panel Mac yang terhubung, lalu menyembunyikan panel atau memindahkannya ke halaman lain.
control-ui
394kMembantu agent Anda mengatur dan memecahkan masalah OpenClaw Control UI, termasuk sesi, dasbor, dan Gateway yang terhubung.
diagram-maker
394kMembantu agent Anda membuat diagram yang jelas sebagai SVG, HTML, atau Excalidraw yang dapat diedit untuk proses, arsitektur sistem, dan sketsa papan tulis.