---
title: "save-to-disk"
description: "#### Overview This example shows how to set up a camera for live capture from the command line and save both depth and RGB frames as PNG images. #### Expected Output ![Picture7 | LIPS® Developer Documentation](https://dev.lips-hci.com/wp-content/uploads/2026/04/Picture7-1024x645.png) #### Prerequisite - [OpenCV…"
url: "https://dev.lips-hci.com/lipsedge-sdk-c/save-to-disk/"
updated: "2026-10-19"
category: "LIPSedge™ SDK 1.x / LIPSedge™ SDK Languages & Libraries / C++"
---

# save-to-disk

#### Overview

This example shows how to set up a camera for live capture from the command line and save both depth and RGB frames as PNG images.

#### Expected Output

![Picture7 | LIPS® Developer Documentation](https://dev.lips-hci.com/wp-content/uploads/2026/04/Picture7-1024x645.png)

#### Prerequisite

- [OpenCV Viewer](https://dev.lips-hci.com/lipsedge-sdk-c/opencv-viewer/)

#### Tutorial

 C++

```
if (key == 's') {
imwrite(rgb_name.str(), bgr);
        imwrite(depth_color_name.str(), depthColor);
        imwrite(depth_raw_name.str(), depth16);  // Save 16-bit PNG
```

Pressing **s** saves:

- RGB image
- Color-mapped depth image
- Raw 16-bit depth PNG
