Code: Select all
identify -format "%[fx:mean]\n" filename
Just started with IM and using commandline on Ubuntu. Any help appreciated!
Thanks
Code: Select all
identify -format "%[fx:mean]\n" filename
Code: Select all
#!/bin/bash
toodark=29000
avgluz=$(identify -format "%[mean]" file.dng)
echo $avgluz
if ((avgluz < toodark)); then
echo "too damn dark!"
else
echo "reasonable.."
fi
Code: Select all
29489.9
./test.sh: line 5: ((: 29489.9: syntax error: invalid arithmetic operator (error token is ".9")
reasonable..
Code: Select all
identify -format "%[fx:mean>0.345?1:0]\n" filename
Code: Select all
call %PICTBAT%imgMnSdLBot cons1.jpg 0.5 0.1667 cons_c1.png
call %PICTBAT%imgMnSdLBot cons2.jpg 0.5 0.1667 cons_c2.png
%IM%convert cons_c1.png -resize 600 -quality 40 cons_c1.jpg
%IM%convert cons_c2.png -resize 600 -quality 40 cons_c2.jpg
Code: Select all
%IM%convert ^
cons1.jpg ^
cons_c1.png ^
cons_mask.png ^
-composite ^
cons_d1.png
%IM%convert ^
cons2.jpg ^
cons_c2.png ^
cons_mask.png ^
-composite ^
cons_d2.png
%IM%convert cons_d1.png -resize 600 -quality 40 cons_d1.jpg
%IM%convert cons_d2.png -resize 600 -quality 40 cons_d2.jpg
Code: Select all
rem From image %1,
rem applies gain and bias
rem so bottom 50% of image matches mean %2 and SD %3.
rem Output to %4.
set TMP_IMG=imsl_temp.miff
set TMP_BOT=imsl_bot.miff
%IM%convert ^
%1 ^
+write %TMP_IMG% ^
-gravity South ^
-crop 0x50%%+0+0 +repage ^
%TMP_BOT%
call %PICTBAT%meanSdTr %TMP_BOT% igb1_
set igb2_mn_R=%2
set igb2_mn_G=%2
set igb2_mn_B=%2
set igb2_sd_R=%3
set igb2_sd_G=%3
set igb2_sd_B=%3
call %PICTBAT%calcGainBias igb1_ igb2_ igb_gb_
%IM%convert ^
%TMP_IMG% ^
-channel R -function Polynomial !igb_gb_gain_R!,!igb_gb_bias_R! ^
-channel G -function Polynomial !igb_gb_gain_G!,!igb_gb_bias_G! ^
-channel B -function Polynomial !igb_gb_gain_B!,!igb_gb_bias_B! ^
+channel ^
%4
Code: Select all
#!/bin/bash
mean1=$(identify -format "%[fx:mean]\n" file1.jpg)
mean2=$(identify -format "%[fx:mean]\n" file2.jpg)
sd1=$(identify -format "%[fx:standard_deviation]\n" file1.jpg)
sd2=$(identify -format "%[fx:standard_deviation]\n" file2.jpg)
gain=$(echo "$sd2/$sd1" | bc -l)
echo gain $gain
bias=$(echo "$mean2-$mean1*$gain" | bc -l)
echo bias $bias
#convert something I guess.. apply gain and bias to file2