Skip to content

Color deviation by 'export-profile' option in thumbnail_image #257

Open
@olivervogel

Description

@olivervogel

I know that it is advised to use thumbnail() rather than thumbnail_image(), but in my case I am dependent on editing an object and have no direct path name as input.

I've noticed a behavior that I can't explain. When I run the following code, I observe that the blue color in the output shifts. This only happens when I set the export-profile option. If I leave it off the colors are fine.

$image = \Jcupitt\Vips\Image::newFromFile('blocks.png');
$image = $image->thumbnail_image(100, [
        'export-profile' => $image->interpretation,
]);
$encoded = $image->pngsave_buffer();

What surprises me is that the option should not actually change anything, as the original interpretation in the image is already srgb. And if I leave out the export-profile option, it should also be encoded also to srgb by default.

Nevertheless, it results in the color shift. What could be the reason for this?

EDIT: The script does not produce a color shift under macOS and libvips-8.16.0 but does under Debian 11 and libvips42 (8.10.5-2). Could this version difference be the reason?

Input Image

blocks

Result Image

out

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions