roll and blur

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
imaggie
Posts: 88
Joined: 2011-12-19T04:15:36-07:00
Authentication code: 8675308

roll and blur

Post by imaggie »

I am trying to reduce ringing around lettering in an FFT processing with a mask jinc mask.

It seems that much of the ringing is due to strong components in the middle of the frequency range caused by image border discontinuities.

I would like smooth this transition by rolling the image 50% and blurring say 5% strip now at the centre of the image (first X , then Y).

This would degrade that part of the image but it gets pretty much blown out by ringing anyway if there are significant differences between LH and RH borders as is often the case.

I have not been able to see how to blur just the middle strip.

Suggestions , please.
8)

User avatar
fmw42
Posts: 26053
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: roll and blur

Post by fmw42 »

try setting -region before the blur

http://www.imagemagick.org/script/comma ... php#region

You can also create a mask the size of the image with white where you want the blur and black every where else. then blur a copy of the image. Then use the mask to composite the unblurred and blurred images together.

see

http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#mask

imaggie
Posts: 88
Joined: 2011-12-19T04:15:36-07:00
Authentication code: 8675308

Re: roll and blur

Post by imaggie »

Thanks I have managed to blur a +/-5% strip that I rolled to centre and then back afterwards, repeated in x and y. This drastically reduces ringing due to boundary discontinuities, however, it's very clumsy.

what would be nearer to what is needed is a progressive blur, like a linear gaussian blur with a sigma that drops off with the distance from the centre point.

I could approximate in piecewise strips but it's getting messy.

The idea is to soften the boundary discontinuity before applying any DFT that wraps the image.

User avatar
fmw42
Posts: 26053
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: roll and blur

Post by fmw42 »

How did you manage to blur the center area? -blur will be a gaussian roll off function. Do I misunderstand your question? Do you want a variable blur? If so, see

http://www.imagemagick.org/Usage/blur/
http://www.imagemagick.org/Usage/mapping/#blur
http://www.fmwconcepts.com/imagemagick/ ... /index.php
http://www.fmwconcepts.com/imagemagick/ ... /index.php

I am not sure I understand what you are doing? Is this for FFT deconvolution? If so, to what are you applying the blur and in which domain (spatial or frequency)?

imaggie
Posts: 88
Joined: 2011-12-19T04:15:36-07:00
Authentication code: 8675308

Re: roll and blur

Post by imaggie »

thanks, that gives me some homework for tonight ;)

That looks like I should be able to do exactly what I want with a bit of digging.


what did already was this

Code: Select all

wid=`identify -format "%w" $src`
half=$(($wid/2))
blur=52
convert -gravity Center $src \
 -roll +$half+0 \
 -region 6%x100% -blur 3x$(($blur*${wid}/100))  \
 -region 10%x100% -blur 3x$(($blur*${wid}/100))  \
 -region 100%x100% -roll -$half-0 \
 -roll +0+$half \
 -region 100%x6% -blur 3x$(($blur*${wid}/100))  \
 -region 100%x10% -blur 3x$(($blur*${wid}/100))  \
 -region 100%x100% -roll +0-$half \
 $dest
It's a bit crude segmentation wise and I was not getting a strong enough blur in some images that had a large tonal difference left and right.

Look like I should be able to do just what I want with elliptical burring.

There's not end to what you can do with IM but your need a Sherpa to guide you through the mountains of documentation.

Thanks for your help.

Post Reply