# GamePiece image

**URL:** <https://forum.vassalengine.org/t/gamepiece-image/10212>\
**Category:** Module Discussion\
**Created:** [February 6, 2020, 3:12am UTC](https://forum.vassalengine.org/t/gamepiece-image/10212 "2020-02-06T03:12:15Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [October 10, 2024, 7:07pm UTC](https://forum.vassalengine.org/t/gamepiece-image/10212/8 "2024-10-10T19:07:50Z")

</div>

If you need a copy of a `BufferedImage`, you could do something like this:

```java
final BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
final Graphics2D g = dst.createGraphics();
g.drawImage(src, 0, 0, null);
g.dispose();

```

However, depending on what exactly you’re doing, you might want to do all of this inside an `ImageOp` so that the images you’re producing are in the image cache. It’s hard to be more specific without seeing the surrounding code for context.

BTW, [we could use some help](https://forum.vassalengine.org/t/help-convert-module-pages-to-the-new-module-library/83501) with converting pages in the current module library to the new one which will replace it.

---

_[View the full topic](https://forum.vassalengine.org/t/gamepiece-image/10212)._
