Re: How to smooth image after blurring?
Posted: 2015-08-27T16:10:22-07:00
With Q16 IM, without "+depth", stair-stepping between areas is inevitable, as the output is 8 bits/channel/pixel and there are only 38 different tones.
With Q16 or better, with "+depth", we have more than 9000 tones, and I can't see any problem. Perhaps I don't understand the issue.
Using "-gaussian-blur" instead of "-blur" makes a slight difference, further reducing the number of adjacent pixels that are equal, and spreading them more evenly throughout the image.
Test script (Windows BAT syntax):
With Q16 or better, with "+depth", we have more than 9000 tones, and I can't see any problem. Perhaps I don't understand the issue.
Using "-gaussian-blur" instead of "-blur" makes a slight difference, further reducing the number of adjacent pixels that are equal, and spreading them more evenly throughout the image.
Test script (Windows BAT syntax):
Code: Select all
%IM%convert ^
before_blur.jpg -blur 0x50 ^
+depth ^
sm_blur2.png
%IM%convert ^
sm_blur2.png ^
-unique-colors info:
%IM%convert ^
sm_blur2.png ^
( +clone ) ^
-geometry +1+0 ^
-compose Difference -composite ^
-fill White +opaque Black ^
-format %%[fx:mean] +write info: ^
x0.png
%IM%convert ^
sm_blur2.png ^
( +clone ) ^
-geometry +0+1 ^
-compose Difference -composite ^
-fill White +opaque Black ^
-format %%[fx:mean] +write info: ^
x1.png