Describe the bug
By default it seems like both maketx and oiiotool (with -otex) always turn the output texture into 32-bit float even if the input image is a half (16-bit float) image:
$ oiiotool --info ./basecolor_1001.exr
./basecolor_1001.exr : 4096 x 4096, 3 channel, half openexr
$ oiiotool basecolor_1001.exr -otex basecolor_1001.tx
$ oiiotool --info ./basecolor_1001.tx
./basecolor_1001.tx : 4096 x 4096, 3 channel, float tiff (+mipmap)
To prevent this from happening --attrib tiff:half 1 can be used. This will keep the input images bit depth on the root tile:
(Using imagemagick because I could not find a way for oiiotool to print the mipmap info)
$ oiiotool basecolor_1001.exr --attrib tiff:half 1 -otex basecolor_1001.tx
$ magick identify ./basecolor_1001.tx
./basecolor_1001.tx[0] TIFF 4096x4096 4096x4096+0+0 16-bit sRGB 1.09345MiB 0.001u 0:00.001
./basecolor_1001.tx[1] TIFF 2048x2048 2048x2048+0+0 32-bit sRGB 0.002u 0:00.001
./basecolor_1001.tx[2] TIFF 1024x1024 1024x1024+0+0 32-bit sRGB 0.002u 0:00.001
./basecolor_1001.tx[3] TIFF 512x512 512x512+0+0 32-bit sRGB 0.002u 0:00.002
./basecolor_1001.tx[4] TIFF 256x256 256x256+0+0 32-bit sRGB 0.002u 0:00.002
./basecolor_1001.tx[5] TIFF 128x128 128x128+0+0 32-bit sRGB 0.003u 0:00.002
./basecolor_1001.tx[6] TIFF 64x64 64x64+0+0 32-bit sRGB 0.003u 0:00.003
./basecolor_1001.tx[7] TIFF 32x32 32x32+0+0 32-bit sRGB 0.003u 0:00.003
./basecolor_1001.tx[8] TIFF 16x16 16x16+0+0 32-bit sRGB 0.004u 0:00.003
./basecolor_1001.tx[9] TIFF 8x8 8x8+0+0 32-bit sRGB 0.004u 0:00.003
./basecolor_1001.tx[10] TIFF 4x4 4x4+0+0 32-bit sRGB 0.004u 0:00.004
./basecolor_1001.tx[11] TIFF 2x2 2x2+0+0 32-bit sRGB 0.004u 0:00.004
./basecolor_1001.tx[12] TIFF 1x1 1x1+0+0 32-bit sRGB 0.005u 0:00.004
However, all other mipmaps are still converted to 32-bit float.
Things I tried:
- Using something like
--attrib:subimages=all tiff:half 1 does not work and results in the same issue.
-d half changes nothing and all tiles will be 32-bit anyway (including the root tile)
-d double will convert all tiles to 64-bit float
-d uint16 will also convert all tiles to 16-bit, but it won't be float anymore (obviously)
It seems like this is specifically an issue with 16-bit float/32-bit float options/files.
OpenImageIO version and dependencies
OIIO 3.1.13.1 | Windows/x86_64
Build compiler: MSVS 1937 | C++17/199711
HW features enabled at build: sse2
No CUDA support (disabled / unavailable at build time)
Dependencies: BZip2 NONE, expat 2.6.3, fmt 12.1.0, Freetype 2.14.1, Imath 3.1.10, JPEG 80, libdeflate 1.23, Libheif NONE, libjpeg-turbo 3.1.2, LibRaw NONE, libuhdr 1.4.0, minizip-ng 4.0.10, OpenColorIO 2.5.1, OpenEXR 3.3.5, OpenGL, OpenJPEG 2.5.4, openjph NONE,
PNG 1.6.50, Ptex NONE, Ptex NONE, pystring NONE, Qt5 NONE, Qt6 NONE, Robinmap 1.4.0, TIFF 4.7.1, WebP 1.6.0, yaml-cpp 0.8.0, ZLIB 1.3.1, ZLIB 1.3.1
To Reproduce
- Create a 16-bit float exr (I used Nuke for testing, but the same issue happens with Substance Painter files)
- Use maketx or oiiotool to convert it
- Output will be 32-bit float without the
--attrib flag
- With the
--attrib flag only the first tile will be 16-bit while the others will be 32-bit
Describe the bug
By default it seems like both maketx and oiiotool (with -otex) always turn the output texture into 32-bit float even if the input image is a half (16-bit float) image:
To prevent this from happening
--attrib tiff:half 1can be used. This will keep the input images bit depth on the root tile:(Using imagemagick because I could not find a way for oiiotool to print the mipmap info)
However, all other mipmaps are still converted to 32-bit float.
Things I tried:
--attrib:subimages=all tiff:half 1does not work and results in the same issue.-d halfchanges nothing and all tiles will be 32-bit anyway (including the root tile)-d doublewill convert all tiles to 64-bit float-d uint16will also convert all tiles to 16-bit, but it won't be float anymore (obviously)It seems like this is specifically an issue with 16-bit float/32-bit float options/files.
OpenImageIO version and dependencies
To Reproduce
--attribflag--attribflag only the first tile will be 16-bit while the others will be 32-bit