These conditions are equivalent to: maximum lightness is less than 98%, and more than 2%.
Code: Select all
convert ^
%SRC% ^
-colorspace Gray ^
-format "%%[fx:maxima>0.02&&maxima<0.98?1:0]" ^
info:
Code: Select all
convert ^
%SRC% ^
-colorspace Gray ^
-format "%%[fx:maxima>0.02&&maxima<0.98?1:0]" ^
info:
Code: Select all
objMi.Convert "-profile", "C:\ColorMatchRGB.icc", myimagename, "-sample", "800x", "PNG32:C:\newimage.png"
Code: Select all
imagedata = objMi.Identify("-units", "PixelsPerInch", "-format", "%x %y %w %h", myimagename)
Code: Select all
MaxColorValue = objMi.Convert(myimagename, "-colorspace", "Gray", "-format", "%%[fx:maxima>0.02&&maxima<0.98?1:0]")
Code: Select all
MaxColorValue = objMi.Identify(myimagename, "-colorspace", "Gray", "-format", "%%[fx:maxima>0.02&&maxima<0.98?1:0]")
Code: Select all
MaxColorValue = objMi.Identify(myimagename, "-BrightestPixel")
Code: Select all
objMi.Convert myimage, "-colorspace", "gray", "c:/newimage.png"
objMi.Convert "c:/newimage.png", "-type", "TrueColorMatte", "-define", "png:color-type=6", "c:/newimage.png"
objMi.Convert "c:/newimage.png", "-colors", "256", "-format", "%c", "histogram:info:C:/pixel_info.txt"