# Request for TIF support

**URL:** https://forum.castle-engine.io/t/request-for-tif-support/1240
**Category:** Uncategorized
**Created:** [June 20, 2024, 6:50pm UTC](https://forum.castle-engine.io/t/request-for-tif-support/1240 "2024-06-20T18:50:29Z")
**Posts on this page:** 1
**Showing post:** 26

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [July 7, 2024, 8:51pm UTC](https://forum.castle-engine.io/t/request-for-tif-support/1240/26 "2024-07-07T20:51:29Z")

</div>

Progress: LibTiff on Linux tested and rocks, TGrayscaleFloatImage also on GPU.

 ![Zrzut ekranu z 2024-07-07 22-19-06](https://forum.castle-engine.io/uploads/default/original/2X/0/0ab4962e17cd9b3c6615ac32b9682fa64fae33b4.jpeg)

Details:

- I changed loading from _Vampyre_ to fail with proper exception in case some format cannot be loaded, e.g. because libtiff is not available. This is a better behavior, consistent also with rest of CGE, better than previous accidental behavior of silently loading an image with zero size.

- Tested and documented how to get `libtiff.so.5` on Linux . Works great on Linux, and yes, I get float-based images from samples in this thread! Please see [castle-engine/doc/miscellaneous\_notes/additional\_image\_formats.md at master · castle-engine/castle-engine · GitHub](https://github.com/castle-engine/castle-engine/blob/master/doc/miscellaneous_notes/additional_image_formats.md) .

- Caveat: _If image contains alpha channel, it is still converted to 8-bit, for today._ The reason for this is trivial, we just don’t have TRGBAlphaFloatImage (we only have TRGBFloatImage and TGrayscaleFloatImage). I should add TRGBAlphaFloatImage soon.

- I added branch `extra-image-formats` to [GitHub - castle-engine/castle-image-viewer: Image viewer and converter using Castle Game Engine, supporting many common image formats (PNG, JPG...) and some exotic ones (DDS, KTX, RGBE)](https://github.com/castle-engine/castle-image-viewer) to demonstrate this, i.e. precompiled libtiff.

- Note that I thought about making TIFF more out-of-the-box supported in CGE, but resigned for now – this extra need to get libtiff is another hurdle, so reason to _not_ recommend people to use TIFF and instead recommend PNG for now (where we have LibPNG distributed everywhere already). But, if you need TIFF, the ability is there and at least better documented now.

- We support now loading TGrayscaleFloatImage to GPU (OpenGL), so such texture formats are even more useful – e.g. we can pass float-based heightmaps to shaders.

---

_[View the full topic](https://forum.castle-engine.io/t/request-for-tif-support/1240)._
