question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why input of rgb_to_lab and output of lab_to_rgb are not the same?

See original GitHub issue

Hi Kornia team,

I test rbg_to_lab and lab_to_rgb with these lines of code: image

The input and output_rgb are supposed to be the same, but it is not the case. I checked the document but did not see any special preprocessing method for input/output of those conversion functions.

So why they are not the same?

Thanks.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cceydacommented, Jul 2, 2021

@edgarriba This might lead to some problems if someone tries to save an image or pass it onto another (kornia) function that expects things in 0,1 range. Imo clip=True is a safer default.

1reaction
cceydacommented, Jul 2, 2021

Yes @shijianjian it is because of clipping done during lab_to_rgb. This is according to conversion standarts [ref] image

@hminle you can check our test for this exact thing here precision is within 1e-4. Let me know if this answers your question 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opencv L*a*b* to RGB conversion produces grayscale output
This is necessary because CIE-Lab* is not a linear color space so there's no known direct conversion to RGB. void CIElabtoXYZ(cv::Mat& image ...
Read more >
kornia.color - Read the Docs
Convert an image from Lab to RGB. Returns. RGB version of the image. Range may not be in ...
Read more >
Module: color — skimage v0.19.2 docs
Lab to RGB color space conversion. ... Same dimensions as input. ... If the input is a 1-dimensional image of shape (M, )...
Read more >
Opencv L*a*b* to RGB conversion produces grayscale output ...
Convert CIE-Lab* to XYZ. This is necessary because CIE-Lab* is not a linear color space so there's no known direct conversion to RGB....
Read more >
Converting from LAB to RGB leads to wrong colors · Issue #4105
We tried version 7.1.0-4 on mac and also on linux, but same result. The output image has no embedded profile, but the colorspace...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found