Remove squared artefacts after increasing resolution

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
BigNoub
Posts: 33
Joined: 2015-12-29T14:49:52-07:00
Authentication code: 1151

Remove squared artefacts after increasing resolution

Post by BigNoub »

I'm using Imagemagick 7.0.8-14 on ubuntu 16.04

I have an image that has been upscaled 8 times. As a result, when I zoom in a lot on it, I can see squares of 8x8 pixels, circled here:

Image

Can Imagemagick help me get rid of these? I tried with -kuwahara but I need a high kuwahara value to get rid of the squares, and the high value changes my image too much. So I think I would need something to blur only the edges of these 8x8 squares, or any solution that would not change my image too much.

Here is the original image if you wan to test:

Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Remove squared artefacts after increasing resolution

Post by snibgo »

How did you upscale the original image? It's usually better to prevent problems than fixing them after they have occurred.
BigNoub wrote:As a result, when I zoom in a lot on it, I can see squares of 8x8 pixels, ...
You have shown the zoomed-in version, which has blocks of 11x11 repeating pixels. Processing that to remove 8x8 artefacts (which are now 88x88 artefacts) won't work well.
BigNoub wrote:... something to blur only the edges of these 8x8 squares,...
If you know where the edges are, you could do a small blur, then composite that over the original with a mask.
snibgo's IM pages: im.snibgo.com
BigNoub
Posts: 33
Joined: 2015-12-29T14:49:52-07:00
Authentication code: 1151

Re: Remove squared artefacts after increasing resolution

Post by BigNoub »

snibgo wrote: 2019-01-06T04:37:18-07:00 How did you upscale the original image? It's usually better to prevent problems than fixing them after they have occurred.
It was with some neural network technique. I don't have much control over this, the not upscaled picture has been lost.
snibgo wrote: 2019-01-06T04:37:18-07:00 You have shown the zoomed-in version, which has blocks of 11x11 repeating pixels. Processing that to remove 8x8 artefacts (which are now 88x88 artefacts) won't work well.
It's not easy to count but I think the blocks are 8x8 (on the upscaled version I'm talking, see the squares I have circled, they have a side of 8 mini-squares, which I guess are pixels on my upscaled image?).
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Remove squared artefacts after increasing resolution

Post by snibgo »

You show versions that are zoomed in. Do you have a version that isn't zoomed in? Can you show that?
snibgo's IM pages: im.snibgo.com
BigNoub
Posts: 33
Joined: 2015-12-29T14:49:52-07:00
Authentication code: 1151

Re: Remove squared artefacts after increasing resolution

Post by BigNoub »

This is the version that is not zoomed in

Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Remove squared artefacts after increasing resolution

Post by snibgo »

Okay. In that red/white checker image, I can't see any 8x8 artefacts, even when zoomed in. The squares are about 43x43 pixels, with detail in each square. Perhaps you want to smooth the detail within each square, while leaving the edges of each square unchanged. This would be adaptive smoothing.
snibgo's IM pages: im.snibgo.com
BigNoub
Posts: 33
Joined: 2015-12-29T14:49:52-07:00
Authentication code: 1151

Re: Remove squared artefacts after increasing resolution

Post by BigNoub »

Wait the host compressed the previous image. This one should be uncompressed: https://drive.google.com/file/d/19NPu0N ... sp=sharing and you should be able to see the 8x8 artifacts such as the ones in my first post.
Post Reply