Gemini image skill

From jykim/claude-obsidian-skills · View interactive version

Gemini image skill is an AI agent skill from the GitHub repository jykim/claude-obsidian-skills. Google Gemini API를 사용한 이미지 생성 스킬. 슬라이드 및 문서용 이미지를 생성합니다.

How to use this skill

Skill file

Gemini Image Generation Skill

Google Gemini API를 사용한 이미지 생성 스킬. 슬라이드 및 문서용 이미지를 생성합니다.

Purpose

Gemini 2.0 Flash 또는 Imagen 3 모델을 사용하여 문서/슬라이드에 필요한 이미지를 생성합니다. 해상도와 종횡비 선택을 지원하며, 사용자 승인 워크플로우를 포함합니다.

When to Use This Skill

Environment Setup

# 1. API 키 설정
export GEMINI_API_KEY="your-api-key"

# 2. 의존성 설치
pip install google-genai Pillow

Workflow

Phase 1: Analysis

  1. 대상 문서/슬라이드 읽기
  2. 이미지가 필요한 섹션/슬라이드 식별
  3. 각 섹션의 핵심 컨셉 추출

Phase 2: Style & Configuration Selection

스타일 옵션:

| # | 스타일 | 설명 | 적합한 용도 |

|---|--------|------|-------------|

| 1 | Infographic (기본) | 레이블/텍스트 포함, dense | 문서, 발표 |

| 2 | Technical Diagram | 깔끔한 선, 플로우차트 | 기술 문서 |

| 3 | Vibrant Modern Cartoon | 밝은 그라데이션, 플랫 | 비즈니스, 교육 |

| 4 | Professional Minimalist | 절제된 색상, 기하학 | 공식 발표 |

| 5 | Bold Graphic | 고대비, 팝아트 | 마케팅 |

| 6 | Custom | 사용자 지정 | 자유 |

기본값: Infographic 스타일 (텍스트/레이블 포함)

모델 선택:

| 모델 | 비용 | 특징 |

|------|------|------|

| gemini-3-pro-image-preview | $0.06/장 | 기본값, 한글 완벽, 최고 품질 |

| gemini-2.5-flash-image | $0.039/장 | 종횡비 지원, 빠름 |

| gemini-2.0-flash-exp | 무료 | 빠름, 반복용 (한글 깨짐) |

| imagen-4.0-generate-001 | $0.03/장 | Imagen 4.0, 고품질 |

종횡비 옵션: 1:1, 9:16, 16:9, 3:4, 4:3, 3:2, 2:3, 21:9

슬라이드용: --aspect-ratio 16:9 (기본 모델이 gemini-3-pro-image-preview)

Phase 3: Image Generation

python3 "generate_gemini_image.py" \
    "[상세 설명]" \
    --output-path "[경로]" \
    --style "[스타일]" \
    --model "[모델]" \
    --aspect-ratio "[종횡비]" \
    --auto-approve

Phase 4: Integration

슬라이드:

![right fit](_files_/filename.png)

문서:

![](path/to/image.png)

Style Descriptions for Script

| 스타일 | --style 값 |

|--------|------------|

| Infographic (기본) | "clean infographic with labeled sections, icons, and visual hierarchy" |

| Technical Diagram | "technical diagram with flowchart elements, arrows, and labeled components" |

| Vibrant Modern Cartoon | "vibrant modern minimalist cartoon illustration" |

| Professional Minimalist | "professional minimalist illustration with muted colors and clean geometric shapes" |

| Bold Graphic | "bold graphic illustration with high contrast colors and strong geometric shapes" |

프롬프트 작성 팁:

File Naming Convention

슬라이드: [slide-topic-slug].png

문서: [section-number]-[topic-slug].png

Cost Estimation

생성 전 비용 안내:

Error Handling

| 에러 | 해결 방법 |

|------|-----------|

| API 키 없음 | GEMINI_API_KEY 환경변수 설정 |

| 안전 필터 차단 | 프롬프트 수정 후 재시도 |

| 모델 미지원 | 사용 가능한 모델로 변경 |

| 네트워크 오류 | 재시도 |

Example Invocation

기본 사용

python3 generate_gemini_image.py "AI 지식 노동자가 책상에서 작업하는 모습" \
    --output-path "_files_/knowledge-worker.png"

16:9 슬라이드용 (권장)

python3 generate_gemini_image.py "팀 협업 미팅" \
    --output-path "_files_/team-meeting.png" \
    --model "gemini-2.5-flash-image" \
    --aspect-ratio "16:9" \
    --style "professional minimalist illustration"

고품질 이미지 (Imagen 4.0)

python3 generate_gemini_image.py "제품 쇼케이스" \
    --output-path "_files_/product.png" \
    --model "imagen-4.0-generate-001"

배치 처리 (자동 승인)

python3 generate_gemini_image.py "혁신 컨셉" \
    --output-path "_files_/innovation.png" \
    --auto-approve

Best Practices

  1. 인포그래픽 스타일 선호: 텍스트/레이블 포함된 dense한 정보 시각화
  2. 스타일 일관성: 같은 문서/슬라이드 내에서 동일 스타일 유지
  3. 상세한 프롬프트: 구체적인 시각적 메타포와 컨셉 포함
  4. 배치 생성: 모든 이미지 먼저 생성 후 일괄 삽입
  5. 비용 확인: 생성 전 예상 비용 확인

⚠️ 피해야 할 것: 추상적인 일러스트 (예: 사람들이 연결된 모호한 그림)

✅ 선호: 다이어그램, 플로우차트, 레이블이 있는 인포그래픽

Comparison with DALL-E Skill

| 기능 | DALL-E | Gemini |

|------|--------|--------|

| 무료 티어 | X | O (Flash) |

| 종횡비 | 정사각형만 | 5가지 옵션 |

| 출력 포맷 | JPEG | PNG/JPEG |

| 비용 | $0.04 | $0~$0.03 |

선택 기준:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.