Applying simple text to a picture API in telegram - telegram

I am developing a telegram bot that involves the process of adding a text that the user input to an existing image.
It goes like that:
The user inputs a text like his name, time, etc.
The bot adds a text layer on top of the image. (the image is constant and doesn't change).
The user gets in return from the bot the picture with the added text, in a typical image format like JPG or PNG (doesn't matter).
However I actually have no idea what kind of method or API I should use, I was thinking of something like photoshop API but it seems way too complicated and overkill. I am looking for a simple solution that is easy to learn and apply, as it is just adding a text layer on top of a picture and saving it.
I would be interested to hear how would you apply such a thing, to get ideas on how it could be done.
Thank you very much,
Shay

Related

how to provide RoI to an image being processed by text detection

I have a library of images I wish to process, and each image is of the same structure. I want to pull out the text within the images. I have this working, however there are some pieces of text that I wish to ignore. I also am hampered because the OCR isn't perfect, and gives "wrong" characters sometimes.
I have solved the problem by taking the image, cropping it into individual sub-images, and running each of those through the OCR. It is effectively creating ROIs. Because I know the locations for the text desired, this works.
Google's billing policy is based on number of images, so 6x the images processed, is not something I want to do in production.
I would like to be able to give ROI's to the scanning engine instead, as inputs when the text detection occurs. Is there a best way to achieve this?
TIA!

How can I generate a circular qr-code like a messenger or a kik code?

How can you generate the codes like shown below:
I will assume you want to use an existing standard instead of attempting to invent your own encoder\decoder.
Any 2D barcode can be intentionally damaged for esthetics if you crank up the redundancy used for error correction. 2D barcodes are designed to survive a certain amount of damage. Placing an image in the center and rounding the corners are both considered damage from the perspective of the reader. For round corners you can't use a barcode with orientation dots in the corners, like QR. You must choose a format that is oriented with a marker in the middle like:
MaxiCode
https://en.wikipedia.org/wiki/MaxiCode
ShotCode
https://en.wikipedia.org/wiki/ShotCode
Aztec Code
https://en.wikipedia.org/wiki/Aztec_Code
Similarly, if you wanted to place an image in the center then you wouldn't want to use one that requires a bullseye for orientation, unless you can retain the bullseye somehow in your central image. To place an image in the center and also round the corners you need to get creative. In your first image there are four tracking dots around the image. In the second and third examples the company uses it's own logo as the orientation point.
The first code you show is a proprietary code made by Facebook. It is now no longer used by their products, but some sites, e.g. respond.io may allow you to create them and some regular QR code scanners may be able to read them.
The second code is a Snapchat code and can be made on their site directly when you log into your account. You can also do it the the app on your device using their support instructions within limits for success.
The third code is a Kik code and there is a blog post of how to make that possible by generating a key and then downloading the code image in the color of your choice. They have more posts about how to work with them.
With all that said and done, you could try a site (not affiliated) like QR Code Go to make regular QR codes that are a little fancy. Thank you. Good day.

Qt Screenshot sharing app - How to select the area of a screen

I am trying to code an app in Qt for capturing and then sharing the screenshots. For now my application captures the screenshot, shows a preview and saves it. I am yet to do the upload part. but before that I would like to be able to select the area of the screen of which the screenshot needs to be captured.
I tried searching and I couldn't find any helpful articles or documents in Qt. So can anyone help me?
PS: The idea is to create a similar app like lightshot and several other similar tools.
Thanks in advance
There are two methods that you can use for this: -
1) Capture an image of the screen and then display that, full screen to the user, essentially allowing the user to crop the image.
2) A more commonly used method is to create a full-screen, topmost window that has no title bar and is transparent. This allows the user to drag out an area, which you can draw an outline to represent the area the user requires.
I recommend the 2nd method and creating a transparent window is simply a matter of changing the window flags, as you can see here.

Resizing the Tumblr Like button?

I am using a Tumblr like button provided by ThinkingStiff on like-button.tumblr.com and am having some problems.
I don't know if this is the right place to ask this question, but I couldn't contact ThinkingStiff through his like-button tumblr so this seemed like my best shot. First of all, I'd like to thank him for his codes on how to add a Like and Reblog button to any theme. I am using them on my blog over at shelteryou.tumblr.com and they are working wonderfully. However, as you can probably tell, the like button is a bit too big for my theme. I was wondering if there was a way to shrink it down to a more suitable size? Thank you in advance!
They use a background-image, so if you want to have a different size, you'd have to change the image resolution (or create a new image) in your favorite image editor. Then upload it to Tumblr (they provide a upload service for theme files only) or make a data URI out of it.
Then change the URL in background-image: url(…) to the new one (the first for the grey image, the second for the red one).
If you need the current images (so you can save them), copy/paste the two data URIs (everything inside the brackets) to your browser address bar.

Need an HTML view for chat window

My Qt project needs a chat window similar to Skype. Namely, the chat history window, not where the user inputs his text. I thought of using some kind of HTML view to programmatically add chat text as it comes in from the chat parties.
Some requirements:
It has to be formatted nicely, support for CSS I can apply to it..
I must have scroll control - e.g. autoscroll to the end of the chat when new chat lines come in, even if I'm currently scrolled up for some reason.
it has to allow a full mouse copy, just like skype.
Will QWebView do the hob? I did not see scroll control API, or being able to "append" new text lines. Will I have to re-create and re-submit the HTML using "setHTML" every time a new line comes through?
Any advice will be appreciated.
You may want to consider using either QTextEdit or QTextBrowser. Both of these widgets have support for HTML (though it may be somewhat limited). These widgets will allow you to append HTML line-by-line. They also inherit from QAbstractScrollArea, which provides you with access to their scroll bars. I'm not sure if they will support CSS, but they do support Qt's style sheets, which might work for you as an alternative if you can't get CSS to work. They also provide out-of-the-box copy, cut, paste, undo and redo (though you'll probably want to customize this for your case).

Resources