# PGraphics Transform Tool (Gist)

**URL:** <https://discourse.processing.org/t/pgraphics-transform-tool-gist/38285>\
**Category:** Gallery\
**Created:** [August 9, 2022, 8:41pm UTC](https://discourse.processing.org/t/pgraphics-transform-tool-gist/38285 "2022-08-09T20:41:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ignotus](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ignotus/32/14922_2.png) [@Ignotus](https://discourse.processing.org/u/Ignotus)\
**Post date:** [August 9, 2022, 8:41pm UTC](https://discourse.processing.org/t/pgraphics-transform-tool-gist/38285/1 "2022-08-09T20:41:17Z")

</div>

Having spent many hours flipping and rotating images, I decided to create a tool that might save some time. The [TransformTool](https://gist.github.com/Ignotus-mago/ac3a50dfc0e1b60fc082a66e611790c0) gist provides a class, `ImageTransform`, with methods that make it easy to do 90-degree rotations and reflections using a `PGraphics`. The sample code shows how you could do other rotations, too.

I’ve also been interested in the ways that `PGraphics` does and does not implement alpha channel transparency. The sample code creates an image file with transparency that may give an idea of the different results you can get with a call to the `PGraphics.background(<color>)` method.

I hope this proves useful.

peace,

Ignotus
