Community图像github.com

getedgehq/linkedin-media-prep

转换、裁剪、调整大小并压缩图像和视频,使其符合 LinkedIn 的最佳上传质量与文件大小要求。当用户需要为 LinkedIn 准备照片、图像或视频时使用。

linkedin-media-prep 是什么?

该技能为 Claude Code 或类似 AI 智能体提供了一套完整的工具和流程,用于准备任何符合 LinkedIn 媒体规范(图片与视频)的文件。其主要功能包括自动或分步指导用户进行格式转换(如 HEIC/RAW/PNG 转 JPEG,MOV 转 MP4)、按 LinkedIn 各类尺寸要求(头像、封面、帖子图片、视频等)进行裁剪和缩放,以及控制文件大小以优化上传速度。该技能支持 macOS 环境,依赖 ImageMagick(magick)处理图片,FFmpeg(ffmpeg/ffprobe)处理视频,并明确提供了所有关键命令行示例。无论是将手机拍摄的竖屏视频转为方形帖子,还是将 RAW 照片压缩为 1MB 以内的封面图,技能都能通过迭代式用户交互(如调整裁剪区域)确保最终输出完美符合 LinkedIn 平台要求。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/getedgehq/skills/tree/main/linkedin-media-prep

Installed? Explore more 图像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

LinkedIn 媒体预处理

为 LinkedIn 准备任何图像或视频,确保正确的尺寸、裁剪和压缩。


图片规格

用途尺寸比例备注
帖子(竖版,最大信息流空间)1080 × 13504:5照片的默认选择
帖子(横版)1200 × 6271.91:1适合横幅、截图
帖子(方形)1080 × 10801:1安全的通用选择
帖子(4:3)1440 × 10804:3适合相机原生照片
个人资料照片最小 400 × 4001:1建议 800 × 800
封面照片1584 × 3964:1
文章特色图1200 × 6271.91:1
最大文件大小8 MB—目标 < 1 MB 以实现快速上传
格式JPEG, PNG, GIF—照片优先推荐 JPEG

视频规格

用途尺寸比例备注
帖子(方形)1080 × 10801:1安全的通用选择
帖子(横版)1920 × 108016:9标准信息流视频
帖子(竖版)1080 × 19209:16移动端/Reels 风格;若源素材非 9:16 则需填充
最大文件大小5 GB—目标 < 200 MB 以实现快速上传
最大时长30 分钟—最短 3 秒
格式MP4 (H.264 + AAC)—MP4 为最佳兼容性要求
帧率30 fps—匹配源素材或统一为 30 fps
像素格式yuv420p—满足广泛播放支持的要求

图片工作流程

1. 检查源文件

sips -g pixelWidth -g pixelHeight "<input>"
ls -lh "<input>"

2. 修正 EXIF 方向(如有必要)

iPhone 和手机照片通常通过 EXIF 方向标签存储竖屏图像,而非旋转像素。ImageMagick 通常会自动处理,但如果转换后图像仍显示为侧向,可在裁剪前强制将其扶正。

magick "<input>" -auto-orient "<input>-upright.png"

将扶正后的版本作为裁剪用的工作副本。

3. 转换为可编辑格式

如果源文件是 HEIC 或其他非 PNG 格式:

sips -s format png "<input>" --out "<input>.png"

将 PNG 作为裁剪用的工作副本。

4. 裁剪(与用户迭代进行)

首次裁剪: 居中,根据目标比例选择尺寸。

对于竖屏照片转为 4:5 竖版帖子:

  • 裁剪宽度 = 图像的完整宽度
  • 裁剪高度 = 宽度 × 5 / 4
  • Y 偏移 = (原始高度 − 裁剪高度) / 2

以 3024 × 4032 的源文件为例:

magick "source.png" -crop 3024x3780+0+126 "cropped.png"

迭代调整:

  • “更放大” → 减小裁剪 W×H(例如 2000×2500 代替 3024×3780)。保持相同比例。
  • “顶部空间太多” → 增加 Y 偏移(将裁剪区域下移)。
  • “底部空间太多” → 减小 Y 偏移(将裁剪区域上移)。
  • “需要更宽/更窄” → 调整 W 和 H,保持比例不变。

裁剪公式:

magick "source.png" -crop <W>x<H>+<X>+<Y> "cropped.png"
# X = (原始宽度 − W) / 2  (居中)
# Y = 根据主体位置调整

5. 调整大小并压缩以便上传 LinkedIn

magick "cropped.png" -resize 1080x1350 -quality 85 "<name>-linkedin.jpg"

对于个人资料照片:

magick "cropped.png" -resize 800x800 -quality 85 "<name>-linkedin-profile.jpg"

