Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help! How to add text on the generated image #25

Open
willswordh opened this issue Oct 3, 2023 · 2 comments
Open

Need help! How to add text on the generated image #25

willswordh opened this issue Oct 3, 2023 · 2 comments

Comments

@willswordh
Copy link

I want to add text upon the original image with bounding box. It seems the st_cropper auto-generates the pic with bounding box and the cropped image. Is there any way I can add text on these pics without displaying them one more time using st.image? Thanks!!!

@turner-anderson
Copy link
Owner

I'm not sure what you mean by this. If you want to add text, I imagine you could use PIL to add text to the image either before or after cropping. I don't think it would be realistic to add text during cropping.

If you are using PIL to add text before or after, you may need to save and then re-open the image. If my memory is correct, the draw object doesn't actually write to the image until you save it.

@willswordh
Copy link
Author

willswordh commented Oct 5, 2023

@turner-anderson Thanks for your help! I actually want to add text on the original image with the cropping bounding box. In this case this image is one of the outputs from st_cropper. But I feel like the image with bounding box and the cropped image are auto-generated by st_cropper, so I can't directly use PIL to add text upon it. Could you help me with it? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants