Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
olivervogel opened this issue Jan 9, 2025 · 1 comment
Open

Comments

@olivervogel
Copy link

olivervogel commented Jan 9, 2025

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

@kleisauke
Copy link
Member

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?

I think so. The libvips that comes with Debian 11 is very old. You should probably build your own libvips or use the prebuilt binaries from https://github.com/kleisauke/libvips-packaging/ if you have to use that platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants