# Gamma correction for colormaps

**URL:** <https://discourse.julialang.org/t/gamma-correction-for-colormaps/67227>\
**Category:** Specific Domains\
**Tags:** makie, makielayout\
**Created:** [August 28, 2021, 3:40pm UTC](https://discourse.julialang.org/t/gamma-correction-for-colormaps/67227 "2021-08-28T15:40:09Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [August 30, 2021, 7:50am UTC](https://discourse.julialang.org/t/gamma-correction-for-colormaps/67227/8 "2021-08-30T07:50:24Z")

</div>

- I asked recently here [https://discourse.julialang.org/t/function-that-converts-rgb-color-to-cam02-ucs-coordinates/65822](https://discourse.julialang.org/t/function-that-converts-rgb-color-to-cam02-ucs-coordinates/65822) if a conversion RGB-\>CAM02-UCS, and conversely, is available in some Julia package, but the answer was negative.  
There is no direct transformation between the two color-spaces. The conversion is performed via a sequence of composed transformations.

- The non-linear lightness resulted after gamma-correction of RGB color coordinates can be uniformized in just a few lines of code  
[https://github.com/liamedeiros/ehtplot/blob/master/ehtplot/color/cmath.py#L84](https://github.com/liamedeiros/ehtplot/blob/master/ehtplot/color/cmath.py#L84).  
The result for the plasma example is posted below the first two previous images to compare the effect of uniformization.

- I don’t know if there is the posibility to call from Julia functions from `ehtplot`, as long as it can be installed only via setup.py.

---

_[View the full topic](https://discourse.julialang.org/t/gamma-correction-for-colormaps/67227)._
