I'm trying to blur a picture except a region in the middle. Something like this:
I only see options to do the opposite, i.e. blur a region and I need the inverse.
Can it be done?
Right now I'm trying to solve this by croping out the region in the middle, blurring the complete image and then merging the cropped region on top of the blurred image; quite messy!
Invert region
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Invert region
The obvious way would be to use "+region", which would be like "-region" but allow changes outside the rectangle. Sadly, there is no "+region".
Instead, we can compose a blurred version over a non-blurred version, using a mask that is a black rectangle on a white background. In this Windows script, b.png is a test image.
Instead, we can compose a blurred version over a non-blurred version, using a mask that is a black rectangle on a white background. In this Windows script, b.png is a test image.
Code: Select all
%IM%convert -size 600x400 label:snibgo b.png
%IM%convert ^
b.png ^
( +clone -blur 0x5 ) ^
( +clone -fill White -colorize 100 -fill Black -draw "rectangle 100,100,499,149" ) ^
-composite ^
bz.png
snibgo's IM pages: im.snibgo.com
Re: Invert region
Haven't used windows for a decade but I'll try this tonight when my kids have fallen asleep
Thanks!
Thanks!