Code: Select all
convert orig.png -fill orange -opaque white new.png
I am running ImageMagick 6.8.9-9 on Ubuntu 16.04
Code: Select all
convert orig.png -fill orange -opaque white new.png
Code: Select all
Line 1: read the input
Line 2: copy the input and negate (invert) it
Line 3: put the negated image into the alpha channel of the input, so that white becomes transparent.
Line 4: create 1 pixel sized red and yellow images and append them side to side
Line 5: copy that and flip it left to right
Line 6: append them top to bottom and save as in memory mpr: image and delete the disk file version
Line 7: clone the input image and draw the checkerboard pattern over it
Line 8: swap the order of the two remaining images
Line 9: composite them
Line 10: write the output
Code: Select all
convert img.png \
\( +clone -negate \) \
-alpha off -compose copy_opacity -composite \
\( -size 1x1 xc:red xc:yellow +append \
\( +clone -flop \) \
-append -write mpr:checks +delete \) \
\( +clone -fill mpr:checks -draw 'color 0,0 reset' \) \
+swap -compose over -composite \
img_checks.png
Code: Select all
convert img.png \
\( +clone -negate \) \
-alpha off -compose copy_opacity -composite \
\( -size 1x1 xc:red xc:yellow +append \
\( -size 1x1 xc:yellow xc:red +append \) \
-append -write mpr:checks +delete \) \
\( +clone -fill mpr:checks -draw 'color 0,0 reset' \) \
+swap -compose over -composite \
img_checks.png
Code: Select all
convert img.png \
\( -size 1x1 xc:red xc:yellow +append \
\( +clone -flop \) \
-append -write mpr:checks +delete \) \
\( -clone 0 -fill mpr:checks -draw 'color 0,0 reset' \) \
\( -clone 0 -transparent white \) \
-compose over -composite \
img_checks.png
Code: Select all
convert img.png -transparent black img_trans.png
Code: Select all
\( -clone 0 -transparent black \) \
Code: Select all
convert img.png +write mpr:img +delete \
\( -size 1x1 xc:red xc:yellow +append \
\( +clone -flop \) \
-append -write mpr:checks +delete \) \
\( mpr:img -fill mpr:checks -draw 'color 0,0 reset' \) \
\( mpr:img -transparent black \) \
-compose over -composite \
img_checks.png