Hi.
So here's the deal, I decided to make some sort of video player in ComputerCraft, the ComputerCraft part is all done and working, however I thought of converting real videos into a LUA Table containing data of colors and where they should appear, as far as this goes, I can handle that, but however, some of you probably know that ComputerCraft color palette is extremely limited, therefore I need to convert true colors (32-bit) into a color palette of 16 colors (Pretty much the same amount of colors CMD can handle I believe), colors being the following : White, Orange, Magenta, LightBlue, Yellow, Lime, Pink, Gray, LightGray, Cyan, Purple, Blue, Brown, Green, Red, Black.
So how could I take for example, a color that looks vaguely redish and convert it to pure red ?
I believe I have to make a list of 16 colors that's for sure, but then I need some hints on how to convert a true color to the closest color in the said list of 16 colors.
Also, i'm programming this in VB.Net, but I guess I can handle C# (Since it's the same thing, apart from the syntax)
Any leads ?
I wrote something to do this a while ago. You can find code [url=https://github.com/Rohansi/LoonyVM/blob/master/Tools/imgconvert/Program.cs]here[/url]. You'll need to make it load a 16 color palette instead of a 256 color one and change it to export a table definition. That shouldn't be too difficult and it will handle dithering for you.
Here's what it produces (with your palette!):
[img]https://dl.dropbox.com/u/675786/ShareX/2014-02/07_13-02-14.png[/img]
Thank you very much, exactly what I needed !
Sorry, you need to Log In to post a reply to this thread.