Page 1 of 1

fast blur, low gradient?

Posted: 2014-06-02T08:50:26-07:00
by bartleby
I have 1000's of image to process, all standard sizes: inputs 2700x2700, output various standard dimensions.

I've been using a gaussian filter on a smale scale image to get a blurred effect that is faster than -blur. However, in the final product there is a significant color gradient or banding.

I have tried dithering, additional blurring and a number of other commands but cannot seem to reduce it in any way.

Are there any alternative approaches I could consider that are still fast but produce less banding?

Input Image = $imagein
Image

Command
convert -units PixelsPerInch $imagein -resize 360X360\> -filter gaussian -resize 50% -define filter:sigma=5.0 -resize 500% -scale 600% -crop 2048x1500+1676+1950 -fill white -colorize 50% -density 72 $imageout

Output image
Image

Re: fast blur, low gradient?

Posted: 2014-06-02T09:37:35-07:00
by fmw42
Not sure what you are trying to do. But if all you want is the average color over the whole image, do

Code: Select all

convert image -scale 1x1! -scale WxH! result
where WxH is the dimensions of the original image.

Re: fast blur, low gradient?

Posted: 2014-06-04T20:10:51-07:00
by anthony
Color banding is generally cause by a limits color pallete on a color indexed image file formats.. EG: GIF and PNG8
That is why these images end up using some form of dithering, be it a randomised dither, or ordered dither (which could still use more work).

Color banding should not be visible when using 16 bit RGB images.

Actually just original photos from digital cameras have a fairly strong pixel level dithering. This is especially visible in low light. That is why some photogrphers hate High Mega Pixel cameras, They have lots of pixel producign very high contrasting and sharp photos, but with a stronger pixel level dither patterns for areas of supposedally constant color.

You can see these effects in the enlarged images shown in
http://www.imagemagick.org/Usage/photos/#binning
specifically example sub-pages
http://www.imagemagick.org/Usage/photos ... mple3.html

Re: fast blur, low gradient?

Posted: 2014-06-04T21:07:26-07:00
by snibgo
Computer displays are usually 8 bits/channel, and banding will often be visible in slowly-changing gradients, eg:

Code: Select all

convert -size 1000x500 gradient:gray(20%)-gray(30%) g.png
16-bit graphics images with such gradients, aimed at viewing on screens, are probably best converted to 8-bit, with dithering.