gimp-inkscape

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GIMP + Inkscape + ImageMagick Image Skill

GIMP + Inkscape + ImageMagick 图像处理技能

Local image creation and manipulation. No API calls, no cost, no internet required.
本地图像创建与处理。无需调用API,无成本,无需联网。

Decision Guide — Pick the Right Tool

决策指南——选择合适的工具

TaskUseNotes
Simple resizeImageMagick10× faster than GIMP, one liner
Batch resize folderImageMagick mogrifyPurpose-built for batch
SVG → PNGInkscapeVector quality, exact dimensions
Text overlay / watermarkImageMagickReliable; GIMP Script-Fu text is flaky
Complex typographyInkscape SVGPixel-perfect vector text
Format conversionImageMagickOne liner, handles WebP too
Compositing / layersGIMPFull layer control
Color correctionGIMPCurves/levels more precise than IM
PNG compressionOptiPNGLossless, 20–50% savings
JPEG compressionjpegoptimLossless recompression
Metadata read/stripExifToolThe industry standard
GIF / animationFFmpegNothing else handles this
PDF → imagepdftoppmClean, DPI-controllable
Photo editing (advanced)GIMPHealing, clone stamp, curves
任务使用工具说明
简单调整大小ImageMagick比GIMP快10倍,单行命令即可完成
批量调整文件夹内图片大小ImageMagick mogrify专为批量处理设计
SVG → PNGInkscape矢量画质,精确尺寸
文本叠加 / 水印ImageMagick可靠;GIMP Script-Fu文本功能不稳定
复杂排版Inkscape SVG像素级精准的矢量文本
格式转换ImageMagick单行命令,支持WebP格式
图像合成 / 图层处理GIMP完整的图层控制
色彩校正GIMP曲线/色阶比ImageMagick更精准
PNG压缩OptiPNG无损压缩,可节省20–50%空间
JPEG压缩jpegoptim无损重新压缩
元数据读取/清除ExifTool行业标准工具
GIF / 动画制作FFmpeg其他工具无法替代
PDF → 图像pdftoppm输出清晰,可控制DPI
高级照片编辑GIMP修复、仿制图章、曲线调整等功能

Optional installs for two specific tasks

两项特定任务的可选安装

  • Background removal:
    pip install rembg
    then
    rembg i input.png output.png
  • AI upscaling: Real-ESRGAN — significant quality boost over interpolation upscaling

  • 背景移除
    pip install rembg
    然后执行
    rembg i input.png output.png
  • AI图像放大Real-ESRGAN — 比插值放大的画质提升显著

ImageMagick — CLI Reference

ImageMagick — CLI 参考

Format conversion

格式转换

bash
convert input.png output.jpg
convert input.jpg output.webp
convert input.png -quality 92 output.jpg
bash
convert input.png output.jpg
convert input.jpg output.webp
convert input.png -quality 92 output.jpg

Resize

调整大小

bash
undefined
bash
undefined

Exact dimensions (may distort)

精确尺寸(可能会变形)

convert input.jpg -resize 1200x630! output.jpg
convert input.jpg -resize 1200x630! output.jpg

Fit within box (preserves aspect ratio)

适配指定尺寸框(保持宽高比)

convert input.jpg -resize 1200x630 output.jpg
convert input.jpg -resize 1200x630 output.jpg

Fill and crop to exact dimensions (centered)

填充并裁剪至精确尺寸(居中)

convert input.jpg -resize 1200x630^ -gravity Center -extent 1200x630 output.jpg
undefined
convert input.jpg -resize 1200x630^ -gravity Center -extent 1200x630 output.jpg
undefined

Batch resize entire folder (mogrify)

批量调整整个文件夹内图片大小(mogrify)

bash
undefined
bash
undefined

Resize all JPEGs in place

原地调整所有JPEG图片大小

