<a id="pixel-containers-and-files"></a>

# Pixel Containers and Files

<a id="pixel-container-definition"></a>

## Pixel Container Definition

<a id="image-objects"></a>

### Image Objects

The **eVision** image objects contain image data that represents rectangular images.

Each image object has a data buffer, accessible via a pointer, where pixel values are stored contiguously, row by row.

![image](assets/images/getting_started/imagesize.svg)

<a id="image-main-parameters"></a>

### Image Main Parameters

The rectangular array of pixels of an **eVision** image object is characterized by the [`EBaseROI`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html) parameters:

* The [`EBaseROI::GetWidth`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#a59510c9bd296116be24733a7ac9442fc) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a7dc7043bd5a463d7176c40ca2dea1953) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a0ea6d101c697843cf6d50226b330aa08) is the number of pixels per row of the image.
* The [`EBaseROI::GetHeight`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#a9780cb061a87ca0c001c936589047d34) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a0bfcc0aede828f3bf65c4135fce44d20) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a9e5ded3cddea01887fe6323532183133) is the number of rows of the image.
* The [`EBaseROI::SetSize`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#a8446337051c589320cfd2ea1fcbe6d16) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a87cfe59bbf851719b3f65d6766f71dba) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a43f0fddfd46389cc8b95d9ccb608a909) allow to set both the [`EBaseROI::GetWidth`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#a59510c9bd296116be24733a7ac9442fc) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a7dc7043bd5a463d7176c40ca2dea1953) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a0ea6d101c697843cf6d50226b330aa08) and [`EBaseROI::GetHeight`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#a9780cb061a87ca0c001c936589047d34) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a0bfcc0aede828f3bf65c4135fce44d20) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a9e5ded3cddea01887fe6323532183133).
* The [`EBaseROI::GetBitsPerPixel`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#a98e3790bc3ada6baf52717a7b1af905e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a946fa8721bd29b9462313c1d2650b01c) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a5728836dc45bc6ea1cc379077245a4c9) is the number of storage bits per pixel.
* The [`EBaseROI::GetRowPitch`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html#ab6df6e7945120110b8f0f3309833c397) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html#a41387e2f06ac6ad66a4bc415cc980f5f) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html#a5b947ef637afc533fa21c7623a05389c) is the number of bytes between two vertically adjacent pixels. It is always bigger than `Width × (BitsPerPixel / 8)`.

#### WARNING
* The maximum size for the row pitch and the height are 2,147,483,647 (2³¹-1).\\
* The maximum size for the width is the maximum size for the row pitch divided by the number of storage bytes per pixel (`8 × BitsPerPixel`).

* The [`EPlaneCropper::GetPlane`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPlaneCropper.html#ad5a701096494d07073cce5b86ce5ae70) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPlaneCropper.html#a368f91f21bfd46e26f139d5c6832aae3) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPlaneCropper.html#aa67a64f82a75162c53ebc5954f78098b) contains the number of color components.
  * For gray-level images: [`EPlaneCropper::GetPlane`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPlaneCropper.html#ad5a701096494d07073cce5b86ce5ae70) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPlaneCropper.html#a368f91f21bfd46e26f139d5c6832aae3) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPlaneCropper.html#aa67a64f82a75162c53ebc5954f78098b) = 1
  * For color images: [`EPlaneCropper::GetPlane`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPlaneCropper.html#ad5a701096494d07073cce5b86ce5ae70) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPlaneCropper.html#a368f91f21bfd46e26f139d5c6832aae3) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPlaneCropper.html#aa67a64f82a75162c53ebc5954f78098b) = 3

<a id="classes"></a>

### Classes

The image and ROI classes derive from the abstract class [`EBaseROI`](../../../doxygen_cpp/classeVision_1_1EBaseROI.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EBaseROI.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EBaseROI.html) and inherit all its properties.

![image](assets/images/getting_started/ebaseroiinheritance.svg)

#### SEE ALSO
For the enumeration of the available types, see [`EImageType`](../../../doxygen_cpp/namespaceeVision.html#ae92dcbfbd112246ab5f719eb21325063) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#ac1a52485aa7956d8f60b4c65b454c7b0) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageType.html) Enum.

**eVision** supports the following image types according to their pixel types.

| eVision   | Genicam PNFC   | Definition                                                                                                            | Class                                                                                                                                                                                                                       |
|-----------|----------------|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **BW8**   | Mono8          | 8-bit grayscale image (each pixel is stored in 1 byte).                                                               | [`EImageBW8`](../../../doxygen_cpp/classeVision_1_1EImageBW8.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EImageBW8.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageBW8.html)        |
| **BW16**  | Mono16         | 16-bit grayscale image (each pixel is stored in 2 bytes).                                                             | [`EImageBW16`](../../../doxygen_cpp/classeVision_1_1EImageBW16.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EImageBW16.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageBW16.html)    |
| **BW32**  | Mono32         | 32-bit grayscale image (each pixel is stored in 4 bytes).                                                             | [`EImageBW32`](../../../doxygen_cpp/classeVision_1_1EImageBW32.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EImageBW32.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageBW32.html)    |
| **BW32f** | x              | Gray-level pixel value, coded as a 32-bit floating-point number (each pixel is stored in 4 bytes).                    | [`EImageBW32f`](../../../doxygen_cpp/classeVision_1_1EImageBW32.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EImageBW32f.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageBW32f.html) |
| **C24**   | RGB8           | 24-bit color image (each pixel is stored in 3 bytes).<br/><br/>Compatible with Microsoft® Windows RGB24 color images. | [`EImageC24`](../../../doxygen_cpp/classeVision_1_1EImageC24.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EImageC24.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageC24.html)        |
| **C24A**  | RGBa8          | 32-bit color image (each pixel is stored in 4 bytes).<br/><br/>Compatible with Microsoft® Windows RGB32 color images. | [`EImageC24A`](../../../doxygen_cpp/classeVision_1_1EImageC24A.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EImageC24A.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageC24A.html)    |
| **C48**   | RGB16          | 48-bit color image (each pixel is stored in 6 bytes).<br/><br/>Compatible with Microsoft® Windows RGB48 color images. | [`EImageC48`](../../../doxygen_cpp/classeVision_1_1EImageC48.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EImageC48.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageC48.html)        |

#### NOTE
[`Easy::GetBestMatchingImageType`](../../../doxygen_cpp/classeVision_1_1Easy.html#ae9ad6bcd9423e74729153aff8e0b4108) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy.html#aa47d76f79ac1e54505c4260db99011e6) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy.html#af1f46340ff269d28838d9d74ba514169) returns the best matching image type for a given file on disk.

<a id="depth-maps"></a>

### Depth Maps

A **depth map** represents a 3D object using a 2D grayscale image in which each pixel represents a 3D point.

* The pixel coordinates are the X and Y coordinates of the point.
* The gray value of the pixel is a representation of the Z coordinate of the point.

![image](assets/images/easy3d/basic_concepts_1.webp)

| eVision       | Genicam PNFC   | Definition                                                                   | Class                                                                                                                                                                                                                                                          |
|---------------|----------------|------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **EDepth8**   | Coord3D_C8     | 8-bit depth map<br/><br/>(each pixel is stored in 1 byte as an integer)      | [`EDepthMap8`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EDepthMap8.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EDepthMap8.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EDepthMap8.html)         |
| **EDepth16**  | Coord3D_C16    | 16-bit depth map<br/><br/>(each pixel is stored in 2 bytes as a fixed point) | [`EDepthMap16`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EDepthMap16.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EDepthMap16.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EDepthMap16.html)     |
| **EDepth32f** | Coord3D_C32f   | 32-bit depth map<br/><br/>(each pixel is stored in 4 bytes as a float)       | [`EDepthMap32f`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EDepthMap32f.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EDepthMap32f.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EDepthMap32f.html) |

#### NOTE
8 and 16-bit depth map values are stored in buffers compatible with the 2D **eVision** images.

<a id="point-clouds"></a>

### Point Clouds

A **point cloud** is an unstructured set of 3D points representing discrete positions on the surface of an object.

The point clouds are produced by various 3D scanning techniques, such as laser triangulation, time of flight or structured lighting.

For details, see, for example, [en.wikipedia.org/wiki/Point_cloud](https://en.wikipedia.org/wiki/Point_cloud).

![image](assets/images/easy3d/basic_concepts_2.webp)

| eVision         | Genicam PNFC   | Definition                                                                           | Class                                                                                                                                                                                                                                                      |
|-----------------|----------------|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Point Cloud** | Coord3D_ABC32  | Set of points coordinates<br/><br/>(each coordinate is stored in 4 bytes as a float) | [`EPointCloud`](../../../doxygen_cpp/classeVision_1_1Easy3D_1_1EPointCloud.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1Easy3D_1_1EPointCloud.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1Easy3D_1_1EPointCloud.html) |

<a id="supported-image-file-types"></a>

## Supported Image File Types

#### SEE ALSO
For the enumeration of the available types, see [`EImageFileType`](../../../doxygen_cpp/namespaceeVision.html#ab9401d84d849ea12c82d1a9d0206814c) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#a940d37a5ba827facc9777015c0e49ad4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageFileType.html) Enum.

| Type           | Description                                                                                                                                                                                                                                                                                                                                                                                       |
|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **BMP**        | Uncompressed image data format (Windows Bitmap Format).                                                                                                                                                                                                                                                                                                                                           |
| **JPEG**       | A lossy data compression standard issued by the **Joint Photographic Expert Group** registered as ISO/IEC 10918-1. The compression irretrievably loses quality.                                                                                                                                                                                                                                   |
| **JFIF**       | JPEG File Interchange Format.                                                                                                                                                                                                                                                                                                                                                                     |
| **JPEG-2000**  | A data compression standard issued by the **Joint Photographic Expert Group** registered as ISO/IEC 15444-1 and ISO/IEC 15444-2.<br/><br/>**eVision** supports only lossy compression format, file format and code stream variants.<br/><br/>* The **code stream** describes the image samples.<br/>* The **file format** includes meta-information such as the image resolution and color space. |
| **PNG**        | Lossless data compression method (Portable Network Graphics).                                                                                                                                                                                                                                                                                                                                     |
| **Serialized** | The **Euresys** proprietary image file format obtained from the **serialization** of **eVision** image objects.                                                                                                                                                                                                                                                                                   |
| **TIFF**       | The **Tag Image File Format** is currently controlled by **Adobe Systems** and uses the LibTIFF third-party library to process images written for the 5.0 or 6.0 TIFF specification.<br/><br/>* The file **save** operations are lossless and save the images without any compression.<br/>* The file **load** operations support all the TIFF variants listed in the LibTIFF specification.      |

#### WARNING
Some image file types may contain EXIF metadata indicating the orientation or cropping of the image. These metadata are not taken into consideration when opening an image.

<a id="color-types"></a>

## Color Types

**eVision** supports the following color systems:

| Type                                                                                                                                                                                               | Description                     |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [`EISH`](../../../doxygen_cpp/structeVision_1_1EISH.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1EISH.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EISH.html) | Intensity, Saturation, Hue      |
| [`ELAB`](../../../doxygen_cpp/structeVision_1_1ELAB.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1ELAB.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1ELAB.html) | CIE Lightness, a\*, b\*         |
| [`ELCH`](../../../doxygen_cpp/structeVision_1_1ELCH.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1ELCH.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1ELCH.html) | Lightness, Chroma, Hue          |
| [`ELSH`](../../../doxygen_cpp/structeVision_1_1ELSH.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1ELSH.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1ELSH.html) | Lightness, Saturation, Hue      |
| [`ELUV`](../../../doxygen_cpp/structeVision_1_1ELUV.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1ELUV.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1ELUV.html) | CIE Lightness, u\*, v\*         |
| [`ERGB`](../../../doxygen_cpp/structeVision_1_1ERGB.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1ERGB.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1ERGB.html) | NTSC/PAL/SMPTE Red, Green, Blue |
| [`EVSH`](../../../doxygen_cpp/structeVision_1_1EVSH.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1EVSH.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EVSH.html) | Value, Saturation, Hue          |
| [`EXYZ`](../../../doxygen_cpp/structeVision_1_1EXYZ.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1EXYZ.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EXYZ.html) | CIE XYZ                         |
| [`EYIQ`](../../../doxygen_cpp/structeVision_1_1EYIQ.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1EYIQ.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EYIQ.html) | CCIR Luma, Inphase, Quadrature  |
| [`EYSH`](../../../doxygen_cpp/structeVision_1_1EYSH.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1EYSH.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EYSH.html) | CCIR Luma, Saturation, Hue      |
| [`EYUV`](../../../doxygen_cpp/structeVision_1_1EYUV.html) [<sub>.NET</sub>](../../../doxygen_cs/structeVision_1_1EYUV.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EYUV.html) | CCIR Luma, U Chroma, V Chroma   |

<a id="pixel-and-file-types-compatibility"></a>

## Pixel and File Types Compatibility

For the compatible combinations in the following table, the image integrity is preserved with no data loss (except from JPEG and JPEG2000 with lossy compression).

The other combinations are not supported and an exception occurs if you use them.

| Type         | BMP   | JPEG   | JPEG2000   | PNG   | TIFF   | Serialized   |
|--------------|-------|--------|------------|-------|--------|--------------|
| **BW8**      | ✓     | ✓      | ✓          | ✓     | ✓      | ✓            |
| **BW16**     | –     | –      | ✓          | ✓     | ✓ ¹    | ✓            |
| **BW32**     | –     | –      | –          | –     | ✓ ¹    | ✓            |
| **BW32f**    | –     | –      | –          | –     | –      | ✓            |
| **C24**      | ✓     | ✓      | ✓          | ✓     | ✓      | ✓            |
| **C24A**     | ✓     | –      | –          | ✓     | –      | ✓            |
| **C48**      | –     | –      | –          | ✓     | ✓ ¹    | ✓            |
| **Depth8**   | ✓     | ✓      | ✓          | ✓     | ✓      | ✓            |
| **Depth16**  | –     | –      | ✓          | ✓     | ✓ ¹    | ✓            |
| **Depth32f** | –     | –      | –          | –     | –      | ✓            |
* ✓ ¹ : BW16 and BW32 are not supported by Baseline TIFF readers.
