Is there a way to convert luma to RGB? It seems to be the only colorspace
conversion combo not offered?
My webcam feed goes through various processes to arrive at an edge/outline
simple image. Part of which involves pix.rgb2luma. Can it go back the other
way post-process so I can colour the outline images?…doesn’t have to be
the original colours.
If you think about it, how would this work…it’s entirely possible
that several RGB colors can convert to the same luma value. You’re
mapping a 24bit pixel space to an 8bit pixel space. How would you go
from 8bit to 24bit? If you have several luma values that are the
same, do you map them to the same color? If not, then how do you
choose which value of say 55 luma maps to any particular color?
You’re going to need some more information.
That said, there are 2 ways I can think of for doing what you want…
1->Take your edges and get the colors from the source video at the
same pixel locations. "jit.op @op *" might do this for you
2->Create your own mapping from luma to RGB space based on your needs
and use jit.charmap to process the conversion. I have made an object
that does this if you’re curious. It’s called xray.jit.colormap
‘luma’ matrices are only 1-plane matrices, where rgb(+alpha) are 4-plane.
so, just add 4 plane jit.matrix after you’re done with luma processing.
to color this matrix, you could simply multiply this gray 4-plane matrix
with rgb values, using jit.op @op * @val -alpha intensity- -red
intensity- -green intensity- -blue intensity-
jit.matrix 4 char 320 240
| (after this, you have rgb matrixes, where alpha channel is also ‘luma’)
| pak 255 255 255 255
jit.op @op * @val 255 255 255 255
or, if you want to leave alpha chanel, you would use @op pass * * *
realy nice thing about jitter is that matrixes are just data, some people
store music in it, some text, even code. some people use it for images of
various flavors, you’re not constrained to one particular format, like pix.*