Or something from the C64 days. Not really surprising considering the chosen palette
Well spotted that man. I'm doing a Retro screensaver which loads up an image from a given folder then converts it to a retro-style C64 screenie.So far it pretty much looks the business.
Maybe you would get a better color match using Hue Saturation and Value
I'm almost there with RGB but I'm sure there was a formula for matching 3 values to a list which contains sets of 3 values. Any ideas?What I'm doing at the moment is:
argb=ReadPixel(i,x,y) srcR = (argb & $ff0000) Shr 16 srcG = (argb & $ff00) Shr 8 srcB = (argb & $ff) For pal=EachIn palettelist r=Abs(srcR-pal.r) g=Abs(srcG-pal.g) b=Abs(srcB-pal.b) pal.index=(r+g+b)/3 Next SortList palettelist ' lowest index value comes first fp:palette=palette(palettelist.first()) argb = $ff000000 | fp.r Shl 16 | fp.g Shl 8 | fp.b WritePixel i, x, y, argb
I don't think this is the best way though.
Example:
source pixel color: ------------------------- 006,254,254 ' cyan palette choices: ------------------------- 092,250,253 ' cyan 158,251,171 ' light greenMy routine seems to choose light green here.