Skip to main content

썸네일 생성 도구 - Pillow 기반

Project description

썸네일 생성기 (Python)

JavaScript 기반 썸네일 생성기를 Python으로 변환한 프로젝트입니다.

주요 변경사항

  • Pillow: 이미지 생성 라이브러리로 사용
  • PySide6: GUI 프레임워크로 사용
  • Python: 모든 코드를 Python으로 변환

설치 방법

pip install -r requirements.txt

사용 방법

uv를 사용하여 설치:

uv sync

또는 직접 실행:

uv run python -m thumbnail_maker

1. GUI 사용 (추천)

uv run thumbnail-gui

PySide6 기반 GUI에서 썸네일을 생성할 수 있습니다.

2. CLI 사용

기본 사용

uv run generate-thumbnail

DSL 파일 지정

uv run generate-thumbnail mydsl.json -o output.png

간편 CLI (genthumb)

# 기본
uv run genthumb

# 제목/부제목 덮어쓰기
uv run genthumb --title "새 제목" --subtitle "새 부제목"

# 배경 이미지 설정
uv run genthumb --bgImg bg.png

# 출력 파일 지정
uv run genthumb -o result.png

파일 구조

thumbnail_maker/
├── requirements.txt           # Python 패키지 의존성
├── thumbnailRenderer.py      # 핵심 렌더링 로직
├── generateThumbnail.py      # 메인 생성 스크립트
├── genthumb.py              # 간편 CLI 스크립트
├── main_gui.py              # PySide6 GUI 애플리케이션
└── thumbnail.json           # DSL 예제 파일

DSL 파일 형식

{
  "Thumbnail": {
    "Resolution": {
      "type": "preset",
      "value": "16:9"
    },
    "Background": {
      "type": "solid",
      "color": "#a3e635"
    },
    "Texts": [
      {
        "type": "title",
        "content": "제목 텍스트",
        "gridPosition": "tl",
        "font": {
          "name": "SBAggroB",
          "faces": [...]
        },
        "fontSize": 48,
        "color": "#4ade80",
        "outline": {
          "thickness": 7,
          "color": "#000000"
        },
        "enabled": true
      }
    ]
  }
}

해상도 설정

Preset 모드

{
  "type": "preset",
  "value": "16:9"  // "16:9", "9:16", "4:3", "1:1"
}

Fixed Ratio 모드

{
  "type": "fixedRatio",
  "ratioValue": "16:9",
  "width": 480  // 또는 height 지정
}

Custom 모드

{
  "type": "custom",
  "width": 480,
  "height": 270
}

기타

  • JavaScript 버전의 파일들은 유지됩니다.
  • 기존 DSL 파일과 호환됩니다.
  • 폰트는 fonts/ 디렉토리에 저장됩니다.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thumbnail_maker-0.1.9.tar.gz (11.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thumbnail_maker-0.1.9-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file thumbnail_maker-0.1.9.tar.gz.

File metadata

  • Download URL: thumbnail_maker-0.1.9.tar.gz
  • Upload date:
  • Size: 11.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for thumbnail_maker-0.1.9.tar.gz
Algorithm Hash digest
SHA256 f4146281f0cb8971e4610d3438903a0fe7b8d501f54110ee9b1b5e2c71062d66
MD5 1f9f62eb53f2d80116c572d2ced8a5ee
BLAKE2b-256 4882d810b82c132b1a80758ccd29f11fe2f1dcfb0de8d75e456d29d3729ecab6

See more details on using hashes here.

File details

Details for the file thumbnail_maker-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for thumbnail_maker-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b38ec45b448e47853f82132d9c577bec1cd1f74a0c2f613949446ee6bde8a19e
MD5 f718a789d9ea83afb37ec25f6e78ac36
BLAKE2b-256 5e47d0f2826b20233437406643c2266c71795504b77ad656b22a6054e4fafe80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page