-
Notifications
You must be signed in to change notification settings - Fork 233
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
How to set DPI in the minimal example #526
Comments
I should improve |
Thank you for explaining! I would like to increase the DPI of the produced PNGs. Right now, the minimal example outputs PNGs with DPI of 72 pixels/inch. Is it possible to increase it? |
It's not possible and doesn't really makes sense. Why would you want this? |
I am sorry -- I know very little about these things. I just want to generate sharper PNGs. For example, when I export my artwork in Adobe Illustrator, I can set image resolution by specifying PPI. I want to be able to do the same for the artwork I generate programmatically in Rust. |
PNG is a raster format, it has a fixed "resolution". I'm not sure how Illustrator loads PNGs and if it cares about the DPI property, but you can try rendering your SVG at higher resolution. Like While PNG indeed has a "resolution"/DPI property, it has nothing to do with SVG DPI and cannot be written at the moment anyway, because the |
I see -- thank you so much for explaining! |
Is it possible to set dpi for the output png file in the minimal example?
Adding
opt.dpi = 300.0;
on line 12 did not seem to affect the output.I am sorry for such a basic question. I am completely new to resvg and image processing in general.
The text was updated successfully, but these errors were encountered: