# Flip the image horizontally

**URL:** <https://forum.deepar.ai/t/flip-the-image-horizontally/345>\
**Category:** SDK\
**Created:** [June 21, 2023, 1:21am UTC](https://forum.deepar.ai/t/flip-the-image-horizontally/345 "2023-06-21T01:21:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mike](https://forum.deepar.ai/u/Mike)\
**Post date:** [June 21, 2023, 1:21am UTC](https://forum.deepar.ai/t/flip-the-image-horizontally/345/1 "2023-06-21T01:21:33Z")

</div>

Hi, I’m testing the shoe try-on project for an installation in which the screen needs to appear as a mirror, so that when a user walks across the frame, the video tracks in the same direction.

How can I flip the camera horizontally to achieve this effect? - So far it doesn’t look like there’s an option for ‘flip’, ‘reverse’ or similar in the api refs, and setting a scale on the canvas context gives a build error.

Cheers!  
Mike

---

<div class="post-metadata">

**Author:** ![Zak](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/zak/32/7_2.png) [@Zak](https://forum.deepar.ai/u/Zak)\
**Post date:** [June 22, 2023, 6:01pm UTC](https://forum.deepar.ai/t/flip-the-image-horizontally/345/2 "2023-06-22T18:01:51Z")

</div>

Hey @Mike

There are a couple of tricks that may solve this issue for you.

Firstly, you can try setting the DeepAR camera facing mode differently (`environment` or `user`)

```javascript
        const deepAR = await deepar.initialize({
          licenseKey: "your_license_key_here",
          canvas: document.getElementById("deepar-canvas"),
          effect: "https://demo.deepar.ai/assets/foot/airmax",
          // set camera to front-facing
          additionalOptions: {
            cameraConfig: {
              facingMode: "environment",
            },
          },
        });

```

You could also flip the canvas using CSS with `transform: rotateY(180deg)`

If neither of those work, feel free to post any relevant part of your code here or email it over at zak@deepar.ai and we can take a closer look.

Cheers!

Zak

---

<div class="post-metadata">

**Author:** ![Mike](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mike](https://forum.deepar.ai/u/Mike)\
**Post date:** [June 25, 2023, 9:21pm UTC](https://forum.deepar.ai/t/flip-the-image-horizontally/345/3 "2023-06-25T21:21:21Z")

</div>

Yes! - Both of these methods works a treat!

Thanks!
