to calculate the gamma value something like
Code: Select all
for /f "tokens=*" %%a in ('convert %1 -format "%%[fx:(log(mean)/log(0.5))]" info: ') DO set gamma=%%a
for /f "tokens=*" %%a in ('convert null: -format "%%[fx: mgama= %gamma: =% ; while ( mgama > 3.5, mgama = mgama / 2 ) ]" info: ') DO set gamma=%%a
convert %1 -gamma %gamma% PNG:%1.png
"The syntax of the command is incorrect "
If I try something like
Code: Select all
for /f "tokens=*" %%a in ('convert null: -format "%%[fx: while ( %gamma% > 3.5, %gamma% / 2 ) ]" info: ') DO set gamma=%%a
Any ideas ?
According to the docs in fx operator
" while(condition,expression): interate while the condition is not equal to 0 "
What am I doing wrong ?