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

unaltered input->output. #4245

Open
gacord23 opened this issue Oct 25, 2024 · 2 comments
Open

unaltered input->output. #4245

gacord23 opened this issue Oct 25, 2024 · 2 comments
Labels

Comments

@gacord23
Copy link

What are you trying to achieve?

I would like to take an image from input, to output as either the original input type, or raw (this would include extractChannel->raw) without any icc transforms or colorspace alterations. I've had success on my own fork by adding an {icc: 'noop'} option to withMetadata which works fine with RGB images. But if I have a CMYK image (my CMYK images may, or may not, have an embedded profile), I'm seeing it still convert it to an RGB colorspace and I really want zero transforming of the pixels through the pipeline.

Even if it requires modifying my own fork further, Any insight on how I might achieve this?

@lovell
Copy link
Owner

lovell commented Oct 27, 2024

Something like the following might get you closer to what you need, but most software requires CMYK images to contain a profile as they are device-dependent.

const cmykData = await sharp(cmykInput, { ignoreIcc: true })
  .pipelineColourspace('cmyk')
  .toColourspace('cmyk')
  .raw()
  .toBuffer();

https://sharp.pixelplumbing.com/api-constructor
https://sharp.pixelplumbing.com/api-colour#pipelinecolourspace
https://sharp.pixelplumbing.com/api-colour#tocolourspace

@gacord23
Copy link
Author

Right, I have a particular need for processing them both with and without profiles and do all of my color workflow via LCMS. So, would sharp completely bypass any transform in this case or would it still attempt to do something like move it to some rgb16 and back again?

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

No branches or pull requests

4 participants
@lovell @gacord23 and others