Page 1 of 1
smoothing..
Posted: 2016-10-12T07:36:49-07:00
by dognose
Hi,
I'm using another program that is generating images, however, they have a lot of pixelated noise.
Here is an example:
https://cloud.githubusercontent.com/ass ... 9e7c1e.png
Any advice on removing this pattern, or smoothing the image. The only smoothing tool I've seen makes the image too blurry.
Re: smoothing..
Posted: 2016-10-12T12:08:36-07:00
by snibgo
Well, the image is made of "giant pixels", that are each 8x8 pixels. And even then, the giant pixels are in a patchwork of 2x2.
So "-scale 12.5%" doesn't lose any data. "-resize 12.5%" somewhat merges the 2x2 pattern of giant pixels, so looks better.
Then, if you want, you can "-resize 800%", and then perhaps sharpen the result. Or you might apply more complex processing to identify areas of flat or gradient colour, and edge detail. See my pages "Cartoon and texture", "Flat-colour cartoons", etc.
Re: smoothing..
Posted: 2016-10-12T20:21:38-07:00
by dognose
I see what you mean.. The 8x8 was just the enlargement of the detail, post processing.... but it's the 2x2 patchwork that is the real problem
I'm guessing that it's rendered at half the size then enlarged without the regard for contour.
50% then 200% resize does help somewhat.
Re: smoothing..
Posted: 2016-10-12T22:34:11-07:00
by snibgo
So the 8x8 giant pixels are not relevant, but you want to remove the 2x2 patchwork? Okay. The following is Windows BAT script.
First, reduce to 1/8 size:
Code: Select all
%IM%convert screenDots.png -resize 12.5%% sd_small.png
From my "Cartoon and texture" page, we use cartTextEep.bat to smooth the areas into gradients.
Code: Select all
call %PICTBAT%cartTextEep sd_small.png sd_small_XX.png 0.5
The script has created a mask of the edges, so we use that to paint back the original edges.
Code: Select all
%IM%convert ^
sd_small_cart.png ^
sd_small.png ^
sd_small_edges.png ^
-composite ^
sd_small_out.png
The result has the original edge detail, but with the noise smoothed away.
(The differences between the images are clearly seen when they are enlarged.)