mogrify -resize 800x600 /path/to/folder/*.jpg
mogrify -resize 800x600 /path/to/folder/*.jpg

Resize and output to a different folder

调整大小并输出到另一个文件夹

mogrify -resize 800x600 -path /output/folder /input/folder/*.jpg
mogrify -resize 800x600 -path /output/folder /input/folder/*.jpg

Convert all PNGs to WebP

将所有PNG转换为WebP格式

mogrify -format webp /path/to/folder/*.png
undefined
mogrify -format webp /path/to/folder/*.png
undefined

Text overlay / watermark

文本叠加 / 水印

bash
undefined
bash
undefined

Simple text in bottom-right corner

右下角添加简单文本

convert input.jpg
-font DejaVu-Sans -pointsize 36
-fill white -annotate +20+40 "© ReshareAI"
output.jpg
convert input.jpg
-font DejaVu-Sans -pointsize 36
-fill white -annotate +20+40 "© ReshareAI"
output.jpg

Centered text with shadow

居中带阴影文本

convert input.jpg
-font DejaVu-Sans-Bold -pointsize 72
-fill black -annotate +202+302 "Headline"
-fill white -annotate +200+300 "Headline"
output.jpg
convert input.jpg
-font DejaVu-Sans-Bold -pointsize 72
-fill black -annotate +202+302 "Headline"
-fill white -annotate +200+300 "Headline"
output.jpg

Semi-transparent watermark tiled across image

半透明水印平铺整个图像

convert input.jpg
-font DejaVu-Sans -pointsize 48 -fill "rgba(255,255,255,0.3)"
-gravity Center -annotate 30x30+0+0 "WATERMARK"
output.jpg
undefined
convert input.jpg
-font DejaVu-Sans -pointsize 48 -fill "rgba(255,255,255,0.3)"
-gravity Center -annotate 30x30+0+0 "WATERMARK"
output.jpg
undefined

Composite: place logo/image on top

图像合成:将徽标/图片叠加在上方

bash
undefined
bash
undefined

Place logo.png bottom-right with 10px padding

将logo.png放在右下角,保留10px边距

convert base.jpg
logo.png
-gravity SouthEast -geometry +10+10
-composite output.jpg
convert base.jpg
logo.png
-gravity SouthEast -geometry +10+10
-composite output.jpg

Place with opacity

带透明度的叠加

convert base.jpg
( logo.png -alpha set -channel Alpha -evaluate multiply 0.5 )
-gravity Center -composite output.jpg
undefined
convert base.jpg
( logo.png -alpha set -channel Alpha -evaluate multiply 0.5 )
-gravity Center -composite output.jpg
undefined

Color adjustments

色彩调整

bash
undefined
bash
undefined

Brightness / contrast

亮度 / 对比度

convert input.jpg -brightness-contrast 10x20 output.jpg
convert input.jpg -brightness-contrast 10x20 output.jpg

Saturation

饱和度

convert input.jpg -modulate 100,130,100 output.jpg
convert input.jpg -modulate 100,130,100 output.jpg

Grayscale

灰度化

convert input.jpg -colorspace Gray output.jpg
convert input.jpg -colorspace Gray output.jpg

Sharpen

锐化

convert input.jpg -unsharp 0x1 output.jpg
undefined
convert input.jpg -unsharp 0x1 output.jpg
undefined

Get image info

获取图像信息

bash
identify input.jpg
identify -verbose input.jpg | grep -E "Geometry|Colorspace|Format|filesize"

bash
identify input.jpg
identify -verbose input.jpg | grep -E "Geometry|Colorspace|Format|filesize"

ImageMagick — WebP

ImageMagick — WebP 处理

ImageMagick has the WebP delegate built in (confirmed on this system):
bash
undefined
当前系统已内置ImageMagick的WebP处理插件:
bash
undefined

PNG/JPEG → WebP

PNG/JPEG → WebP

convert input.png -quality 85 output.webp
convert input.png -quality 85 output.webp

WebP → PNG

WebP → PNG

convert input.webp output.png
convert input.webp output.png

Batch convert all JPEGs to WebP

批量将所有JPEG转换为WebP

mogrify -format webp -quality 85 /path/to/folder/*.jpg

---
mogrify -format webp -quality 85 /path/to/folder/*.jpg

---

FFmpeg — GIF & Animation

FFmpeg — GIF & 动画制作

Video → GIF

视频 → GIF

bash
undefined
bash
undefined

Basic

基础转换

ffmpeg -i input.mp4 -vf "fps=10,scale=800:-1" output.gif
ffmpeg -i input.mp4 -vf "fps=10,scale=800:-1" output.gif

High quality (uses palette)

高质量转换(使用调色板)

ffmpeg -i input.mp4 -vf "fps=12,scale=800:-1:flags=lanczos,palettegen" palette.png ffmpeg -i input.mp4 -i palette.png -vf "fps=12,scale=800:-1:flags=lanczos,paletteuse" output.gif
ffmpeg -i input.mp4 -vf "fps=12,scale=800:-1:flags=lanczos,palettegen" palette.png ffmpeg -i input.mp4 -i palette.png -vf "fps=12,scale=800:-1:flags=lanczos,paletteuse" output.gif

Clip a section (start 5s, duration 3s)

截取片段(从第5秒开始,时长3秒)

ffmpeg -ss 5 -t 3 -i input.mp4 -vf "fps=10,scale=600:-1" output.gif
undefined
ffmpeg -ss 5 -t 3 -i input.mp4 -vf "fps=10,scale=600:-1" output.gif
undefined

Extract frames from video

从视频提取帧

bash
undefined
bash
undefined

Extract every frame as PNG

提取所有帧为PNG

ffmpeg -i input.mp4 /output/frame_%04d.png
ffmpeg -i input.mp4 /output/frame_%04d.png

Extract 1 frame per second

每秒提取1帧

ffmpeg -i input.mp4 -vf fps=1 /output/frame_%04d.png
ffmpeg -i input.mp4 -vf fps=1 /output/frame_%04d.png

Extract a single frame at timestamp

在指定时间戳提取单帧

ffmpeg -ss 00:00:05 -i input.mp4 -frames:v 1 output.png
undefined
ffmpeg -ss 00:00:05 -i input.mp4 -frames:v 1 output.png
undefined

Image sequence → video or GIF

图像序列 → 视频或GIF

bash
undefined
bash
undefined

Frames → MP4

帧序列 → MP4

ffmpeg -framerate 24 -i frame_%04d.png -c:v libx264 output.mp4
ffmpeg -framerate 24 -i frame_%04d.png -c:v libx264 output.mp4

Frames → GIF

帧序列 → GIF

ffmpeg -framerate 10 -i frame_%04d.png output.gif

---
ffmpeg -framerate 10 -i frame_%04d.png output.gif

---

ExifTool — Metadata

ExifTool — 元数据处理

Read metadata

读取元数据

bash
exiftool input.jpg
exiftool -s input.jpg                          # short tag names
exiftool -ImageSize -DateTimeOriginal input.jpg  # specific fields
bash
exiftool input.jpg
exiftool -s input.jpg                          # 短标签名称
exiftool -ImageSize -DateTimeOriginal input.jpg  # 指定字段

Strip all metadata (privacy / pre-publish)

清除所有元数据(隐私保护 / 发布前处理)

bash
exiftool -all= input.jpg                       # strips in place (saves backup)
exiftool -all= -overwrite_original input.jpg   # no backup
exiftool -all= -overwrite_original /folder/*.jpg  # batch strip
bash
exiftool -all= input.jpg                       # 原地清除(保存备份)
exiftool -all= -overwrite_original input.jpg   # 不保存备份
exiftool -all= -overwrite_original /folder/*.jpg  # 批量清除

Copy EXIF from one file to another

复制元数据到另一个文件

bash
exiftool -TagsFromFile source.jpg target.jpg
bash
exiftool -TagsFromFile source.jpg target.jpg

Write metadata

写入元数据

bash
exiftool -Artist="Ramon" -Copyright="© 2026 ReshareAI" input.jpg
exiftool -all= -overwrite_original -Artist="Ramon" /folder/*.jpg

bash
exiftool -Artist="Ramon" -Copyright="© 2026 ReshareAI" input.jpg
exiftool -all= -overwrite_original -Artist="Ramon" /folder/*.jpg

OptiPNG — Lossless PNG Compression

OptiPNG — 无损PNG压缩

bash
undefined
bash
undefined

Optimize (overwrites in place, creates backup .bak)

优化(原地覆盖,创建.bak备份)

optipng input.png
optipng input.png

No backup

不创建备份

optipng -o 7 input.png # -o 7 is max compression (slower)
optipng -o 7 input.png # -o 7为最高压缩比(速度较慢)

Output to new file

输出到新文件

optipng -out output.png input.png
optipng -out output.png input.png

Batch

批量处理

optipng /path/to/folder/*.png
optipng /path/to/folder/*.png

Check savings without writing

模拟压缩查看节省空间情况,不实际写入

optipng -simulate input.png

Typical savings: 20–50% file size reduction with zero quality loss.

---
optipng -simulate input.png

通常可节省20–50%的文件大小,且画质无损失。

---

jpegoptim — Lossless JPEG Compression

jpegoptim — 无损JPEG压缩

bash
undefined
bash
undefined

Lossless optimization (in place)

无损优化(原地处理)

jpegoptim input.jpg
jpegoptim input.jpg

With target file size

指定目标文件大小

jpegoptim --size=200k input.jpg
jpegoptim --size=200k input.jpg

Strip all metadata + optimize

清除所有元数据并优化

jpegoptim --strip-all input.jpg
jpegoptim --strip-all input.jpg

Batch (folder)

批量处理文件夹

jpegoptim /path/to/folder/*.jpg
jpegoptim /path/to/folder/*.jpg

Batch with max quality floor

批量处理并设置最低画质

jpegoptim --max=90 /path/to/folder/*.jpg

---
jpegoptim --max=90 /path/to/folder/*.jpg

---

Poppler — PDF → Image

Poppler — PDF → 图像

bash
undefined
bash
undefined

All pages → PNG at 150 DPI (output: file-000001.png, file-000002.png ...)

所有页面转换为150 DPI的PNG(输出:file-000001.png, file-000002.png ...)

pdftoppm -r 150 -png input.pdf /output/page
pdftoppm -r 150 -png input.pdf /output/page

All pages → JPEG

所有页面转换为JPEG

pdftoppm -r 150 -jpeg input.pdf /output/page
pdftoppm -r 150 -jpeg input.pdf /output/page

Single page (page 1 only)

单页转换(仅第1页)

pdftoppm -r 300 -png -f 1 -l 1 input.pdf /output/page
pdftoppm -r 300 -png -f 1 -l 1 input.pdf /output/page

High DPI for print-quality extraction

高DPI提取(印刷级画质)

pdftoppm -r 300 -png input.pdf /output/page

---
pdftoppm -r 300 -png input.pdf /output/page

---

Inkscape — CLI Reference

Inkscape — CLI 参考

SVG → PNG export (exact dimensions)

SVG → PNG导出(精确尺寸)

bash
inkscape input.svg \
  --export-type=png \
  --export-filename=output.png \
  --export-width=1200 \
  --export-height=630
bash
inkscape input.svg \
  --export-type=png \
  --export-filename=output.png \
  --export-width=1200 \
  --export-height=630

Export specific layer

导出指定图层

bash
inkscape input.svg \
  --export-type=png \
  --export-filename=output.png \
  --export-id=layer1 \
  --export-id-only
bash
inkscape input.svg \
  --export-type=png \
  --export-filename=output.png \
  --export-id=layer1 \
  --export-id-only

SVG → PDF

SVG → PDF

bash
inkscape input.svg --export-type=pdf --export-filename=output.pdf
bash
inkscape input.svg --export-type=pdf --export-filename=output.pdf

Create SVG from scratch (write file, then export)

从头创建SVG(先写入文件,再导出)

Write a
.svg
file using the Write tool, then export with Inkscape. SVG template:
xml
<?xml version="1.0" encoding="UTF-8"?>
<svg width="1200" height="630" viewBox="0 0 1200 630"
     xmlns="http://www.w3.org/2000/svg">

  <defs>
    <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="0%" style="stop-color:#4C1D95"/>
      <stop offset="100%" style="stop-color:#1E1B4B"/>
    </linearGradient>
  </defs>

  <rect width="1200" height="630" fill="url(#bg)"/>

  <!-- Text renders perfectly — no hallucination like GIMP/FLUX -->
  <text x="100" y="280"
        font-family="Inter, Arial, sans-serif"
        font-size="96" font-weight="700"
        fill="white">BrandName</text>

  <text x="100" y="360"
        font-family="Inter, Arial, sans-serif"
        font-size="32" fill="rgba(255,255,255,0.7)">Tagline goes here</text>

</svg>

使用写入工具创建
.svg
文件,然后用Inkscape导出。SVG模板:
xml
<?xml version="1.0" encoding="UTF-8"?>
<svg width="1200" height="630" viewBox="0 0 1200 630"
     xmlns="http://www.w3.org/2000/svg">

  <defs>
    <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="0%" style="stop-color:#4C1D95"/>
      <stop offset="100%" style="stop-color:#1E1B4B"/>
    </linearGradient>
  </defs>

  <rect width="1200" height="630" fill="url(#bg)"/>

  <!-- 文本渲染完美 — 不会像GIMP/FLUX那样出现错误 -->
  <text x="100" y="280"
        font-family="Inter, Arial, sans-serif"
        font-size="96" font-weight="700"
        fill="white">BrandName</text>

  <text x="100" y="360"
        font-family="Inter, Arial, sans-serif"
        font-size="32" fill="rgba(255,255,255,0.7)">Tagline goes here</text>

</svg>

GIMP — Script-Fu Batch Reference

GIMP — Script-Fu 批量处理参考

Use GIMP for: compositing, color correction, photo editing, alpha channel work. For simple tasks prefer ImageMagick.
GIMP适用于:图像合成、色彩校正、照片编辑、Alpha通道处理。简单任务优先选择ImageMagick。

Resize to exact dimensions

调整至精确尺寸

bash
gimp --no-interface --batch '(let* (
  (image (car (gimp-file-load RUN-NONINTERACTIVE "/path/input.png" "input.png")))
  (drawable (car (gimp-image-get-active-drawable image))))
  (gimp-image-scale-full image 1200 630 INTERPOLATION-LINEAR)
  (file-png-save RUN-NONINTERACTIVE image (car (gimp-image-get-active-drawable image))
    "/path/output.png" "output.png" 0 9 1 1 1 1 1))
(gimp-quit 0)'
bash
gimp --no-interface --batch '(let* (
  (image (car (gimp-file-load RUN-NONINTERACTIVE "/path/input.png" "input.png")))
  (drawable (car (gimp-image-get-active-drawable image))))
  (gimp-image-scale-full image 1200 630 INTERPOLATION-LINEAR)
  (file-png-save RUN-NONINTERACTIVE image (car (gimp-image-get-active-drawable image))
    "/path/output.png" "output.png" 0 9 1 1 1 1 1))
(gimp-quit 0)'

Scale then crop (fill mode — covers full canvas)

缩放后裁剪(填充模式 — 覆盖整个画布)

bash
gimp --no-interface --batch '(let* (
  (image (car (gimp-file-load RUN-NONINTERACTIVE "/path/input.jpg" "input.jpg")))
  (w (car (gimp-image-width image)))
  (h (car (gimp-image-height image)))
  (target-w 1200) (target-h 630)
  (scale (max (/ target-w w) (/ target-h h)))
  (new-w (inexact->exact (round (* w scale))))
  (new-h (inexact->exact (round (* h scale)))))
  (gimp-image-scale-full image new-w new-h INTERPOLATION-LINEAR)
  (gimp-image-crop image target-w target-h
    (/ (- new-w target-w) 2) (/ (- new-h target-h) 2))
  (file-png-save RUN-NONINTERACTIVE image (car (gimp-image-get-active-drawable image))
    "/path/output.png" "output.png" 0 9 1 1 1 1 1))
(gimp-quit 0)'
bash
gimp --no-interface --batch '(let* (
  (image (car (gimp-file-load RUN-NONINTERACTIVE "/path/input.jpg" "input.jpg")))
  (w (car (gimp-image-width image)))
  (h (car (gimp-image-height image)))
  (target-w 1200) (target-h 630)
  (scale (max (/ target-w w) (/ target-h h)))
  (new-w (inexact->exact (round (* w scale))))
  (new-h (inexact->exact (round (* h scale)))))
  (gimp-image-scale-full image new-w new-h INTERPOLATION-LINEAR)
  (gimp-image-crop image target-w target-h
    (/ (- new-w target-w) 2) (/ (- new-h target-h) 2))
  (file-png-save RUN-NONINTERACTIVE image (car (gimp-image-get-active-drawable image))
    "/path/output.png" "output.png" 0 9 1 1 1 1 1))
(gimp-quit 0)'

Add semi-transparent colour overlay

添加半透明颜色叠加层

bash
gimp --no-interface --batch '(let* (
  (image (car (gimp-file-load RUN-NONINTERACTIVE "/path/input.png" "input.png")))
  (overlay (car (gimp-layer-new image
    (car (gimp-image-width image))
    (car (gimp-image-height image))
    RGBA-IMAGE "overlay" 60 LAYER-MODE-NORMAL))))
  (gimp-image-insert-layer image overlay 0 -1)
  (gimp-context-set-foreground (list 0 0 0))
  (gimp-edit-fill overlay FILL-FOREGROUND)
  (file-png-save RUN-NONINTERACTIVE image (car (gimp-image-flatten image))
    "/path/output.png" "output.png" 0 9 1 1 1 1 1))
(gimp-quit 0)'
bash
gimp --no-interface --batch '(let* (
  (image (car (gimp-file-load RUN-NONINTERACTIVE "/path/input.png" "input.png")))
  (overlay (car (gimp-layer-new image
    (car (gimp-image-width image))
    (car (gimp-image-height image))
    RGBA-IMAGE "overlay" 60 LAYER-MODE-NORMAL))))
  (gimp-image-insert-layer image overlay 0 -1)
  (gimp-context-set-foreground (list 0 0 0))
  (gimp-edit-fill overlay FILL-FOREGROUND)
  (file-png-save RUN-NONINTERACTIVE image (car (gimp-image-flatten image))
    "/path/output.png" "output.png" 0 9 1 1 1 1 1))
(gimp-quit 0)'

Composite: place image B on top of image A

图像合成:将图像B叠加在图像A上方

bash
gimp --no-interface --batch '(let* (
  (base (car (gimp-file-load RUN-NONINTERACTIVE "/path/base.png" "base.png")))
  (overlay-img (car (gimp-file-load RUN-NONINTERACTIVE "/path/overlay.png" "overlay.png")))
  (overlay-layer (car (gimp-layer-new-from-drawable
    (car (gimp-image-get-active-drawable overlay-img)) base))))
  (gimp-image-insert-layer base overlay-layer 0 -1)
  (gimp-layer-set-offsets overlay-layer 50 50)
  (file-png-save RUN-NONINTERACTIVE base (car (gimp-image-flatten base))
    "/path/output.png" "output.png" 0 9 1 1 1 1 1))
(gimp-quit 0)'
bash
gimp --no-interface --batch '(let* (
  (base (car (gimp-file-load RUN-NONINTERACTIVE "/path/base.png" "base.png")))
  (overlay-img (car (gimp-file-load RUN-NONINTERACTIVE "/path/overlay.png" "overlay.png")))
  (overlay-layer (car (gimp-layer-new-from-drawable
    (car (gimp-image-get-active-drawable overlay-img)) base))))
  (gimp-image-insert-layer base overlay-layer 0 -1)
  (gimp-layer-set-offsets overlay-layer 50 50)
  (file-png-save RUN-NONINTERACTIVE base (car (gimp-image-flatten base))
    "/path/output.png" "output.png" 0 9 1 1 1 1 1))
(gimp-quit 0)'

Brightness / contrast / saturation

亮度 / 对比度 / 饱和度调整

bash
gimp --no-interface --batch '(let* (
  (image (car (gimp-file-load RUN-NONINTERACTIVE "/path/input.jpg" "input.jpg")))
  (drawable (car (gimp-image-get-active-drawable image))))
  (gimp-brightness-contrast drawable 20 30)
  (gimp-drawable-hue-saturation drawable HUE-RANGE-ALL 0 0 25 0)
  (file-jpeg-save RUN-NONINTERACTIVE image drawable
    "/path/output.jpg" "output.jpg" 0.92 0 0 0 "" 0 1 0 2 0))
(gimp-quit 0)'

bash
gimp --no-interface --batch '(let* (
  (image (car (gimp-file-load RUN-NONINTERACTIVE "/path/input.jpg" "input.jpg")))
  (drawable (car (gimp-image-get-active-drawable image))))
  (gimp-brightness-contrast drawable 20 30)
  (gimp-drawable-hue-saturation drawable HUE-RANGE-ALL 0 0 25 0)
  (file-jpeg-save RUN-NONINTERACTIVE image drawable
    "/path/output.jpg" "output.jpg" 0.92 0 0 0 "" 0 1 0 2 0))
(gimp-quit 0)'

Recommended Workflow: OG Image / Social Banner

推荐工作流:OG图像 / 社交横幅制作

  1. Write an SVG file (exact layout, text, colors) using the Write tool
  2. Export with Inkscape at target dimensions — text is pixel-perfect
  3. Optimize with OptiPNG before publishing
bash
undefined
  1. 编写SVG文件(精确布局、文本、颜色),使用写入工具完成
  2. 导出用Inkscape导出至目标尺寸 — 文本像素级精准
  3. 优化发布前用OptiPNG优化
bash
undefined

Step 1: write /tmp/card.svg

步骤1:写入/tmp/card.svg

Step 2: export

步骤2:导出

inkscape /tmp/card.svg
--export-type=png
--export-filename=/output/og.png
--export-width=1200
--export-height=630
inkscape /tmp/card.svg
--export-type=png
--export-filename=/output/og.png
--export-width=1200
--export-height=630

Step 3: optimize

步骤3:优化

optipng -o 5 /output/og.png

---
optipng -o 5 /output/og.png

---

Tips

小贴士

  • Text accuracy: Inkscape SVG > ImageMagick
    -annotate
    > GIMP Script-Fu (avoid for text)
  • Speed hierarchy: ImageMagick > GIMP for simple ops; GIMP wins for complex compositing
  • GIMP
    --no-interface
    — always end scripts with
    (gimp-quit 0)
  • Script-Fu paths must be absolute — no
    ~/
    shortcuts
  • GIMP opacity is 0–100 (integer), not 0.0–1.0
  • Inkscape 1.1 uses
    --export-type
    +
    --export-filename
    (older versions used
    --export-png
    )
  • ImageMagick
    !
    suffix
    on geometry forces exact dimensions ignoring aspect ratio (
    1200x630!
    )
  • 文本准确性:Inkscape SVG > ImageMagick
    -annotate
    > GIMP Script-Fu(避免用GIMP处理文本)
  • 速度优先级:简单操作ImageMagick比GIMP快;复杂合成GIMP更胜一筹
  • GIMP
    --no-interface
    — 脚本末尾必须添加
    (gimp-quit 0)
  • Script-Fu路径必须是绝对路径 — 不支持
    ~/
    快捷方式
  • GIMP透明度范围是0–100(整数),而非0.0–1.0
  • Inkscape 1.1使用
    --export-type
    +
    --export-filename
    (旧版本使用
    --export-png
  • ImageMagick尺寸参数后的
    !
    后缀
    强制使用精确尺寸,忽略宽高比(如
    1200x630!