Jump to content

How to convert to-and-from colors with pictures or videos (YIQ, YUV, YCbCr, RGB, CMY, HSV, HSL, LCH...), not a object?


Winston
 Share

Recommended Posts

I was looking for code that switches R with H, G with S and B with L in JS, CSS, HTML, and so. Having no success, it kept giving me a color picker and color code, no matter how I describe it to Google, and it is leaving me no other choice but to ask for help. How do I switch colors in videos and pictures from and/or to RGB and other programmed in a .HTM page?

 

PS: I don't want to edit the picture in a different program, I want to display it differently on the page.

 

Suggestions? Do I need a color map or brightness map? Help would be appreciated.

Link to comment
Share on other sites

You probably would have to do the math yourself for each pixel and draw the result on a canvas. I don't think that would run fast enough to work on videos. There is nothing natively in Javascript or HTML that converts between RGB and HSL colors that I am aware of.

To run algorithms on individual pixels, I would use getImageData() and putImageData() to do pixel manipulation.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...