Page 1 of 1
Posted: 2006-04-30T13:46:09-07:00
by magick
The -fx option is reparsed for each pixel which makes it prohibitively slow for large images. It was designed to conveniently experiment with new algorithms, not for production runs. Once a new algorithm is tested with -fx, it should be converted to an ImageMagick filter for production use. Filters are invoked with the -process option. We have one example in the ImageMagick source distribution in the ImageMagick/filters folder called analyze.c. If you write a custom filter that you think others might find useful you can post it in the User forum and if it is of general usefulness we might move it to the ImageMagick distribution (if you release it under the ImageMagick license).
If the problem you are having is something other than slow processing, try ImageMagick 6.2.7-2, the latest release. If it fails as well, repost with exactly what the problem is and we will investigate further.
Posted: 2006-04-30T14:53:37-07:00
by magick
In the next point release we'll add an -adaptive-sharpen option that should perform the sharpening effect your describe. It will be relatively fast since it will not be interpretted like -fx is.
Posted: 2006-05-01T13:15:39-07:00
by magick
The new
-adaptive-sharpen option will be available tommorrow as ImageMagick 6.2.7-3 Beta here:
ftp://ftp.imagemagick.org/pub/ImageMagick/beta. You will find the algorithm as AdaptiveSharpenImage() in magick/effects.c and you can invoke it like this:
- convert before.png -adaptive-sharpen 0x1 after.png
Currently we do everything in the RGB colorspace so we can sharpen CMYK images. The original article suggested the luminosity channel of the HSV colorspace. If you want to experiment, use
- SetImageColorspace(edge_image,HSBColorspace);
to convert to hue, saturation, and brightness and the blue channel contains the brightness channel. To convert it back to RGB, use
- SetImageColorspace(sharp_image,RGBColorspace);
If someone comes up with changes that produce better results, post the patches here and we will get them into the main ImageMagick distribution.
Re: Large image processing problems..
Posted: 2012-02-06T02:14:08-07:00
by donproc
hi, magick
would you please tell me which article described the algorithm of adaptive sharpen used in ImageMagicK.
Thanks,
donpro
Re: Large image processing problems..
Posted: 2016-05-27T08:13:34-07:00
by tcrass
Hi there,
donproc wrote:hi, magick
would you please tell me which article described the algorithm of adaptive sharpen used in ImageMagicK.
I second! Any information available about the implemented algorithm? (I tried to have a look at the source code, but for someone not deeply involved in ImageMagick memory management, it is virtually impossible to figure out what the AdaptiveShaprenImage function actually does to the image...)
Cheers --
-- Torsten
Re: Large image processing problems..
Posted: 2016-05-27T09:08:17-07:00
by magick
The algorithm is described as "adaptively sharpens the image by sharpening more intensely near image edges and less intensely far from edges. We sharpen the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma." The algorithm creates a set of kernels with linearly increasing "sharpiness" and picks one based on the edge gradient. If its a flat area, its sharpened less intensely to preserve the original fidelity of the pixels. If its near an edge, its sharpened more intensely.