求助: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 the20to 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 tooutput.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
相关产品推荐
相关产品推荐

