C.W.K.
Stream
Lesson 04 of 07 · published

GIF 만들기 — High-Quality, 작은 파일

~10 min · gif, palette, share

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

GIF 가 까다로운 이유

GIF 가 palette 당 256 color 만 지원. Default GIF encoding 이 color 를 naively 픽 + ugly banding 만들어. palettegen + paletteuse two-step 이 clip 별 optimal palette 생성 + 적용 — 차이가 dramatic.

Code

High-quality GIF (right way)·bash
# Step 1 — optimal palette 생성
ffmpeg -i in.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,palettegen=stats_mode=diff" \
  -y palette.png

# Step 2 — palette 사용해서 encode
ffmpeg -i in.mp4 -i palette.png \
  -lavfi "fps=15,scale=480:-1:flags=lanczos[v];[v][1:v]paletteuse=dither=bayer:bayer_scale=5" \
  -y out.gif

# 또는 한 명령에 둘 다
ffmpeg -i in.mp4 \
  -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=bayer:bayer_scale=5" \
  -y one_pass.gif
한 shot 에 trim + GIF·bash
# 00:01:30 시작 5초 clip
ffmpeg -ss 00:01:30 -t 5 -i in.mp4 \
  -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \
  -y meme.gif

External links

Exercise

5초 clip 잡아. GIF 셋 만들어: (a) default ffmpeg -i in.mp4 out.gif, (b) palettegen+paletteuse two-pass, (c) 같은 거 + bayer_scale=3. 파일 사이즈 + quality 비교. 그 다음 같은 clip 을 작은 WebP loop 와 MP4 변환 — 그 거 대신 GIF ship 할 때는 언제?

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.