Search code examples
image-processingimagemagickimagemagick-convertwhiteboard

ImageMagick : Script giving unexpected result with a different coloured images


I am using this script

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

On one of the input it gave this result- input 1 output 1

while on the other example it gave- input 2 output 2

What could I change to get clean up the green board image I have like the whiteboard one?


Solution

  • You'll need to adjust the channel/level correction. Something like 50%,81%,0.1. Also switch the -morphology to EdgeIn Octagon. Adjusting the blur & maybe switch colorspace at the end could help.

    #!/bin/bash 
    convert "$1" \
            -morphology EdgeIn Octagon \
            -negate -normalize -blur 0x2 \
            -channel RGB -level 50%,81%,0.1 \
            -colorspace Gray \
            "$2"
    

    Blackboard Imagemagick