TOF : Simplification of the colors of a picture

Surprised nobody mentioned this method. super easy and super fast.

Create a color map
here is code to make several differnt ones (from a PAINT program I wrote years ago)


For i=0 To 255
  //
  // Sepia Map
  //
  Map_Sepia_R.Red(i)=i*0.393
  Map_Sepia_R.Green(i)=i*0.769
  Map_Sepia_R.Blue(i)=i*0.189
  '
  Map_Sepia_G.Red(i)=i*0.349
  Map_Sepia_G.Green(i)=i*0.686
  Map_Sepia_G.Blue(i)=i*0.168
  '
  Map_Sepia_B.Red(i)=i*0.272
  Map_Sepia_B.Green(i)=i*0.534
  Map_Sepia_B.Blue(i)=i*0.131
  //
  
  map_invert(i) = 255 - i
  //
  map_websafe216(i)=Round(i/&h33)*&h33 ' 216 color WEBSAFE
  map_websafe64(i)=round(i/&h55)*&h55 ' 64 color WEBSAFE
  //
  //
  Map_Gray256.red(i)=i * 0.299
  Map_Gray256.green(i)=i * 0.587
  Map_Gray256.blue(i)=i * 0.114
  //
  '
Next i
myPic.RGBSurface.Transform Map_WebSafe216