Pedery
Pedery

Reputation: 3636

ImageMagick on iOS: Blurring and blending an image with itself

I'm trying to take an image, blur it with a 10px radius (both -blur and -gaussian-blur should work fine), then give it a 50% opacity, and finally overlay the blurred transparent image with the original. Here's what I've got so far:

convert sample.png \( sample.png -gaussian-blur 10 -matte -channel A 
-evaluate set 50% \) -composite dreamy.png

Here's the original image:

Original image

And here is what it should look like after the effect is applied:

Image with filter

However, what I get with the command above just looks very similar to the original. Anyone have any ideas how to achieve the effect I want? If I do what I originally described in an image manipulation program, I get the desired effect, so something is probably wrong with the command I'm using.

Edit:

-adaptive-blur seems to get me closer to the desired effect, but still I'd like to use -blur.

Edit 2:

convert round-face-winslet.jpg \( +clone -blur 0x10 \) -compose Screen -composite round-face-winslet_soft.jpg

...gets me yet closer to the result, but no matter what kind of -compose method I choose, the result still does not look like the desired image. It's either too light or too dark. What should be a simple 50% opacity blended with the underlying original picture, for some reason doesn't want to work...

Upvotes: 2

Views: 1498

Answers (2)

zot
zot

Reputation: 131

I think the effect you are looking for can be found in the ImageMagick compose examples in the "Softened Blurring" section.

  convert face.png  -morphology Convolve Gaussian:0x3  face_strong_blur.png
  convert face.png  face_strong_blur.png \
          -compose Blend -define compose:args=60,40% -composite \
          face_soft_blur.png

Looks like this:

enter image description here

Upvotes: 2

japreiss
japreiss

Reputation: 11251

An older tutorial on this technique (here) suggests lightening the blurred layer and blending in Multiply mode. I expect that darkening the blurred layer and blending with Screen would also work. Don't use a standard 50/50 blend - it doesn't have the same glowing appearance.

In your sample, the shadows of the processed image are lighter. Multiplying can only make an image darker, so I'm guessing they took the darken-Screen approach.

Upvotes: 1

Related Questions