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?".
Is it possible to create kernel which will blur the parts of image which are sharp and also will sharpen the areas which are blur?
For instance in this image I have marked regions with text which should be sharpen more (red frame) and areas which should be sharpen less (orange regions). The bottom right should be blurred.
Hi,
I was looking for the solution of almost the same problem. I need to selectively sharpen some pictures (in batch modus) -- like here http://digiretus.com/selective-sharpening-in-photoshop/ in Photoshop. The top of the photograph should be sharpened and towards the bottom the factor should gradually decrease. I am able to prepare N-S gradient mask however I don't understand what snibgo means with extrapolate from the blur, past the input image.
Could someone provide a small example?
See https://imagemagick.org/Usage/mapping/#blur for the basic variable blur. I am not sure what snibgo meant either, but I do not think it applies to your case. The basic variable blur should do what you want. For sharpening, I think you can create the blurred version and then subtract some fraction of it from the original (sort of unsharp masking)
Alternately and more efficiently, make a sharpened copy of your image and use the gradient as a mask to blend to the two images. See https://imagemagick.org/Usage/compose/#compose for the masked composite operation.
snibgo wrote:... extrapolate from the blur, past the input image.
This is unsharp masking, but in this case with a selective (ie variable) blur, so the sharpening is also selective.
When we have an image and a blurred version of that image, the result could be an interpolation between those two versions, anywhere between the blur and the original. Or it could be an extrapolation, past the original, which increases sharpness.
In the bad old days, IM commands could list the operations in any order you want, and IM would process the operations one after the other in whatever order it wanted.
These days, IM will process the operations in the same order they are given. So "-composite" before any images have been read won't do anything, because there are no images to composite.