-1

I have a numpy array-an 2D numpy array of [H, S, L] for each pixel-and I want to convert these into rgb variables. There wasn't a hsl-rgb converter in matplotlib.colors and I couldn't find a converter that uses arrays as a input. So I had to make it myself. I found a conversion equation here. Everything was okay except that I got stuck implementing the if's.

Can I get help either making the if's statement or finding a function that converts a rsl array to rgb array?

Here's my conversion function I currently made.

def hsl2rgb(self,H,S,L):
    C = np.multiply(1-np.abs(2*L-1),S)
    X = np.multply(C, 1 - np.abs(np.mod(H*6,2)-1))
    m = np.subtract(L, C/2)
    h=np.floor(6*H)
김성준
  • 1
  • 3
  • 1
    Read [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) and modify question accordingly to minimal working example. Without posting your code you risk removal of your question. Enjoy SO ;-) – ZF007 Jan 06 '18 at 12:32
  • OK. I'm outside now, so I'll edit it as soon as I go home – 김성준 Jan 06 '18 at 13:09

1 Answers1

-1

Hasel provides rsl-to-rgb conversion for array type datas.

김성준
  • 1
  • 3