Greyscale half of image diagonally solution tips? Using rmagick
Posted: 2016-01-07T17:25:58-07:00
Use https://github.com/ImageMagick/ImageMagick/discussions instead.
https://imagemagick.com/discourse-server/
https://imagemagick.com/discourse-server/viewtopic.php?t=28951
Code: Select all
size=`convert FRqephU.png -format "%wx%h" info:`
ww=`echo $size | cut -dx -f1`
hh=`echo $size | cut -dx -f2`
p1=0,0
p2="$((ww-1)),0"
p3="0,$((hh-1))"
echo "p1=$p1; p2=$p2; p3=$p3;"
convert FRqephU.png \
\( -clone 0 -colorspace gray \) \
\( -clone 0 -fill black -colorize 100 \
-fill white -draw "polygon $p1 $p2 $p3" \) \
-alpha off -compose over -composite result.png
Code: Select all
size=`convert FRqephU.png -format "%wx%h" info:`
ww=`echo $size | cut -dx -f1`
hh=`echo $size | cut -dx -f2`
p1=0,0
p2="$((ww-1)),0"
p3="0,$((hh-1))"
echo "p1=$p1; p2=$p2; p3=$p3;"
convert FRqephU.png \
\( -clone 0 -set colorspace RGB -colorspace gray \) \
\( -clone 0 -fill black -colorize 100 \
-fill white -draw "polygon $p1 $p2 $p3" \) \
-alpha off -compose over -composite result.png
Code: Select all
size=`convert FRqephU.png -format "%wx%h" info:`
ww=`echo $size | cut -dx -f1`
hh=`echo $size | cut -dx -f2`
p1=0,0
p2="$((ww-1)),0"
p3="0,$((hh-1))"
echo "p1=$p1; p2=$p2; p3=$p3;"
convert FRqephU.png \
\( -clone 0 -set colorspace sRGB -colorspace gray \) \
\( -clone 0 -fill black -colorize 100 \
-fill white -draw "polygon $p1 $p2 $p3" \) \
-alpha off -compose over -composite result.png
Code: Select all
size=`convert FRqephU.png -format "%wx%h" info:`
ww=`echo $size | cut -dx -f1`
hh=`echo $size | cut -dx -f2`
p1=0,0
p2="$((ww-1)),0"
p3="0,$((hh-1))"
echo "p1=$p1; p2=$p2; p3=$p3;"
convert FRqephU.png \
\( -clone 0 -grayscale Rec709Luminance \) \
\( -clone 0 -fill black -colorize 100 \
-fill white -draw "polygon $p1 $p2 $p3" \) \
-alpha off -compose over -composite result.png
Code: Select all
size=`convert FRqephU.png -format "%wx%h" info:`
ww=`echo $size | cut -dx -f1`
hh=`echo $size | cut -dx -f2`
p1=0,0
p2="$((ww-1)),0"
p3="0,$((hh-1))"
echo "p1=$p1; p2=$p2; p3=$p3;"
convert FRqephU.png \
\( -clone 0 -grayscale Rec601Luminance \) \
\( -clone 0 -fill black -colorize 100 \
-fill white -draw "polygon $p1 $p2 $p3" \) \
-alpha off -compose over -composite result.png