# TIFF compression not working?

**URL:** <https://forum.commonvisionblox.com/t/tiff-compression-not-working/1373>\
**Category:** Python API\
**Created:** [March 17, 2021, 4:06pm UTC](https://forum.commonvisionblox.com/t/tiff-compression-not-working/1373 "2021-03-17T16:06:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![h.lenz](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@h.lenz](https://forum.commonvisionblox.com/u/h.lenz)\
**Post date:** [March 17, 2021, 4:06pm UTC](https://forum.commonvisionblox.com/t/tiff-compression-not-working/1373/1 "2021-03-17T16:06:27Z")

</div>

I’m a complete Python and CVB beginner, so please be kind 🙂

I just installed the current version of CVB (13.03.002 [x64]), Python 3.8.8 and the wheels package from the aforementioned CVB package (cvb-1.2-cp35.cp36.cp37.cp38-none-win\_amd64.whl) and started playing with TIFF images being read and written.

Now I’m wondering about the size of the files, as the [documentation](https://help.commonvisionblox.com/NextGen/14.0/md_theory_of_operation_image_manager__image_manager.html#imgmchmtopic16) states, that those are always written “using lossless LZW77 compression”. Instead they have the full size of the image as the equal BMP image has. If I save the very same source image using IrfanView or GIMP and saving with LZW compression their size is reduced to less than a third of the original, uncompressed size.

So how do I achieve writing a LZW compressed TIFF file to be written?

---

<div class="post-metadata">

**Author:** ![illusive](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/illusive/32/61_2.png) [@illusive](https://forum.commonvisionblox.com/u/illusive)\
**Post date:** [March 19, 2021, 7:58am UTC](https://forum.commonvisionblox.com/t/tiff-compression-not-working/1373/2 "2021-03-19T07:58:53Z")

</div>

Hi @h.lenz

> [@h.lenz](#):
>
> I’m a complete Python and CVB beginner, so please be kind

😃 welcome and don’t worry, people are pretty civilized here…

> [@h.lenz](#):
>
> Now I’m wondering about the size of the files, as the [documentation](https://help.commonvisionblox.com/NextGen/14.0/md_theory_of_operation_image_manager__image_manager.html#imgmchmtopic16) states, that those are always written “using lossless LZW77 compression”. Instead they have the full size of the image as the equal BMP image has. If I save the very same source image using IrfanView or GIMP and saving with LZW compression their size is reduced to less than a third of the original, uncompressed size.

Sorry, that bit was outdated (and will be corrected soon I guess 😉). This used to be the case until we noticed a problem in libtiff when saving LZW77 compressed RGB48 images (so R, G and B channel with 16 bits each) - at which point the compression was disabled.

Is the PNG format an option for you? It uses similarly good lossless compression and is capable of accomodating 8 and 16 bit data per channel…

---

<div class="post-metadata">

**Author:** ![h.lenz](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@h.lenz](https://forum.commonvisionblox.com/u/h.lenz)\
**Post date:** [March 22, 2021, 4:03pm UTC](https://forum.commonvisionblox.com/t/tiff-compression-not-working/1373/3 "2021-03-22T16:03:40Z")

</div>

Thanks for your reply and the warm welcome 🙂  
So if I need to stick to TIFF (and not using PNG as an alternative which I will investigate) I have to save with LZW compression myself as this won’t be coming back as functionality of CVB?

---

<div class="post-metadata">

**Author:** ![illusive](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/illusive/32/61_2.png) [@illusive](https://forum.commonvisionblox.com/u/illusive)\
**Post date:** [March 23, 2021, 9:27am UTC](https://forum.commonvisionblox.com/t/tiff-compression-not-working/1373/4 "2021-03-23T09:27:14Z")

</div>

I won’t say never, but it’ll not be available short term.
