Code: Select all
-format "%[max]" info:
Code: Select all
-format "%[max]" info:
Code: Select all
oldmax=`convert image -format "%[max]" info:
newmax=your (integer) value in quantum range
convert image -channel X -fill newmax -opaque oldmax +channel result
Code: Select all
magick image -set option:oldmax "%[max]" -channel X -fill newmax -opaque "%[oldmax]" +channel result
Code: Select all
magick: unable to open image '65535': No such file or directory @ error/blob.c/OpenBlob/3094.
magick: no decode delegate for this image format `' @ error/constitute.c/ReadImage/509.
Code: Select all
magick logo: -set option:oldmax "%[fx:round(255*maxima.r)]" -separate +channel \
\( -clone 0 -fill "gray(200)" -opaque "gray(%[oldmax])" \) \
-swap 0,3 +delete -combine result.png
Code: Select all
magick logo: -set option:oldmax "%[fx:round(255*maxima.r)]" -separate +channel ^
( -clone 0 -fill "gray(200)" -opaque "gray(%[oldmax])" ) ^
-swap 0,3 +delete -combine result.png
Code: Select all
im7 magick logo: -channel r -fill "gray(200)" -opaque "gray(255)" +channel tmp2.png
Code: Select all
convert logo: -channel r -fill "gray(200)" -opaque "gray(255)" +channel tmp2.png
Code: Select all
magick logo: -set option:oldmax "%[fx:round(255*maxima.r)]" -separate +channel ( -clone 0 -fill "gray(200)" -opaque "gray(%[oldmax])" ) -swap 0,3 +delete -combine result.png
Code: Select all
magick logo: -set option:oldmax "%[fx:round(255*maxima.g)]" -separate +channel ( -clone 1 -fill "gray(200)" -opaque "gray(%[oldmax])" ) -swap 1,3 +delete -combine result.png
Code: Select all
magick logo: -set option:oldmax "%[fx:round(255*maxima.b)]" -separate +channel ( -clone 2 -fill "gray(200)" -opaque "gray(%[oldmax])" ) -swap 2,3 +delete -combine result.png
Code: Select all
magick \( logo: -transparent white \) \
-set option:oldmax "%[fx:round(255*maxima.r)]" -separate +channel \
\( -clone 0 -fill "gray(200)" -opaque "gray(%[oldmax])" \) \
-swap 0,4 +delete \( -clone 0-2 -combine \) \
-delete 0-2 +swap -alpha off -compose copy_opacity -composite \
result.png
Code: Select all
magick ( logo: -transparent white ) -set option:oldmax "%[fx:round(255*maxima.r)]" -separate +channel ( -clone 0 -fill "gray(200)" -opaque "gray(%[oldmax])" ) -swap 0,4 +delete ( -clone 0-2 -combine ) -delete 0-2 +swap -alpha off -compose copy_opacity -composite result.png
Code: Select all
magick yourimage -format "%[maxima.r]" info:
Code: Select all
magick -version