Color detection on GIF or PNG image

前端 未结 4 560
走了就别回头了
走了就别回头了 2020-12-10 23:15

We were wondering if it was possible to do something like the attached pictures.

We have a live weather radar on our website, projected on a google maps page with an

4条回答
  •  一向
    一向 (楼主)
    2020-12-10 23:50

    I would isolated the red cells by using the -fx operator.

    convert source.png -fx '(p.r > p.b && p.r > 0.9) ? p : 0' a_RED.png
    

    Detected color

    The p.r > p.b remove white colors, and the p.r > 0.9 checks the current pixel against a threshold of 0.9.

    This approach requires some extra CPU time, but does give you the ability to adjust the degree of severity.

提交回复
热议问题