Calculate the average colour of an area in an image

后端 未结 3 666
面向向阳花
面向向阳花 2021-02-04 12:56

The goal is to lay a caption on top of an image and set the text colour to one that will contrast with the background it is positioned on top of. To that end, I wish to calculat

3条回答
  •  醉话见心
    2021-02-04 13:26

    Expanding on Bonzo’s answer. This is an example command

    convert Y82IirS.jpg -resize 1x1 txt:
    

    Result

    # ImageMagick pixel enumeration: 1,1,255,srgb
    0,0: (220,176, 44)  #DCB02C  srgb(220,176,44)
    

    Average colour of an image

提交回复
热议问题