![]() ![]() You might need to put some extra effort to calculate font size. ![]() So your code will look something similar to: from PIL import Image # font-file should be present in provided path.įont = uetype("sans-serif.ttf", 16) Just check what font type and size is appropriate for you and use following function to change font values. I think ImageFont module available in PIL should be helpful in solving text font size problem. I want to write text on image when user clicks and save it on the image. Should i place it inside a form so i can get coordinates of textarea on image? Its the image being edited var count = 0 Īlso the text area is position:absolute and fixed size. Is there a better way than using PIL? I am not entirely sure, If this is the best implementation. How can i make it multiline in image also, using PIL? How can I achieve the same size of text when using PIL as the one on the textarea? I mean the text on the textarea is very big in px. ![]() But I think there is some difference when I try it using Python Shell and in web environment. So I tried couple of examples to see how it works and I managed to write text on an image. Which should be added on Image.Īfter doing some research on it, I figured that PIL (Python Imaging Library ) can help me do this. I have an application that loads an Image and when the user clicks it, a text area appears for this Image (using jquery), where user can write some text on the Image. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |