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

Add optional DPI spec for svg2png raster. E.g. " --rasterize --dpi=300 " #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

marc-wien
Copy link

Legacy behavior does not change if DPI argument is excluded. DPI argument ignored if Rasterize argument excluded.

@marc-wien
Copy link
Author

Also want to add example in Quickstart.ipynb after Out[29] but couldn't resolve merging it in easily.

Something like:

Markdown cell:

You can also set the DPI of your raster for print-quality PNG images without modifying the TikZ scale
(Note: you can also set a max render width in a JupyterLab notebook for high-DPI images to force it to fit on screen using the commented-out command in the following cell)

Code cell (intentionally commented out):

# from IPython.core.display import display, HTML
# display(HTML("<style>.jp-RenderedImage img { width: 100%; max-width: 400px }</style>"))

Code cell:

%%itikz --implicit-pic --temp-dir --rasterize --dpi=300
\draw[fill=black] (1, 1) rectangle (2, 2);
\draw[fill=black] (2, 1) rectangle (3, 2);
\draw[fill=black] (3, 1) rectangle (4, 2);
\draw[fill=black] (3, 2) rectangle (4, 3);
\draw[fill=black] (2, 3) rectangle (3, 4);

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

Successfully merging this pull request may close these issues.

1 participant