sharp icon indicating copy to clipboard operation
sharp copied to clipboard

Applying Output ICC Profile to an Image

Open simonare opened this issue 4 years ago • 3 comments

Question about an existing feature

What are you trying to achieve?

Hi, I am trying to apply output ICC profile to an image.
equivalent code with Little CMS Profile Applier for JPEG is jpgicc -o "Noritsu2_Edge_Glossy8.icc" photolab-1_original.jpg out.jpg

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

I couldn't find similar approach in #sharp library.

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

I tried following transformer but this creates different result. I believe that this basically attaches profile to the image where as Little CMS approaches differently. (sorry for my semi-technical explaination as I am new into this)

    var iccTransformer = sharp()
        .withMetadata({
            icc: iccProfilePath
        })
        .on('info', (info) => {
            console.log("Image transormation is done", info?.metadata)
        })

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

Original Image photolab-1_original

Expected Image out_2

Image with ICC Transformer Applied photolab-1_icc_applied

simonare avatar Sep 23 '22 14:09 simonare

Hi, the "Expected Image" provided here is sRGB without a profile, so my understanding is that you want to transform the input image using the Noritsu2_Edge_Glossy8.icc profile and convert to sRGB output without metadata. If so, there is a future possible enhancement for this at #1324

As you've seen, withMetadata() will transform to the provided profile and attach it, which is not what you want.

lovell avatar Sep 23 '22 16:09 lovell

Hey thank you for quick reply. That means I am stuck here. I will need to look at another library. do you know if there is a fork which includes this feature?

simonare avatar Sep 24 '22 07:09 simonare

Let's track this at #1324

lovell avatar Sep 24 '22 07:09 lovell