# Print Ready Sketch Py5

**URL:** <https://discourse.processing.org/t/print-ready-sketch-py5/36094>\
**Category:** p5py\
**Created:** [April 3, 2022, 3:47pm UTC](https://discourse.processing.org/t/print-ready-sketch-py5/36094 "2022-04-03T15:47:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweetart](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sweetart](https://discourse.processing.org/u/sweetart)\
**Post date:** [April 3, 2022, 3:47pm UTC](https://discourse.processing.org/t/print-ready-sketch-py5/36094/1 "2022-04-03T15:47:45Z")

</div>

Dear All,

I started to use Py5 ([https://py5.ixora.io/](https://py5.ixora.io/)). Creating static and dynamic visual is going according to plan and I’m very happy with the Python version of Processing. However still one (important) challenge remains before starting to use Py5 full swing and add it to my drawing pipeline: creating a print-ready export.

I’m aware of multiple tutorials on this topic, for example:

> **[Print](https://processing.org/tutorials/print/)**
>
> Use Processing to output print quality images and documents.

> **[Exporting High-Resolution Images in Processing](https://sighack.com/post/exporting-high-resolution-images-in-processing)**
>
> A tutorial on two simple ways to export high-resolution images of your artwork in Processing.

I have seen examples with PGraphics. However all of them are based on other implementations of processing.

I also looked at the ‘PY5 Magics’ but they seem to server other purposes. Or I’m mistaking?

Question 1: Is their an example on how to create print ready sketches (static – via setup as well as dynamic – via draw)?

Question 2: If there are no examples which road would be the one to follow to get this done?

---

<div class="post-metadata">

**Author:** ![hx2A](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hx2a/32/14322_2.png) [@hx2A](https://discourse.processing.org/u/hx2A)\
**Post date:** [April 3, 2022, 7:56pm UTC](https://discourse.processing.org/t/print-ready-sketch-py5/36094/2 "2022-04-03T19:56:05Z")

</div>

Hi @sweetart !

It is possible to create high resolution images with py5, but perhaps the documentation and tutorials for how to do so are a bit lacking. Since py5 is internally using the Processing jars, it should be able to do all the things Processing can do. Let’s talk about this and come up with a good way to do this that fits in your workflow.

First, you mentioned the py5 magics. Did you see the [%%py5drawsvg](http://py5.ixora.io/reference/py5magics_py5drawsvg.html) and [%%py5drawpdf](http://py5.ixora.io/reference/py5magics_py5drawpdf.html) magics? Both can be used to create svg and pdf files (ie vector graphics).

The other examples in the “Print” tutorial you cited use Processing’s `beginRecord()` method. py5 also has this feature, called [`begin_record()`](http://py5.ixora.io/reference/sketch_begin_record.html).

You can also use [`create_graphics()`](http://py5.ixora.io/reference/sketch_create_graphics.html) to create a large off-screen buffer.

Does one of these options look like it would be a good fit for you?

---

<div class="post-metadata">

**Author:** ![sweetart](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sweetart](https://discourse.processing.org/u/sweetart)\
**Post date:** [April 5, 2022, 4:59am UTC](https://discourse.processing.org/t/print-ready-sketch-py5/36094/3 "2022-04-05T04:59:04Z")

</div>

Hi @hx2A,

Thank you for your answer. The documentation might be a little bit challenging when you have no ‘real’ idea to start with this issue. I think the documentation in general is very cgood.

The PY5 Magics do not seem to integrate with my workflow. However, later this week I will try how they work and see what the result is.

I implemented a ‘quick-and-dirty’ begin\_record. Which now works with a PDF but I get an empty SVG. But this might have something todo with pixels versus vectors or the use photos? I will also check this out later this week.

The create\_graphics puzzles me the most. Because it seems I have to adjust all the code to get this to work.

When I did some experimenting I will come back to this thread.

---

<div class="post-metadata">

**Author:** ![hx2A](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hx2a/32/14322_2.png) [@hx2A](https://discourse.processing.org/u/hx2A)\
**Post date:** [April 6, 2022, 12:06pm UTC](https://discourse.processing.org/t/print-ready-sketch-py5/36094/4 "2022-04-06T12:06:21Z")

</div>

I recommend making some small prototypes to explore the different options. With the `begin_record()` approaches, try making something small that just draws a rectangle to verify that you are getting the output you expect and that you understand how to use it. Once that works, add more complexity to it.

> [@sweetart](#):
>
> The create\_graphics puzzles me the most. Because it seems I have to adjust all the code to get this to work.

Yes, using `create_graphics()` can involve changing a lot of code but that approach works very well. Your question gives me an idea though for a feature to add to a future version of py5…
