You can blur the whole picture. Then draw the polyline on the original. Then make a binary mask from the polyline area. Then use -composite to overlay the one with the other using the mask to control which area shows from the original and which area shows from the blurred image.
see:
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#mask
Is it possible to modify (blur)a polyline-area of a picture?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Is it possible to modify (blur)a polyline-area of a picture?
As mentioned by fmw42, create a blured picture. But also generate a plotline mask to select between the original picture and the blurred picture.
You may however like to blur (feather) the mask slightly to make it a more gradual change.
At the moment however there is no method to adjust the blur amount according to some mask. Such a method would be useful for generating shadows that get more blurry the further they extend from some object.
Code: Select all
convert original.jpg \( +clone -blur 0x5 \) \( -size 640x480 xc:black -fill white -draw 'polyline 255,390 220,420 290,420' \) -composite blurred_window.jpg
Code: Select all
convert original.jpg \( +clone -blur 0x5 \) \( -size 640x480 xc:black -fill white -draw 'polyline 255,390 220,420 290,420' -blur 0x2 \) -composite blurred_window2.jpg
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/