I often want to blur a circle either internally (and not externally) or externally (and not internally). In the example below, I have applied Gaussian blur to an image, selecting only the circle so as to preserve the sharpness of its outer edge—that is, so as not to allow the effect to ‘bleed’ outside the circle.

However, whilst the effect is subtle, the Gaussian blur algorithm leaves the image with higher light levels in the axial directions—top and bottom, left and right—as shown. These artefacts become even more obvious when the image is resized (reduced), and to the keener eye are annoying.

How can these artefacts be avoided?

enter image description here

  • There is no way to analyze wether your statement is correct or not as we dont know what was the original shape was. Anyway if you dont trust the inbuilt blur you can allways use custom and make your own blur kernel. – joojaa Aug 6 '20 at 5:20
  • @joojaa: Thank you for the reply. The original shape was a solid white hollow semicircle on the upper side, and a partially-filled concavity on the lower side. (It looks very much as you might expect it to, with the gradient of the original shape flowing inward.) However, for the purposes of the question, it might just as well have been a simple hollow circle/annulus. The result is the same: if I select only the circle, then apply a Gaussian blur, it always results in having lighter points at the top and bottom, left and right. – POD Aug 6 '20 at 5:38
  • Yes but since you are talking about exact implementation details of pixels i need exact details of pixels involved. – joojaa Aug 6 '20 at 5:38
  • @joojaa: It was a solid white annulus, only with anti-aliasing applied. In this case, I started with a screenshot (.png) of an .svg as rendered by Inkscape. However, it applies equally if I were simply to select a circle in GIMP, then fill it in with white. I have done this process numerous times with various projects, and the result is always the same. The effect is doubtlessly an artefact of the Gaussian blur algorithm, as it applies to this particular shape. It does not occur, for example, if I blur a large white square with a circle cut out of its centre. – POD Aug 6 '20 at 5:51
  • @joojaa: In fact, I was just recently working on solving the problem by doing just that: applying the blur to a figure with solid white extending well beyond the hollow, then simply ‘cutting out’ the part I want in the centre. The technique works, but it is a bit fiddly. I was hoping that someone had encountered this problem and found a simpler solution. – POD Aug 6 '20 at 5:54

A good way to demonstrate the problem is to blur a ring without a selection. With Gimp's Gaussian blur the result is slightly diamond-shaped:

enter image description here

There is a very powerful collection of filters available for Gimp called GMIC. It features (among many other things) a Gaussian blur filter that doesn't seem to suffer from the problem (at least not to the same extent):

enter image description here

  • Thank you. I'll try those a bit later on and report back. – POD Aug 6 '20 at 8:32
  • Yeah there are 2 ways to do a gaussian blur make it with one big blurring kernel and using a smaller kernel repeatedly. Big blurs on repeated small kernel will show the shape of the underlying discrete kernel. The bigger the kernel is the more likely its to be exactly round. However this should not affect the masked area. Although masking upfront has a problem. – joojaa Aug 6 '20 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.