基于 Pillow 的图像处理工具:缩放、裁剪、水印、格式转换与 Web 优化一次搞定。
设计与多媒体
resize-for-banner
试用Rescale an image into social banner versions using ImageMagick. The image is resized to fit and the leftover space is padded black — never cropped. Use when the user wants a banner, cover photo, or resized version for a social profile or article header. Never overwrites the original — creates new files beside it. Defaults to Twitter/X (5:2, 1500x600); other platforms available on request.
它能做什么
Rescale an image into social banner versions using ImageMagick. The image is resized to fit and the leftover space is padded black — never cropped. Use when the user wants a banner, cover photo, or resized version for a social profile or article header. Never overwrites the original — creates new files beside it. Defaults to Twitter/X (5:2, 1500x600); other platforms available on request.
技能文档
Resize for Banner
Turn one image into social banner variants with ImageMagick, keeping the original file untouched and writing new files beside it. The image is rescaled to fit and black-padded, never cropped, so no content is lost.
Platform specs
| Platform | Ratio | Dimensions | Notes |
|---|---|---|---|
| Twitter / X | 5:2 | 1500x600 | Header photo. Default. |
| LinkedIn article | 16:9 | 1200x675 | Article header. Usually unnecessary — generated infographics are already 16:9. |
| YouTube channel | 16:9 | 2560x1440 | Channel art; safe area is 1546x423 center. |
| Blog / generic | any | any WxH | Custom dimensions on request. |
If the user does not specify a platform, default to Twitter (1500x600).
Approval gate
- Never touch the original image. All output goes to new files named after the original (suffix added, base name unchanged).
- Confirm the plan with the user before converting: the source image, the target size(s), and the exact output filenames.
- If the user asks for a size the spec does not cover, use that size with the same resize + pad technique and say which platform it suits.
Inputs
source— Path to the original image, e.g.ai-thoughts/imgs/260806-1656.png. Required.sizes— Which banners to produce. Default: Twitter 1500x600. User may request any platform from the specs table or custom dimensions.
Outputs
imgs/-banner-.png— e.g.260806-1656-banner-twitter.png.- `` keeps the original filename exactly. The original file is never modified.
Procedure
-
Confirm the plan with the user: source image, target size(s), output filename(s). Get a go-ahead before writing files.
-
Check the original dimensions with
magick identify ""so you can predict which axis will be padded. -
Resize to fit, then pad with black with ImageMagick 7
magick:magick -resize "x" -background black -gravity center \ -extent x imgs/-banner-.png-resize "WxH"(no bang) scales to fit inside the box, preserving the aspect ratio — the image is never distorted or cropped.-extent WxHthen pads the leftover space;-background blackmakes the padding dark and-gravity centercenters the image.- If the source is taller/narrower than the target ratio, padding appears on the left and right; if it is wider, padding appears on top and bottom.
- Padding color is black by default; ask the user if they want a different background.
-
Verify every output with
identify— dimensions must match the target size exactly. -
Report the output paths and confirm the original is untouched (git status shows the new files as untracked, the original unmodified).
Quality rules
- Never overwrite or rename the source image.
- Never crop the image. Resize to fit and pad — cropping loses content.
- Do not invent dimensions. Use the platform specs table or the user's explicit dimensions.
Verification
identifyreports exactly the target dimensions for each output.- The source image inside the banner is undistorted (aspect ratio preserved).
- The original file is byte-identical (unchanged
identifyoutput / git status). - Output files sit beside the original in the same directory.
Error Handling
- Source not found: list candidate images in
imgs/and ask which to use. - Output already exists: stop and ask whether to overwrite, or choose a different suffix.
- No ImageMagick:
magickis always installed on the user's machines — skip checking for it and run the commands directly.
相关技能
Cloud-powered image compression and resize — compress JPG/PNG/WebP/HEIC to WebP/AVIF, resize images, batch process folders. No local dependencies, uses Tencent Cloud COS imageMogr2 via Pixmind API. Save 60-90% file size with scene presets (web, wechat, email, thumbnail). Supports format conversion, quality control, and dimension adjustment.
Batch image processing - compress, resize, format convert, watermark, EXIF clean, and crop. All local, no upload needed.
AI image generation for SEO assets: OG/social preview images, blog hero images, schema images, product photography, infographics. Powered by Gemini via nanobanana-mcp. Requires banana extension installed. Use when user says "generate image", "OG image", "social preview", "hero image", "blog image", "product photo", "infographic", "seo image", "create visual", "image-gen", "favicon", "schema image", "pinterest pin", "generate visual", "banner", or "thumbnail".
Image generation and editing based on Google Gemini native image generation (Nano Banana).
把一条社媒视频快速变成多个平台可发的尺寸版本——在 9:16、1:1、4:5、16:9 之间选择 crop / pad / scale 最佳策略,保护人脸、产品与字幕安全区,输出各平台可直接使用的适配方案。