1) if any of X's 8 neighbor pixels is the same color, turn X black 2) otherwise, turn X white
For test purposes, you can use the -fx operator to do any mathematical manipulation you would like to perform, referring to relative coordinates.
In this special case, I think that you can arrive at what you want with some tricky use of a convolution kernel:
convert test.tif -negate -bias 128 -convolve -1,-1,-1,-1,1,-1,-1,-1,-1 -threshold 120 conv.tif
almost does what you would like to do, but instead it leaves all pixels black that are surrounded by white pixels. Thinking the basic idea further than me, you will probably get what you want.
Wolfgang Hugemann _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