对于封面照片:

magick "cropped.png" -resize 1584x396 -quality 85 "<name>-linkedin-cover.jpg"

对于 4:3 比例的帖子:

magick "source.png" -resize 1440x1080 -quality 85 "<name>-linkedin-4by3.jpg"

6. 验证输出

ls -lh "<output>.jpg"
sips -g pixelWidth -g pixelHeight "<output>.jpg"

确保:

  • 尺寸符合目标
  • 文件大小 < 8 MB(最好 < 1 MB)
  • 质量可接受

应选择哪种视频格式?

源素材方向你的目标推荐目标格式
竖屏(手机视频)最大化移动端信息流空间竖版 1080×1920(若源素材为 3:4 或 4:5,则填充黑色边)
竖屏(手机视频)安全的通用兼容性方形 1080×1080(居中裁剪)
横屏(录屏、摄像机)标准信息流视频横版 1920×1080
横屏安全的通用兼容性方形 1080×1080(居中裁剪)
不确定—方形 1080×1080

经验法则: 方形适用于所有场景。竖版在移动端可获得最大的屏幕空间,但在桌面端可能出现黑边。横版最适合演示、采访和电影感内容。


视频工作流程

1. 检查源文件

ffprobe -v error -select_streams v:0 \
  -show_entries stream=width,height,avg_frame_rate,duration,bit_rate \
  -show_entries format=duration,size,bit_rate \
  -of csv=p=0 "<input>"

同时检查旋转元数据:

ffprobe -v error -select_streams v:0 -show_entries stream_side_data=display_matrix \
  -of default=nk=1:nw=1 "<input>"

2. 处理旋转(iPhone / 手机源素材)

手机视频通常以横屏存储帧,并附带旋转标签。在裁剪/缩放之前,在滤镜链中应用 transpose。

显示矩阵Transpose 值含义
-90° (270°)1顺时针 90°
+90°2逆时针 90°
180°3180°
无旋转省略—

3. 选择目标并构建滤镜链

方形 (1080×1080) — 旋转后居中裁剪:

transpose=1,crop=1080:1080:(in_w-1080)/2:(in_h-1080)/2,format=yuv420p

横版 (1920×1080) — 缩放到适配后填充,或居中裁剪:

transpose=1,scale=1920:-2,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:black,format=yuv420p

竖版 (1080×1920) — 按宽度缩放后上下填充:

transpose=1,scale=1080:-2,pad=1080:1920:(ow-iw)/2:(oh-ih)/2:black,format=yuv420p

如果源素材宽高比已与目标一致,可以省略 pad,直接使用 scale=1080:1080 或 scale=1920:1080。

4. 常见的一行命令(竖屏 iPhone → 方形)

最常见的需求:将竖屏 iPhone 视频转换为 LinkedIn 适用的方形 MP4。

ffmpeg -y -i "IMG_xxxx.MOV" \
  -vf "transpose=1,crop=1080:1080:(in_w-1080)/2:(in_h-1080)/2,format=yuv420p" \
  -c:v libx264 -profile:v main -level 4.2 -preset medium -crf 23 -r 30 \
  -c:a aac -b:a 128k -movflags +faststart \
  "output_linkedin_square.mp4"

根据第 2 步的旋转值替换 transpose=1,如果源素材没有旋转元数据,则省略 transpose=1,。

5. 转码

ffmpeg -y -i "<input>" \
  -vf "<filter_chain>" \
  -c:v libx264 -profile:v main -level 4.2 -preset medium -crf 23 -r 30 \
  -c:a aac -b:a 128k \
  -movflags +faststart \
  "<output>.mp4"

参数说明:

  • -profile:v main -level 4.2 — 广泛的设备兼容性
  • -crf 23 — 良好的质量/大小平衡(数值越低质量越高)
  • -r 30 — 统一帧率
  • -movflags +faststart — 将 moov atom 置于文件开头,便于网络流式播放

6. 验证输出

ls -lh "<output>.mp4"
ffprobe -v error -select_streams v:0 \
  -show_entries stream=width,height,avg_frame_rate,duration,bit_rate \
  -show_entries format=duration,size,bit_rate \
  -of csv=p=0 "<output>.mp4"

确保:

  • 尺寸符合目标
  • 文件大小适合上传(理想 < 200 MB)
  • 不存在旋转元数据(播放器不应再次旋转)

工具

  • 图片: 优先使用 magick(ImageMagick 7)或 convert(ImageMagick 6)。在 macOS 上可回退到 sips 进行基本格式转换。通过 brew install imagemagick 安装。
  • 视频: ffmpeg + ffprobe。通过 brew install ffmpeg 安装。

