So, we all know that search engines and AI have come along way over the years with facial recognition and so on. But no matter how advanced these bots are, they can still not (at the moment anyway) view an image the way a human can view one.
So having text in an image is not ideal as search engines will still struggle to understand the content on the page and in turn not know how to rank the page. Making good use of H1, H2 and H3 (where relevant) tags and paragraph text, is the best way to ensure that your page is read, understood by search engines and ranked appropriately.
So, I am going to add (because I know some of my readers are quite technical and will pick me up on this) that Google can read text in an image using their optical character recognition (OCR) filter. But there is currently no evidence they are using this technology on website crawls. You technical people can read more about this in Google documentation here: https://developers.google.com/search/docs/advanced/guidelines/google-images
I also had a customer mention to me that his old website was very slow. He was told this was due to an image on his site. Images on a page doesn't necessarily mean a slow page speed. Page speed is a ranking factor (one of over 200) that Google and other search engines do use when ranking a webpage. Saying that, it's not a deal breaker. I'm not saying don't have text in images on your site, just don't make it the main text on the page. We still need to ensure that "real" text is actually on the page in the form of H1, H2 and H3 (where relevant) tags as well as paragraph tags.