# Images exported from OSPRay renders have channel values that max out at 254

**URL:** https://discourse.vtk.org/t/images-exported-from-ospray-renders-have-channel-values-that-max-out-at-254/1531
**Category:** Support
**Created:** [August 8, 2019, 9:33pm UTC](https://discourse.vtk.org/t/images-exported-from-ospray-renders-have-channel-values-that-max-out-at-254/1531 "2019-08-08T21:33:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Sean\_Curtis](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sean_curtis/32/718_2.png) [@Sean\_Curtis](https://discourse.vtk.org/u/Sean_Curtis)
#### Post date: [August 8, 2019, 9:33pm UTC](https://discourse.vtk.org/t/images-exported-from-ospray-renders-have-channel-values-that-max-out-at-254/1531/1 "2019-08-08T21:33:19Z")

</div>

I’ve encountered two instances that suggest there’s some funny truncating taking place somewhere in either OSPRay or the OSPRay/VTK interface. Essentially, it comes down to the fact that colors are not coming back quite right.

Case 1:

- Set the ospray render node to “scivis”
- Set the background to some arbitrary value (e.g., 230, 240, 250) as a normalized color(e.g., 230 / 255.0, etc.).
- Render an empty scene
- Export the image.

The image should be full of (230, 240, 250)-valued pixels. What you _actually_ get is (229, 239, 249). However if I take my normalized color as:  
(r + 0.5) / 255, (g + 0.5) / 255, (b + 0.5) / 255, I get the correct background color out.

Case 2:

- Set the render node to “pathtracer”
- set per simple samples to 1.
- Put some arbitrary simply geometry in front of the camera.
- Shine a light on it and create some insanely high intensity for the camera – the goal is to _clearly_ flood the scene such that we get a white out.
- Render
- Export image
- The color saturates, not to (255, 255, 255) but to (254, 254, 254).

This _could_ still be a truncation error (i.e., any value, even a slight epsilon below 1 will end up converting to 254), although that seems highly unlikely with a single sample per pixel and intensity ranked to the sky. I’d hope it would cleanly saturate to 1 and then directly map to 255.
