Timo Schwarzer
Timo Schwarzer

Reputation: 409

Blur image with ImageMagick and extent it

I want to blur an image with transparent background using ImageMagick. I've trimmed this image to its content, so it doesn't have any surrounding whitespace/transparency.

The above part works fine, but: When I blur the trimmed image, it will (obviously) overflow the boundaries. So the question is: How can I blur a trimmed image, while extending its boundaries to the right size before?

Upvotes: 0

Views: 396

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207670

Extend the background with transparent pixels, blur and then re-trim:

convert original.png -background none -gravity center -extent 200x200% -blur ... -trim result.png

Upvotes: 1

Related Questions