Of course, despite using a more powerful microcontroller, the miracle cannot happen. A photo from a phone will not even physically fit into the microcontroller's memory, let alone process it. Therefore, I had to write a small script in Flask, and upload it to PythonAnywhere, thereby shifting the downloading and processing of the photo onto it. The algorithm is simple: when the bot receives a message containing a photo, it sends a request to the site where my script is running, the script receives a photo (by file_id), crops it to the desired size (the printer needs 384 pixels wide), draws the text into the photo, converts it to h/b and sends back to the microcontroller in the form of bytes. The microcontroller saves the received bytes of the photo to a file and prints it to the printer. That's all the magic.
So, if you built TelegaGraph, then you do not need to make changes in the connection. You just need to update the code in the microcontroller. The project code is located in the same repository on GitHub. Also, in this repository in the www folder are files that will need to be placed on hosting on the Internet. I use PythonAnywhere because it's free. I will not explain here how to run a Flask application on this hosting, since this is not the article. There is nothing complicated, though the whole site is in English.
In the main.py file you need to specify the address of the site where you placed the script for processing the photo from the www folder. If everything is done correctly, then now your TelegaGraph will print the photo!
At the moment I have not completely figured out the print settings on the printer, so the photos are printed dimly and the text may not be visible. If anyone can tell you which parameters are correct – write, it will be great.