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

DPI / resolution of rasterized PNGs #422

Open
devth opened this issue Oct 20, 2020 · 2 comments
Open

DPI / resolution of rasterized PNGs #422

devth opened this issue Oct 20, 2020 · 2 comments
Labels
📖 documentation ❔ question Further information is requested

Comments

@devth
Copy link

devth commented Oct 20, 2020

Is there a way to increase DPI of PNGs that Kroki produces?

I tried the kroki cli with the OO Graph example:

kroki convert test/oo.dot -o out.jpg

This produces a super low-res PNG:

image

Thanks for the amazing lib / service!

@ggrossetie
Copy link
Member

ggrossetie commented Oct 20, 2020

Hey @devth thanks for your kind words!

You can configure the DPI using the dpi attribute in your diagram: https://graphviz.org/doc/info/attrs.html#d:dpi

graph G { 
  graph [ dpi = 300 ]; 
  /* The rest of your graph here. */ 
}

Here's an example:

Default DPI 300 DPI

It might be worth to document it... 🤔

If you want more control, I guess you could export the diagram to SVG and then post-process it to create a high-resolution png.

@ggrossetie ggrossetie added ❔ question Further information is requested 📖 documentation labels Oct 20, 2020
@devth
Copy link
Author

devth commented Oct 20, 2020

Awesome! Thank you. I didn't find that when googling around so it might be worth documenting.

@devth devth closed this as completed Oct 20, 2020
@devth devth reopened this Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation ❔ question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants