Page 1 of 1

tilt shift on windows mashine

Posted: 2015-06-22T02:48:54-07:00
by Readbook
Hi there.
I am trying to use tilt-shift script:

Code: Select all

  convert beijing_md.jpg -sigmoidal-contrast 15x30% \
          \( +clone -sparse-color Barycentric '0,0 black 0,%h gray80' \
             -solarize 50% -level 50%,0 -write mpr:blur_map \) \
          -compose Blur -set option:compose:args 10x0 -composite \
          mpr:blur_map \
          -compose Blur -set option:compose:args 0x10 -composite \
          beijing_model_2pass.jpg
so on my opinion on windows it looks like these:

Code: Select all

convert c:\del\00000001.JPG -sigmoidal-contrast 15x30%( +clone -sparse-color Barycentric '0,0 black 0,%h gray80' -solarize 50% -level 50%,0 -write mpr:blur_map) -compose Blur -set option:compose:args 10x0 -composite mpr:blur_map -compose Blur -set option:compose:args 0x10 -composite c:\del\000000011.JPG		  
but i've got error:

Code: Select all

convert.exe: invalid argument for option `sparse-color': Invalid number of Argum
ents @ error/mogrify.c/SparseColorOption/519.
convert.exe: unable to open image `black': No such file or directory @ error/blo
b.c/OpenBlob/2695.
convert.exe: no decode delegate for this image format `' @ error/constitute.c/Re
adImage/501.
convert.exe: unable to open image `0,%h': No such file or directory @ error/blob
.c/OpenBlob/2695.
convert.exe: no decode delegate for this image format `' @ error/constitute.c/Re
adImage/501.
convert.exe: unable to open image `gray80'': No such file or directory @ error/b
lob.c/OpenBlob/2695.
convert.exe: no decode delegate for this image format `' @ error/constitute.c/Re
adImage/501.
convert.exe: unable to get registry ID `blur_map' @ error/registry.c/GetImageReg
istry/201.
convert.exe: no images defined `c:\del\0000000111.JPG' @ error/convert.c/Convert
ImageCommand/3212.
I use ImageMagick-6.9.1-6-Q16-x64-dll.exe via windows 7 x64

Re: tilt shift on windows mashine

Posted: 2015-06-22T03:26:34-07:00
by snibgo
Each parenthesis ( and ) needs a space on both sides.

If in a BAT file, double each % sign.

Re: tilt shift on windows mashine

Posted: 2015-06-22T03:38:21-07:00
by Readbook
using in cmd, no BAT.
Trying threre(with space), no effect, same error

Code: Select all

convert c:\del\00000001.JPG -sigmoidal-contrast 15x30% ( +clone -sparse-color Barycentric '0,0 black 0,%h gray80' -solarize 50% -level 50%,0 -write mpr:blur_map ) -compose Blur -set option:compose:args 10x0 -composite mpr:blur_map -compose Blur -set option:compose:args 0x10 -composite c:\del\000000011.JPG   

Re: tilt shift on windows mashine

Posted: 2015-06-22T04:06:16-07:00
by snibgo
Use double instead of single quotes.

See http://www.imagemagick.org/Usage/windows/#conversion

Re: tilt shift on windows mashine

Posted: 2015-06-22T06:18:58-07:00
by Readbook
thanks, it's start working in cmd.
But when I put it into bat it stops workink.
I have path to files in %pyt1%\Def

Code: Select all

MD "%pyt1%Def\small"
FOR %%a in (%pyt1%Def\*.JPG) DO  c:\imagemagick\convert.exe %%a -sigmoidal-contrast 15x30%% ( +clone -sparse-color Barycentric "0,0 black 0,%h gray80" -solarize 50%% -level 50%%,0 -write mpr:blur_map ) -compose Blur -set option:compose:args 10x0 -composite mpr:blur_map -compose Blur -set option:compose:args 0x10 -composite "%pyt1%Def\small\%%~nxa"   
I try many combination with call and one or two %%.
I read all examples in http://www.imagemagick.org/Usage/windows/#conversion but don't saw any examples with parametr such as

Code: Select all

"0,0 black 0,%h gray80"

Re: tilt shift on windows mashine

Posted: 2015-06-22T06:38:34-07:00
by snibgo
If in a BAT file, double each % sign.

Code: Select all

"0,0 black 0,%%h gray80"

Re: tilt shift on windows mashine

Posted: 2015-06-22T07:08:46-07:00
by Readbook
i think problem is not in

Code: Select all

"0,0 black 0,%%h gray80"
I tested, and it works well with double %
I think problem is in ()
here is full command

Code: Select all

if %tilt%==true (
MD "%pyt1%Def\small"
FOR %%a in (%pyt1%Def\*.JPG) DO c:\imagemagick\convert.exe %%a -sigmoidal-contrast 15x30%% ( +clone -sparse-color Barycentric "0,0 black 0,%%h gray80" -write mpr:blur_map ) -compose Blur -set option:compose:args 10x0 -composite mpr:blur_map -compose Blur -set option:compose:args 0x10 %pyt1%Def\small\%%~nxa  
pause
)
I've got error:
unexpected appearance -compose

Re: tilt shift on windows mashine

Posted: 2015-06-22T07:14:55-07:00
by snibgo

Code: Select all

if %tilt%==true (
So your convert command is within "if ... ( ... )". This means you need to escape the parentheses ( and ) that occur within your convert: ^( and ^).

Re: tilt shift on windows mashine

Posted: 2015-06-22T07:16:14-07:00
by Readbook
thank you, I've found same solution in 1 min ago.
Thanks for you help, my script is ready)