# Cropping bitmap data

**URL:** <https://phaser.discourse.group/t/cropping-bitmap-data/6421>\
**Category:** Phaser 2 / CE\
**Created:** [May 24, 2020, 7:46pm UTC](https://phaser.discourse.group/t/cropping-bitmap-data/6421 "2020-05-24T19:46:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Hastings](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@Paul\_Hastings](https://phaser.discourse.group/u/Paul_Hastings)\
**Post date:** [May 24, 2020, 7:46pm UTC](https://phaser.discourse.group/t/cropping-bitmap-data/6421/1 "2020-05-24T19:46:39Z")

</div>

I am creating a bitmap data object that I’m using to save an image to the user drive. I can take an image of the canvas and save it fine but how do I go about cropping the image. Here is how I’m getting the image:

this.bmd = this.game.add.bitmapData(588, 496);  
this.bmd.drawGroup(this.savegroup);

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [May 24, 2020, 8:22pm UTC](https://phaser.discourse.group/t/cropping-bitmap-data/6421/2 "2020-05-24T20:22:26Z")

</div>

Cropping how? Removing transparent pixels?

---

<div class="post-metadata">

**Author:** ![Paul\_Hastings](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@Paul\_Hastings](https://phaser.discourse.group/u/Paul_Hastings)\
**Post date:** [May 24, 2020, 8:25pm UTC](https://phaser.discourse.group/t/cropping-bitmap-data/6421/3 "2020-05-24T20:25:02Z")

</div>

@samme No. I want the top left of the image to start at (150,150) instead of (0,0)

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [May 25, 2020, 3:13am UTC](https://phaser.discourse.group/t/cropping-bitmap-data/6421/4 "2020-05-25T03:13:04Z")

</div>

Try

```javascript
this.bmd.move(-150, -150, false);

```

---

<div class="post-metadata">

**Author:** ![Paul\_Hastings](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@Paul\_Hastings](https://phaser.discourse.group/u/Paul_Hastings)\
**Post date:** [May 25, 2020, 4:21am UTC](https://phaser.discourse.group/t/cropping-bitmap-data/6421/5 "2020-05-25T04:21:19Z")

</div>

@samme Thank you. That worked perfect.
