I have weird issue with some TIFF files saved from Adobe Photoshop that i can't solve.No transparency pixels are in file, alpha channel as a 4th
channel.output from iinfo:4096 x 4096, 4 channel, uint16 tiff channel list: R, G, B, channel3compression: "none"c++:...ImageBuf
outBuf;last_channel = -1; // in some cases i need to replace original alpha with externalbool read_ok = outBuf.read(0, 0, 0, last_channel, true,
TypeUnknown, progress_callback, progressBar);...If TIFF file have 4 channels and Alpha channel have not defined as an alpha channel and have name
like "Alpha 1" or "Alpha" in outBuf.spec() i havealpha_channel = -1;numchannels = 4;RGB channels have R, G and B name but 4th
channel can have another name for example "channel 3"as soon as later in code i need to use ImageBufAlgo::fillholes_pushpull() i guess that
it expecting premultiplied alpha channel and explicit defined alpha channel with proper name. So before read() i tried to set this attribute:
outBuf.specmod().alpha_channel = 3; outBuf.specmod().channelnames[3] = "A";
outBuf.specmod().attribute("oiio:UnassociatedAlpha", 0); outBuf.specmod().attribute("tiff:UnassociatedAlpha", 0);And use bool
ok = ImageBufAlgo::fillholes_pushpull(result_buf, *input_buf_ptr);And if original image have non black pixels in RGB channels in areas where Alpha is
0.0 fillholes_pushpull() return with areas filled with white instead of pushpulled. Filled with black return expected result.UPD:In last test when i
set to import as float and export as float format i found that pushpull areas filled withvalues out of 0.0-1.0 range - somewhere about 40.0~50.0.Not
sure if this is a bug already fixed in 2.4.12 just VCPKG still have a 2.4.11 because just found thisclosed issue on github
https://github.com/OpenImageIO/oiio/issues/2937As an temp solution thinking to add ImgBufAlgo::mul to multiply channels by alpha myself.Best
regards,Vlad
_______________________________________________
Oiio-dev mailing list
Oiio-dev@lists.openimageio.org
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org