정보
이미지-유틸리티 스킬은 Pillow 기반의 이미지 조작 기능으로 리사이즈, 크롭, 형식 변환, 합성 및 웹 최적화를 제공합니다. AI 생성 이미지 후처리, 디렉토리 일괄 처리, 웹 전송용 이미지 준비에 이상적입니다. 이 결정론적 픽셀 수준 도구는 단독으로 사용하거나 bria-ai와 같은 다른 스킬과 함께 작동합니다.
빠른 설치
Claude Code
추천npx skills add Bria-AI/bria-skill -a claude-code/plugin add https://github.com/Bria-AI/bria-skillgit clone https://github.com/Bria-AI/bria-skill.git ~/.claude/skills/image-utilsClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Image Utilities
Pillow-based utilities for deterministic pixel-level image operations. Use for resize, crop, composite, format conversion, watermarks, and other standard image processing tasks.
When to Use This Skill
- Post-processing AI-generated images: Resize, crop, optimize for web after generation
- Format conversion: PNG ↔ JPEG ↔ WEBP with quality control
- Compositing: Overlay images, paste subjects onto backgrounds
- Batch processing: Resize to multiple sizes, add watermarks
- Web optimization: Compress and resize for fast delivery
- Social media preparation: Crop to platform-specific aspect ratios
When NOT to Use This Skill — Use bria-ai Instead
This skill handles deterministic pixel-level operations only. For any generative or AI-powered image work, use the bria-ai skill instead:
- Generating images from text prompts → use
bria-ai - AI background removal or replacement → use
bria-ai - AI image editing (inpainting, object removal/addition) → use
bria-ai - Style transfer or AI-driven visual effects → use
bria-ai - Creating product lifestyle shots with AI → use
bria-ai - Image upscaling with AI super-resolution → use
bria-ai
Rule of thumb: If the task requires creating new visual content or understanding image semantics, use bria-ai. If the task requires transforming existing pixels (resize, crop, format convert, watermark), use this skill.
If bria-ai is not available, install it with:
npx skills add bria-ai/bria-skill
Quick Reference
| Operation | Method | Description |
|---|---|---|
| Loading | load(source) | Load from URL, path, bytes, or base64 |
load_from_url(url) | Download image from URL | |
| Saving | save(image, path) | Save with format auto-detection |
to_bytes(image, format) | Convert to bytes | |
to_base64(image, format) | Convert to base64 string | |
| Resizing | resize(image, width, height) | Resize to exact dimensions |
scale(image, factor) | Scale by factor (0.5 = half) | |
thumbnail(image, size) | Fit within size, maintain aspect | |
| Cropping | crop(image, left, top, right, bottom) | Crop to region |
crop_center(image, width, height) | Crop from center | |
crop_to_aspect(image, ratio) | Crop to aspect ratio | |
| Compositing | paste(bg, fg, position) | Overlay at coordinates |
composite(bg, fg, mask) | Alpha composite | |
fit_to_canvas(image, w, h) | Fit onto canvas size | |
| Borders | add_border(image, width, color) | Add solid border |
add_padding(image, padding) | Add whitespace padding | |
| Transforms | rotate(image, angle) | Rotate by degrees |
flip_horizontal(image) | Mirror horizontally | |
flip_vertical(image) | Flip vertically | |
| Watermarks | add_text_watermark(image, text) | Add text overlay |
add_image_watermark(image, logo) | Add logo watermark | |
| Adjustments | adjust_brightness(image, factor) | Lighten/darken |
adjust_contrast(image, factor) | Adjust contrast | |
adjust_saturation(image, factor) | Adjust color saturation | |
blur(image, radius) | Apply Gaussian blur | |
| Web | optimize_for_web(image, max_size) | Optimize for delivery |
| Info | get_info(image) | Get dimensions, format, mode |
Requirements
pip install Pillow requests
Basic Usage
from image_utils import ImageUtils
# Load from URL
image = ImageUtils.load_from_url("https://example.com/image.jpg")
# Or load from various sources
image = ImageUtils.load("/path/to/image.png") # File path
image = ImageUtils.load(image_bytes) # Bytes
image = ImageUtils.load("data:image/png;base64,...") # Base64
# Resize and save
resized = ImageUtils.resize(image, width=800, height=600)
ImageUtils.save(resized, "output.webp", quality=90)
# Get image info
info = ImageUtils.get_info(image)
print(f"{info['width']}x{info['height']} {info['mode']}")
Resizing & Scaling
# Resize to exact dimensions
resized = ImageUtils.resize(image, width=800, height=600)
# Resize maintaining aspect ratio (fit within bounds)
fitted = ImageUtils.resize(image, width=800, height=600, maintain_aspect=True)
# Resize by width only (height auto-calculated)
resized = ImageUtils.resize(image, width=800)
# Scale by factor
half = ImageUtils.scale(image, 0.5) # 50% size
double = ImageUtils.scale(image, 2.0) # 200% size
# Create thumbnail
thumb = ImageUtils.thumbnail(image, (150, 150))
Cropping
# Crop to specific region
cropped = ImageUtils.crop(image, left=100, top=50, right=500, bottom=350)
# Crop from center
center = ImageUtils.crop_center(image, width=400, height=400)
# Crop to aspect ratio (for social media)
square = ImageUtils.crop_to_aspect(image, "1:1") # Instagram
wide = ImageUtils.crop_to_aspect(image, "16:9") # YouTube thumbnail
story = ImageUtils.crop_to_aspect(image, "9:16") # Stories/Reels
# Control crop anchor
top_crop = ImageUtils.crop_to_aspect(image, "16:9", anchor="top")
bottom_crop = ImageUtils.crop_to_aspect(image, "16:9", anchor="bottom")
Compositing
# Paste foreground onto background
result = ImageUtils.paste(background, foreground, position=(100, 50))
# Alpha composite (foreground must have transparency)
result = ImageUtils.composite(background, foreground)
# Fit image onto canvas with letterboxing
canvas = ImageUtils.fit_to_canvas(
image,
width=1200,
height=800,
background_color=(255, 255, 255, 255), # White
position="center" # or "top", "bottom"
)
Format Conversion
# Convert to different formats
png_bytes = ImageUtils.to_bytes(image, "PNG")
jpeg_bytes = ImageUtils.to_bytes(image, "JPEG", quality=85)
webp_bytes = ImageUtils.to_bytes(image, "WEBP", quality=90)
# Get base64 for data URLs
base64_str = ImageUtils.to_base64(image, "PNG")
data_url = ImageUtils.to_base64(image, "PNG", include_data_url=True)
# Returns: "data:image/png;base64,..."
# Save with format auto-detected from extension
ImageUtils.save(image, "output.png")
ImageUtils.save(image, "output.jpg", quality=85)
ImageUtils.save(image, "output.webp", quality=90)
Watermarks
# Text watermark
watermarked = ImageUtils.add_text_watermark(
image,
text="© 2024 My Company",
position="bottom-right", # bottom-left, top-right, top-left, center
font_size=24,
color=(255, 255, 255, 128), # Semi-transparent white
margin=20
)
# Logo/image watermark
logo = ImageUtils.load("logo.png")
watermarked = ImageUtils.add_image_watermark(
image,
watermark=logo,
position="bottom-right",
opacity=0.5,
scale=0.15, # 15% of image width
margin=20
)
Adjustments
# Brightness (1.0 = original, <1 darker, >1 lighter)
bright = ImageUtils.adjust_brightness(image, 1.3)
dark = ImageUtils.adjust_brightness(image, 0.7)
# Contrast (1.0 = original)
high_contrast = ImageUtils.adjust_contrast(image, 1.5)
# Saturation (0 = grayscale, 1.0 = original, >1 more vivid)
vivid = ImageUtils.adjust_saturation(image, 1.3)
grayscale = ImageUtils.adjust_saturation(image, 0)
# Sharpness
sharp = ImageUtils.adjust_sharpness(image, 2.0)
# Blur
blurred = ImageUtils.blur(image, radius=5)
Transforms
# Rotate (counter-clockwise, degrees)
rotated = ImageUtils.rotate(image, 45)
rotated = ImageUtils.rotate(image, 90, expand=False) # Don't expand canvas
# Flip
mirrored = ImageUtils.flip_horizontal(image)
flipped = ImageUtils.flip_vertical(image)
Borders & Padding
# Add solid border
bordered = ImageUtils.add_border(image, width=5, color=(0, 0, 0))
# Add padding (whitespace)
padded = ImageUtils.add_padding(image, padding=20) # Uniform
padded = ImageUtils.add_padding(image, padding=(10, 20, 10, 20)) # left, top, right, bottom
Web Optimization
# Optimize for web delivery
optimized_bytes = ImageUtils.optimize_for_web(
image,
max_dimension=1920, # Resize if larger
format="WEBP", # Best compression
quality=85
)
# Save optimized
with open("optimized.webp", "wb") as f:
f.write(optimized_bytes)
Integration with Bria AI
Use alongside the bria-ai skill to post-process AI-generated images. Generate or edit images with Bria's API, then use image-utils for resizing, cropping, watermarking, and web optimization.
import requests
from image_utils import ImageUtils
# Generate with Bria AI (see bria-ai skill for full API reference)
response = requests.post(
"https://engine.prod.bria-api.com/v2/image/generate",
headers={"api_token": BRIA_API_KEY, "Content-Type": "application/json"},
json={"prompt": "product photo of headphones", "aspect_ratio": "1:1", "sync": True}
)
image_url = response.json()["result"]["image_url"]
# Download and post-process
image = ImageUtils.load_from_url(image_url)
# Create multiple sizes for responsive images
sizes = {
"large": ImageUtils.resize(image, width=1200),
"medium": ImageUtils.resize(image, width=600),
"thumb": ImageUtils.thumbnail(image, (150, 150))
}
# Save all as optimized WebP
for name, img in sizes.items():
ImageUtils.save(img, f"product_{name}.webp", quality=85)
Batch Processing Example
from pathlib import Path
from image_utils import ImageUtils
def process_catalog(input_dir, output_dir):
"""Process all images in a directory."""
output_path = Path(output_dir)
output_path.mkdir(exist_ok=True)
for image_file in Path(input_dir).glob("*.{jpg,png,webp}"):
image = ImageUtils.load(image_file)
# Crop to square
square = ImageUtils.crop_to_aspect(image, "1:1")
# Resize to standard size
resized = ImageUtils.resize(square, width=800, height=800)
# Add watermark
final = ImageUtils.add_text_watermark(resized, "© My Brand")
# Save optimized
output_file = output_path / f"{image_file.stem}.webp"
ImageUtils.save(final, output_file, quality=85)
process_catalog("./raw_images", "./processed")
API Reference
See image_utils.py for complete implementation with docstrings.
GitHub 저장소
자주 묻는 질문
image-utils Skill이란 무엇인가요?
image-utils은(는) Bria-AI이(가) 만든 Claude Skill입니다. Skill은 Claude가 필요할 때 불러오는 지침과 리소스를 묶어 추가 프롬프트 없이 image-utils 관련 작업을 수행할 수 있게 합니다.
image-utils은(는) 어떻게 설치하나요?
이 페이지의 설치 명령을 사용하세요. image-utils을(를) Claude Code 플러그인으로 추가하거나 저장소를 skills 디렉터리에 복제한 다음 Claude를 다시 시작해 Skill을 불러옵니다.
image-utils은(는) 어떤 카테고리에 속하나요?
image-utils은(는) 메타 카테고리에 속합니다.
image-utils은(는) 무료로 사용할 수 있나요?
네. image-utils은(는) AIMCP에 등록되어 있으며 무료로 설치할 수 있습니다.
연관 스킬
이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.
이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.
이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.
SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.