Individual skills in this repo

This repo contains 18 individual skills — each has its own dedicated page.

getedgehq/agent-evals

Build evals for an AI agent that already does real work. Use when someone asks "how do I know my agent is right", wants to test an agent before trusting it, compare models on cost versus quality, or turn production failures into tests. Walks from first tasks and yes/no verifiers, to isolated environments, to a trace-driven improvement loop.

getedgehq/cli-ux-review

Audit a command-line tool for user-friendliness — clear situation / next-step / options in every output, colour-highlighted runnable commands, no raw jargon, no silent hangs. Invoke for "CLI UX audit", "review my CLI", "is this CLI intuitive", or before any CLI release.

getedgehq/generate-image

Generate images with OpenAI GPT Image 2 via the Codex CLI, billed through the user's ChatGPT Plus subscription (no OpenAI API key, no per-image API cost). Use when the user asks to create, generate, or make an image, picture, illustration, icon, hero graphic, or concept art from a text prompt.

getedgehq/harness-first

Diagnose and fix an unreliable, expensive, or unsafe LLM agent by auditing its harness (golden set, judge, cost caps, data layer, action approvals, tracing) before blaming or swapping the model. Use when someone says an agent is "burning tokens", "hallucinating", "brittle", gives inconsistent answers, asks whether to switch to a cheaper/better model, or wants to ship an agent or prompt change to customers.

getedgehq/http-error-triage

Run before concluding anything from an HTTP error on a third-party API. Separates a real credential/entitlement problem from a CDN or WAF block, a wrong endpoint, or a client-signature ban. Use whenever an API returns 401/403/402/429 and you are about to say "the key is dead", "credits are exhausted", "the plan lacks access", or "we are rate limited".

getedgehq/monid

>-

getedgehq/opendraft

An 18-agent pipeline that turns one topic line into a drafted

getedgehq/people-search

Find and rank professional people for recruiting, partnerships, sales, or research from user-provided data, public web sources, an authenticated search session, or a connected provider. Use for people discovery, LinkedIn or Sales Navigator search design, profile-list ranking, or provider filter translation.

getedgehq/rocketlist

Turn a CV into a shortlist of live startup roles from Rocketlist's public job board, including adjacent job titles the person would never have searched for, each with its published salary, the evidence for the fit, and a direct apply link. Use for "find roles I would be a strong fit for", career pivots, remote or VC-backed job hunts, and salary-visible role discovery.

getedgehq/security-audit-checklist

Run a comprehensive security audit across application code, cloud infrastructure, containers, CI/CD pipelines, and infrastructure-as-code. Covers privacy compliance, OWASP basics, secret leakage, API security, IAM misconfigurations, storage exposure, Kubernetes hardening, and network security. Use when the user asks to audit, review, or harden app or cloud security, check for secrets, scan for XSS/SQLi, verify security headers, review Terraform/CloudFormation, audit AWS/GCP/Azure configs, or perform any security-focused review.

getedgehq/shadcn-first

>-

getedgehq/skills

Develop or review a branded long-form YouTube channel using Simon Kaiser's public creator-led approach: audience fit, recurring formats, natural brand integration, Time with Brand, and an organic, paid, and Shorts strategy. Use for channel strategy, format briefs, and pilots.

getedgehq/skills

Build a YouTube strategy, evidence-backed idea slate, and title plus thumbnail package using Paddy Galloway's public method. Use when planning a channel, choosing concepts, or preparing a video before filming.

getedgehq/skills

Build or review a buyer-centered strategic narrative using Andy Raskin's public method. Use for sales or investor deck stories, homepage positioning, keynotes, launch narratives, and why-now messaging.

getedgehq/skills

Turn a product URL, launch brief, or approved script into a production-ready launch video. Use for product reveals, feature announcements, SaaS launches, and narrated product films; not for generic explainers or editing existing footage.

getedgehq/strip-image-ai-metadata

Strip C2PA and AI-generation metadata from images (PNG, JPEG, WebP) to remove "Generated by AI" / "ChatGPT" / "DALL-E" labels that platforms like LinkedIn, Instagram, and X display. Use when the user wants to clean AI-generated images before posting, remove AI attribution from photos, strip C2PA manifests, sanitize image metadata for professional use, or verify whether an image contains C2PA data.

getedgehq/top-down-comms

>-

getedgehq/workplan

Create, update, or close work plans for multi-step tasks. Use when starting refactors, bug lists, feature work, migrations, or any task with 2+ steps. Also use after auto-compaction to re-orient. Triggers: "workplan", "work plan", "create a plan", "what's the plan", "where was I", or when Claude detects

相关技能