You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We employ the oiio library for reading and writing files before and after upscaling images. However, it saves CMYK images as RGB during export, although they appear correct before exporting.
OpenImageIO version and dependencies
OpenImageIO version 2.5.7.0-1 installed from ArchLinux repo
To Reproduce
We use the C++ API for using oiio in our code
The code to save is
std::unique_ptr<ImageInput> in = ImageInput::open(imagepath.c_str());
if (!in)
{
std::cerr << "Could not open " << imagepath.c_str() << ", error = " << geterror() << "\n";
errorOccurred = true;
continue;
}
const ImageSpec &spec = in->spec();
w = spec.width;
h = spec.height;
c = spec.nchannels;
pixeldata = new unsigned char[w * h * c];
in->read_image(0, 0, 0, c, TypeDesc::UINT8, pixeldata);
in->close();
and the code to save image is:
std::unique_ptr<ImageOutput> out = ImageOutput::create(v.outpath.c_str());
if (!out)
{
std::cerr << "Could not create output image, error = " << geterror() << "\n";
continue;
}
std::unique_ptr<ImageInput> in = ImageInput::open(v.inpath.c_str());
if (!in)
{
std::cerr << "Could not read input image, error = " << geterror() << "\n";
continue; // Handle error appropriately
}
const ImageSpec &inputImageSpec = in->spec();
in->close(); // Close the input image
ImageSpec spec(v.outimage.w, v.outimage.h, v.outimage.elempack, TypeDesc::UINT8);
spec.extra_attribs = inputImageSpec.extra_attribs;
spec.extra_attribs.attribute("XResolution", 300);
spec.extra_attribs.attribute("YResolution", 300);
spec.extra_attribs.attribute("Exif:PixelXDimension", v.outimage.w);
spec.extra_attribs.attribute("Exif:PixelYDimension", v.outimage.h);
std::cout << "\n\nNew Color Space: " << spec.extra_attribs.get_string("ICCProfile:color_space") << "\n\n";
success = out->open(v.outpath.c_str(), spec);
if (!success)
{
std::cerr << "Could not open output image, error = " << out->geterror() << "\n";
continue;
}
success = out->write_image(TypeDesc::UINT8, v.outimage.data);
if (!success)
{
std::cerr << "Could not write output image, error = " << out->geterror() << "\n";
continue;
}
out->close();
Describe the bug
We employ the oiio library for reading and writing files before and after upscaling images. However, it saves CMYK images as RGB during export, although they appear correct before exporting.
OpenImageIO version and dependencies
OpenImageIO version 2.5.7.0-1 installed from ArchLinux repo
To Reproduce
We use the C++ API for using oiio in our code
The code to save is
and the code to save image is:
oiiotool code to replicate is
oiiotool output/cmyk_original.jpg --resize 500x333 --metamerge -o cmyk1.jpg
Evidence
The information is there before saving
But after saving the image file
The Original Photo
The processed photo
The text was updated successfully, but these errors were encountered: