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

Resize images while keeping the ICC profile and color space #4186

Closed
ollm opened this issue Aug 7, 2024 · 4 comments
Closed

Resize images while keeping the ICC profile and color space #4186

ollm opened this issue Aug 7, 2024 · 4 comments

Comments

@ollm
Copy link

ollm commented Aug 7, 2024

Question about an existing feature

What are you trying to achieve?

I'm trying to resize images while keeping the ICC profile and color space, currently it only seems to work with the P3 profile, with other profiles it seems like sharp stretches the image (And accumulates every time it is resized). I don't know if I'm doing something wrong.

I am using sharp 0.33.4

When you searched for similar issues, what did you find that might be related?

#4008, #3906 and #4128

Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question

sharp('input.jpg')
	.keepIccProfile()
	.resize({kernel: 'lanczos3', width: 500})
	.png({compressionLevel: 0, force: true})
	//.toBuffer()
	.toFile('output.png');

Original
Rose-ProPhoto

Resized with keepIccProfile
Rose-ProPhoto-2

Resized with keepIccProfile 2 times
Rose-ProPhoto-3

Please provide sample image(s) that help explain this question

images.zip

@ollm ollm added the question label Aug 7, 2024
@lovell lovell added this to the v0.33.5 milestone Aug 11, 2024
@lovell
Copy link
Owner

lovell commented Aug 11, 2024

Commit 2eb03b0 fixes this by preventing an unnecessary colour transformation plus adds a test that would previously have failed to help prevent regression, thanks for reporting.

@ollm
Copy link
Author

ollm commented Aug 11, 2024

Thanks you for the fix!

@lovell
Copy link
Owner

lovell commented Aug 16, 2024

v0.33.5 now available with the fix.

@lovell lovell closed this as completed Aug 16, 2024
@ollm
Copy link
Author

ollm commented Aug 16, 2024

Thanks you, I have tested the new version with different images and it works fine.

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

No branches or pull requests

2 participants