Here is a quick attempt at this:
Starting with:
http://www.fmwconcepts.com/misc_tests/gradient_slice/gradient.png
I used
min="45"
max="65"
convert gradient.png \( +clone -separate \
-black-threshold $min% \
-white-threshold $max% \
-fill black -opaque white \
-combine -fill white +opaque black -negate \) \
-compose copy_opacity -composite \
gradient_slice3.png
To make this:
http://www.fmwconcepts.com/misc_tests/gradient_slice/gradient_slice3.png
The center area is actually transparent against the white page background.
>Hello Manish,
>
>I am not sure these are exactly what you wanted to do, but they could
>give you some ideas. Nevertheless, it is always great for someone to
>add new functions to IM. So I am looking forward to seeing yours.
>
>But you might look at my IM tidbits on fuzzy color thresholding and
>color/grayscale range slicing. See the relevant links on the
>following page:
>
>
>http://www.fmwconcepts.com/imagemagick/tidbits/image.php
>
>
>You basically want the opposite of what I have done, namely, to keep
>all the other colors outside the range and make transparent those
>within your range.
>
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users