Skip to content

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

Open
marc-wien wants to merge 2 commits intojbn:masterfrom
marc-wien:rasterize_dpi_input
Open

Add optional DPI spec for svg2png raster. E.g. " --rasterize --dpi=300 "#31
marc-wien wants to merge 2 commits intojbn:masterfrom
marc-wien:rasterize_dpi_input

Conversation

@marc-wien
Copy link
Copy Markdown

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

@marc-wien
Copy link
Copy Markdown
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