0

How to put different styles of text on image in single command cv2.text()? Example: hello WORLD

Miki
  • 40,887
  • 13
  • 123
  • 202
Sivaram Boina
  • 125
  • 1
  • 8
  • 1
    you mean `cv2.putText`? You can't. OpenCV is not meant to do this sort of things. Use any other library to draw text on your image – Miki Feb 20 '19 at 07:57
  • @Miki are you sure? I'm looking at [this question](https://stackoverflow.com/questions/16615662/how-to-write-text-on-a-image-in-windows-using-python-opencv2) and it seems it is possible. – darksky Feb 20 '19 at 08:23
  • 1
    It draws text on an image **with the same style**, but **not** different styles of text with a single function call – Miki Feb 20 '19 at 08:26
  • I show a way to use different fonts here... https://stackoverflow.com/a/53697181/2836621 – Mark Setchell Feb 20 '19 at 08:27
  • @Mark as I understand, the OP wants something to basically draw rich text. Something like `putText("hello WORLD")` – Miki Feb 20 '19 at 08:31
  • 2
    @Miki Aha, thank you, I see now. In which case, **Pango** may be an option... https://stackoverflow.com/a/51963371/2836621 – Mark Setchell Feb 20 '19 at 08:35
  • @Miki , it is simply adding text to the image as it is. – Sivaram Boina Feb 20 '19 at 08:39
  • 1
    @sivaram yes obviously. OpenCV doesn't handle rich text. See Mark's link about Pango instead – Miki Feb 20 '19 at 08:40

0 Answers0