Created
May 9, 2021 09:52
-
-
Save ProjectEli/693d0c8df199959552356e5a10fed4f6 to your computer and use it in GitHub Desktop.
[MATLAB] RGB gamma interpolation 3D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
close all; clear; clc; | |
color_raw=0:0.05:1; | |
RGB_Lift_raw=(0:0.05:2).'; | |
Ncolor = length(color_raw); vcolor=ones(1,Ncolor); | |
NLift = length(RGB_Lift_raw); vLift = ones(NLift,1); | |
color = vLift * color_raw; | |
RGB_Lift = RGB_Lift_raw * vcolor; | |
color_final = color .* (1.5 - 0.5 * RGB_Lift) + 0.5 * RGB_Lift - 0.5; | |
figure(1);surf(color_raw,RGB_Lift_raw,color_final); | |
xlabel('Original RGB'); | |
ylabel('Lift value'); | |
zlabel('New RGB'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment