You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:ImageMagick实现竖图转550x550并添加模糊边框

Fixing Blurred Border for Your ImageMagick Command

Ah, I get it—you want that polished blurred background instead of the plain white one. The original command uses the default white background because you didn’t specify a custom background source. Here’s how to modify it to use a blurred version of your original image as the border:

The Updated Command

convert 2.jpg \
  \( +clone -resize 550x550^ -gravity center -extent 550x550 -blur 0x20 \) \
  \( +clone -resize 550x550> \) \
  -gravity center -composite \
  -quality 80 output.jpg

Let’s Break This Down:

  • 2.jpg: Your original input image.
  • First Parentheses Block: Creates the blurred background layer:
    • +clone: Makes a copy of the original image.
    • -resize 550x550^: Resizes the clone so it fully covers the 550x550 canvas (the ^ ensures it’s at least 550px in both dimensions, even if some edges get cropped).
    • -gravity center -extent 550x550: Crops the resized clone to exactly 550x550, centered.
    • -blur 0x20: Applies a strong blur (adjust the 20 to tweak intensity—higher numbers mean more blur, lower numbers mean softer blur).
  • Second Parentheses Block: Creates the sharp foreground layer:
    • +clone: Makes another copy of the original image.
    • -resize 550x550>: Resizes it to fit within 550x550 without stretching (preserves your original aspect ratio, same as your initial command).
  • -gravity center -composite: Places the sharp foreground image directly on top of the blurred background, centered perfectly.
  • -quality 80 output.jpg: Saves the final image with 80% quality to output.jpg.

Quick Tip:

If you want a softer or more intense blur, tweak the -blur 0x20 value. For example, 0x10 gives a lighter blur, while 0x30 creates a heavier, more diffused effect. Play around until you get the exact look you want!

内容的提问来源于stack exchange,提问作者Iago Leão

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 04:13:16