Skip to content

Set icc profile on image #106

@vnkapoor

Description

@vnkapoor

I want to add sRGB icc profile on my image if interpretation is CMYK. I tried below code but didn't got any solution. I saw icc_transform, icc_import and icc_export method but not exactly get the idea which is for add icc the profile.

$iccProfilePath = 'sRGB2014.icc';
$image = Vips\Image::newFromFile($arg[1], ["access" => "sequential"]);
if ($image->interpretation == "cmyk") {
    $image = $image->icc_import(["embedded" => true, "input_profile" => $iccProfilePath]);
}
$image->writeToFile($arg[2]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions