# Can not save 12-bit or 16-bit images (only 8-bit)

**URL:** <https://forum.commonvisionblox.com/t/can-not-save-12-bit-or-16-bit-images-only-8-bit/1789>\
**Category:** Programming Questions\
**Tags:** genicam, c, hyperspectral\
**Created:** [September 1, 2022, 11:38am UTC](https://forum.commonvisionblox.com/t/can-not-save-12-bit-or-16-bit-images-only-8-bit/1789 "2022-09-01T11:38:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saad](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Saad](https://forum.commonvisionblox.com/u/Saad)\
**Post date:** [September 1, 2022, 11:38am UTC](https://forum.commonvisionblox.com/t/can-not-save-12-bit-or-16-bit-images-only-8-bit/1789/1 "2022-09-01T11:38:42Z")

</div>

Hi,  
I am working with two Specim Hyperspectral cameras (FX17 and FX10). With Genicam browser I can see live stream and save images with mono12 pixel format. Then I am saving the configuration.  
In my code I am using function: (WriteImageFile(camera.getCvbImage().get(), bitmapPath.str().c\_str()) , to save images. The function is only saving the images when I set pixel format to 8-bit, otherwise it doesn’t work. Is there any option to save mono12 or perhaps 16-bit image with 4MSB as 0000?  
Getting images manually from Genicam browser is not an option because I have customized GUI and stepper motor etc…  
any help is appreciated 🙂

---

<div class="post-metadata">

**Author:** ![MandanaS](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/mandanas/32/1211_2.png) [@MandanaS](https://forum.commonvisionblox.com/u/MandanaS)\
**Post date:** [September 2, 2022, 8:55am UTC](https://forum.commonvisionblox.com/t/can-not-save-12-bit-or-16-bit-images-only-8-bit/1789/2 "2022-09-02T08:55:20Z")

</div>

Hi @Saad

I do not know with which file extension you want to save the images and which CVB Version you are using!

Considering you need more than 8 bit per pixel I would recommend to use .tif. Generally there is no problem with saving images containing more than 8 bit pixels. The image that you saved may look dark in the monitor because most of the monitors in the market are designed to display 8-bit images. To have a better view of hight-bit images you can use the “Common Vision Blox Viewer software” automatically installed with CVB installation and set the “high bit scale mode” to viewPort:

![CVBViewer](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/4/441fe26acdf5b954f7b4360e303b7302d62088b1.png)

Regardless of the pixel format setting, GenICam browser always saves the images as a 8-bit format, the idea here is to save the images as they appear in the display.

---

<div class="post-metadata">

**Author:** ![Saad](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Saad](https://forum.commonvisionblox.com/u/Saad)\
**Post date:** [September 5, 2022, 9:54am UTC](https://forum.commonvisionblox.com/t/can-not-save-12-bit-or-16-bit-images-only-8-bit/1789/3 "2022-09-05T09:54:41Z")

</div>

Thanks @MandanaS

.tif suggestion worked. In addition to that I set pixel format in genicam browser to ‘mono16’ and ‘mono12 packed’ for FX10 and FX17, respectively. And in driver configuration, both cameras were set to mono16
