썸네일 생성 도구 - Pillow와 PySide6 기반
Project description
썸네일 생성기 (Python)
JavaScript 기반 썸네일 생성기를 Python으로 변환한 프로젝트입니다.
주요 변경사항
- Pillow: 이미지 생성 라이브러리로 사용
- PySide6: GUI 프레임워크로 사용
- Python: 모든 코드를 Python으로 변환
설치 및 실행
uv로 의존성 설치:
uv sync
단일 엔트리포인트(서브명령 방식):
uv run thumbnail_maker --help
1) GUI 실행 (추천)
uv run thumbnail_maker gui
기능:
- 제목/부제목 폰트: 웹폰트 URL 또는 로컬 폰트 파일 선택
- DSL 보기/저장: 현재 설정을
thumbnail.json으로 저장 - 패키지 저장(.thl):
thumbnail.json+fonts/(TTF/OTF) 묶음으로 저장
2) DSL 렌더 (generate-thumbnail)
uv run thumbnail_maker generate-thumbnail thumbnail.json -o out.png
또는 패키지(.thl)로부터 렌더:
uv run thumbnail_maker generate-thumbnail my_pack.thl -o out.png
3) 간편 렌더 (genthumb)
# 제목/부제목 덮어쓰기 (리터럴 \n 또는 실제 줄바꿈 지원)
uv run thumbnail_maker genthumb -o out.png \
--title "이것이 블로그다.\n파워블로그를 위한" \
--subtitle "블로그하는\n\n 법 꿀팁모음" \
my_thumb.json
# 패키지(.thl) 입력도 동일하게 지원
uv run thumbnail_maker genthumb -o out.png my_pack.thl
주요 파일/구성
thumbnail_maker/
├── thumbnail_maker/
│ ├── __main__.py # 단일 엔트리포인트 (gui, generate-thumbnail, genthumb)
│ ├── gui.py # PySide6 GUI
│ ├── cli.py # CLI 로직(패키지 해제 포함)
│ └── renderer.py # Pillow 기반 렌더러 (폰트 다운로드/변환/폴백)
├── thumbnail.json # DSL 예제
└── fonts/ # 변환/다운로드된 TTF/OTF 저장 위치
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/패키지(.thl) 모두 지원합니다.
- 폰트는 자동 다운로드/변환되어
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.3.tar.gz
(11.8 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thumbnail_maker-0.1.3.tar.gz.
File metadata
- Download URL: thumbnail_maker-0.1.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
838c2206716b875a266808a25d8ddcc9e819be7f420402fb16e19c063535b173
|
|
| MD5 |
7fb3fd9fe3abf60a03e1561cbb7f39be
|
|
| BLAKE2b-256 |
5f5be0fc1251f6ae3c8f8a2d036e182bf3d076aa9c1f82c19d3f2a653bbf1013
|
File details
Details for the file thumbnail_maker-0.1.3-py3-none-any.whl.
File metadata
- Download URL: thumbnail_maker-0.1.3-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a0c204217aeca372d2e1c15fa894f2071d7627c4ea6642e79ee7adfcb6b2563
|
|
| MD5 |
868f39e85e2d01749c0ebbddbaa42217
|
|
| BLAKE2b-256 |
abd5bd05a4549cf0d2c69d872aca9c23337d8578b29489fefef1f30ed9be0efc
|