Tilt-Shift Effect

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?".
Post Reply
goldskif
Posts: 22
Joined: 2012-02-19T03:51:30-07:00
Authentication code: 8675308

Tilt-Shift Effect

Post by goldskif »

http://www.imagemagick.org/Usage/photos/#tilt_shift
Tried to do this effect, but in the Central part of the (black map) will still get a slight blur. (((
How to leave a sharp image on the black map?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Tilt-Shift Effect

Post by fmw42 »

You mask must be pure black in the area you do not want to blur. Check your mask to see what values you have in it.
goldskif
Posts: 22
Joined: 2012-02-19T03:51:30-07:00
Authentication code: 8675308

Re: Tilt-Shift Effect

Post by goldskif »

I tried it was given in the link example. The black part of the still slightly blurred .
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Tilt-Shift Effect

Post by fmw42 »

I followed the example and got a good result just as shown in the example without the center being blurry. I am using IM 6.8.1.3 Q16 Mac OSX Snow Leopard.

What version of IM and platform are you using?

Post a link to your brightened input image and to your gradient image so we can see if they are created correctly.

Alternately, use

compare -metric rmse exampleimage yourimage null:

on each of the input and gradient images to see what the differences are.
goldskif
Posts: 22
Joined: 2012-02-19T03:51:30-07:00
Authentication code: 8675308

Re: Tilt-Shift Effect

Post by goldskif »

Linux Ubuntu 12.04
Version: ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
convert beijing_contrast.jpg beijing_blurmap.jpg -compose Blur -set option:compose:args 10 -composite 1_test.jpg
main result
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Tilt-Shift Effect

Post by fmw42 »

I would actually need to see your input image and gradient mask, unless you used the ones create in Anthony's example rather than creating them from his code.

The same command using Anthony's example images works fine for me.

My guess is that your gradient mask is not going to full black. Try this and see if it makes a difference.

convert beijing_contrast.jpg \( beijing_blurmap.jpg -auto-level \) -compose Blur -set option:compose:args 10 -composite 1_test.jpg

If this does not work or change the result, then perhaps you need to upgrade IM as it is over 100 versions old. You may have a version that has some bug.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Tilt-Shift Effect

Post by anthony »

There was some bugs (and probably still is) in the variable blur. Especially for the 'low blur' parts.

Best test is with a gradient against a half black half white test image and looking at the results at a pixel level.

See Variable Blur Examples
http://www.imagemagick.org/Usage/mapping/#blur

Specifically the thrid example.

Code: Select all

  convert blur_map_bool.gif blur_map_gradient.gif \
          -compose blur -define compose:args=15 -composite \
         blur_edge_gradient.gif
Image Image --> Image

Use a smaller argument for micro blur testing.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply