# Saving a Pixel Container File

## Images and depth maps

* Use the method [`EBaseROI::Save`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#afda2dc66ee1dd71c3d164b4986003cb5) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a3d3a7b24cb090eebc6e662551b23a069) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a78024e4eac82a8bc01631be654073b25) of an image or the method [`EFourierImage::SaveImage`](../../../doxygen_cpp/classeVision_1_1EFourierImage.html#a5b2d8b63038d9982c32719007c1c8711) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EFourierImage.html#a7d65a36367256d53f0a84cb0413ea7ec) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EFourierImage.html#a60575ddc50b97c11ea880116988b2b8e) of a depth map or a ZMap to save image data of the object into a file.
  * The argument `Path` includes the path, file name and file name extension.
  * The argument `Image File Type` can be omitted. In this case, the file name extension is used.
* [`EBaseROI::Save`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#afda2dc66ee1dd71c3d164b4986003cb5) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a3d3a7b24cb090eebc6e662551b23a069) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a78024e4eac82a8bc01631be654073b25) throws an exception when:
  * The requested image file format is incompatible with the pixel type of the image object.
  * The file name extension is not supported while using the `Auto` file type selection method.

#### NOTE
When saving a 16-bit depth map, the fixed point precision is lost and the pixels are considered as 16-bit integers.

#### TIP
The images with a width or a height larger than 65,536 must be saved in **eVision** proprietary format.

## `Image File Type` arguments

| Argument                                                                                                                                                                                                                                                                                  | Image file type                                                           |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| [`EImageFileType_Auto`](../../../doxygen_cpp/namespaceeVision.html#ab9401d84d849ea12c82d1a9d0206814c) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#a940d37a5ba827facc9777015c0e49ad4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageFileType.html)     | (Default) Automatically determined by the file name extension. See below. |
| [`EImageFileType_Euresys`](../../../doxygen_cpp/namespaceeVision.html#ab9401d84d849ea12c82d1a9d0206814c) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#a940d37a5ba827facc9777015c0e49ad4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageFileType.html)  | **eVision** Serialization                                                 |
| [`EImageFileType_Bmp`](../../../doxygen_cpp/namespaceeVision.html#ab9401d84d849ea12c82d1a9d0206814c) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#a940d37a5ba827facc9777015c0e49ad4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageFileType.html)      | Windows bitmap - BMP                                                      |
| [`EImageFileType_Jpeg`](../../../doxygen_cpp/namespaceeVision.html#ab9401d84d849ea12c82d1a9d0206814c) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#a940d37a5ba827facc9777015c0e49ad4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageFileType.html)     | JPEG File Interchange Format - JFIF                                       |
| [`EImageFileType_Jpeg2000`](../../../doxygen_cpp/namespaceeVision.html#ab9401d84d849ea12c82d1a9d0206814c) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#a940d37a5ba827facc9777015c0e49ad4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageFileType.html) | JPEG 2000 File format / Code Stream - JPEG2000                            |
| [`EImageFileType_Png`](../../../doxygen_cpp/namespaceeVision.html#ab9401d84d849ea12c82d1a9d0206814c) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#a940d37a5ba827facc9777015c0e49ad4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageFileType.html)      | Portable Network Graphics - PNG                                           |
| [`EImageFileType_Tiff`](../../../doxygen_cpp/namespaceeVision.html#ab9401d84d849ea12c82d1a9d0206814c) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#a940d37a5ba827facc9777015c0e49ad4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageFileType.html)     | Tagged Image File Format - TIFF                                           |

If the argument is [`EImageFileType_Auto`](../../../doxygen_cpp/namespaceeVision.html#ab9401d84d849ea12c82d1a9d0206814c) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#a940d37a5ba827facc9777015c0e49ad4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageFileType.html) or is missing, the assigned image file type is:

| File name extension (case-insensitive)   | Assigned image file type            |
|------------------------------------------|-------------------------------------|
| `BMP`                                    | Windows Bitmap format               |
| `JPEG` or `JPG`                          | JPEG File Interchange Format - JFIF |
| `JP2`                                    | JPEG 2000 file format               |
| `J2K` or `J2C`                           | JPEG 2000 Code Stream               |
| `PNG`                                    | Portable Network Graphics           |
| `TIFF` or `TIF`                          | Tagged Image File Format            |

## Saving JPEG and JPEG2000 lossy compressions

[`EBaseROI::SaveJpeg`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#a4703bc26bd405d7b3ac6c11d26bac9a7) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#ae4906e82b3a6e37caab4d28c6f79cba0) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a53b8c101cf7af9192e0a4934849090da) and [`EBaseROI::SaveJpeg2K`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#ac53e554a940483e0b835ceca93218973) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#ad2e1b3a09ec95625780ef1c787329de0) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a39704a9a773e8a1013c8f46662088150) specify the compression quality when saving ([`EBaseROI::Save`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#afda2dc66ee1dd71c3d164b4986003cb5) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a3d3a7b24cb090eebc6e662551b23a069) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a78024e4eac82a8bc01631be654073b25)) compressed images. They have two arguments:

* Path: a string of characters including the path, filename, and file name extension.
* Compression quality of the image file, an integer value in range [0: 100].<br />
  \\\\
  [`EBaseROI::SaveJpeg`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#a4703bc26bd405d7b3ac6c11d26bac9a7) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#ae4906e82b3a6e37caab4d28c6f79cba0) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a53b8c101cf7af9192e0a4934849090da) saves image data using JPEG File Interchange Format – JFIF.<br />
  \\\\
  [`EBaseROI::SaveJpeg2K`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#ac53e554a940483e0b835ceca93218973) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#ad2e1b3a09ec95625780ef1c787329de0) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a39704a9a773e8a1013c8f46662088150) saves image data using JPEG 2000 File format.

### JPEG compression values

| JPEG compression          | Description                                     |
|---------------------------|-------------------------------------------------|
| JPEG_DEFAULT_QUALITY (-1) | Default quality (\*)                            |
| 100                       | Superb image quality, lowest compression factor |
| 75                        | Good image quality (\*)                         |
| 50                        | Normal image quality                            |
| 25                        | Average image quality                           |
| 10                        | Bad Image quality                               |

### Representative JPEG 2000 compression quality values

|   JPEG 2000 compression | Description                                      |
|-------------------------|--------------------------------------------------|
|                      -1 | Default quality (\*)                             |
|                       1 | Highest image quality, lowest compression factor |
|                      16 | Good Image Quality (\*) (16:1 rate)              |
|                     512 | Lowest image quality, highest compression factor |

## Saving point clouds

Use the following methods to save a point cloud in a specific format:

* [`EPointCloud::Save`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPointCloud.html#aacbbd2dbf6e97cd2c1890a26d0e9a09c) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPointCloud.html#ace7f6ad42ea23a23160eb28b43b0ddf9) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPointCloud.html#a697eb335756f010c4a22c24cf221bddc): **eVision** proprietary file format.
* [`EPointCloud::SaveCSV`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPointCloud.html#aa49f2d38e39cb055df0fe547efaeef2b) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPointCloud.html#a3a756ac1a0e2424194a30676bd2353b9) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPointCloud.html#a61b591636c8ea863610650f81f7f0d03): CSV file.
* [`EPointCloud::SaveOBJ`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPointCloud.html#a0c070b0431ead3e32cb35fd1eef531f6) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPointCloud.html#a9538e024a767a88d7d394569df038d5e) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPointCloud.html#a99fb80c1106ed6a49f280165f2157b8b): OBJ file.
* [`EPointCloud::SavePCD`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPointCloud.html#a8cb1d2b486d3d893495521d017fee539) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPointCloud.html#a0f77ae5ab94f3c0dbe005cb2f2de55ce) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPointCloud.html#a5d2b9f3661d3a449df729aa48d4ed807): PCD file.
* [`EPointCloud::SavePLY`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPointCloud.html#a40b45e19bd07e9e99ae8b729b35f6159) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPointCloud.html#a6285366329dccae374574bf7ff68e525) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPointCloud.html#a45d1ec0ede885f6a34ae2f8702ce86fc): PLY file.
* [`EPointCloud::SaveXYZ`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPointCloud.html#a95b918d672e58613988cbc12d20bd851) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPointCloud.html#affb56645044cc10eab7fc01a4068e183) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPointCloud.html#ab2431021993c44b56889b2c328ee3167): XYZ file.

#### TIP
The PCD and PLY formats are supported in ASCII and binary modes.<br />
\\\\
The PCD format is also supported in binary compressed mode.
