Closed
Description
RGB pixels based on unsigned integral channels are not correctly translated to CMYK space with full range of signed integral channels.
The original implementation did not handle properly signed CMYK pixels, so this issue is independent from #406.
C++ Minimal Working Example
#include <boost/gil.hpp>
namespace gil = boost::gil;
int main()
{
// black
{
gil::rgb8_pixel_t src{0, 0, 0};
gil::cmyk8s_pixel_t dst;
gil::color_convert(src, dst); // dst={0, 0, 0, 0}
// expected dst={-128, -128, -128, 127}
}
// white
{
gil::rgb8_pixel_t src{255, 255, 255};
gil::cmyk8s_pixel_t dst;
gil::color_convert(src, dst); // dst={0, 0, 0, -128}
// expected dst={-128, -128, -128, -128}
}
// blue
{
gil::rgb8_pixel_t src{0, 0, 255};
gil::cmyk8s_pixel_t dst;
gil::color_convert(src, dst); // dst={127, 127, 0, -128}
// expected dst={127, 127, -128, -128}
print(1, src, dst);
}
// yellow
{
gil::rgb8_pixel_t src{255, 255, 0};
gil::cmyk8s_pixel_t dst;
gil::color_convert(src, dst); // dst={0, 0, 127, -128}
// expected dst={-128, -128, 127, -128}
}
}
References
- Confirmed by Fix invalid conversion from RGB8 to CMYK32 due to overflow #470 while testing bug in Invalid conversion from RGB8 to CMYK32 #406
Environment
- Version (Git ref or
<boost/version.hpp>
): <=1.72, current develop