Some Arnold users had noticed problems when resizing textures with maketx. This 
showed as quantization errors where instead of an expected constant field of 
255s, some 254s would be sprinkled in.

The problem was coming from quantize. Quantize was calling int Imath::lerp(int, 
int, float), returning a truncated integer, instead of a float. for instance, 
0.999999 would lerp to 254

Changing that call to float Imath::lerp(float, float, float) preserves 
precision before the final quantization step.

r





You can merge this Pull Request by running:

  git pull https://github.com/rmv/oiio quantize_fix

Or you can view, comment on it, or merge it online at:

  https://github.com/OpenImageIO/oiio/pull/400

-- Commit Summary --

* Fixes quantize (before it was just truncating)

-- File Changes --

M src/libOpenImageIO/imageio.cpp (2)

-- Patch Links --

  https://github.com/OpenImageIO/oiio/pull/400.patch
  https://github.com/OpenImageIO/oiio/pull/400.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenImageIO/oiio/pull/400
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to