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

is there any method to add text as label to tiff files using vips? #518

Open
sinamcr7 opened this issue Dec 15, 2024 · 3 comments
Open

is there any method to add text as label to tiff files using vips? #518

sinamcr7 opened this issue Dec 15, 2024 · 3 comments

Comments

@sinamcr7
Copy link

I'm making wsi images and saving them using vips, need a method to write a label to wsi images, is there anything in vips to do this? or I need to use another libraries?

@jcupitt
Copy link
Member

jcupitt commented Dec 15, 2024

Hi, use text to render text, then composite to overlay. Perhaps:

text = pyvips.Image.text("Hello <i>world!</i>", dpi=300, rgba=True)
image = image.composite(text, "over", x=200, y=500)

@sinamcr7
Copy link
Author

thanks, is it possible to change text font and font size and color?

@jcupitt
Copy link
Member

jcupitt commented Dec 16, 2024

Sure, check the documentation.

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