Re: Graphics troubles

new topic     » goto parent     » topic index » view thread      » older message » newer message

>Somone mentioned a 'common palette' but I don't know how to do that.
You could either use a 332-palette, like this:

function Generate332Palette()
sequence p
  p = repeat({0,0,0},256)
  for c=0 to 255 do
   p[c+1][1] = and_bits(floor( and_bits(floor(c/32),7)*255/7),255 )
   p[c+1][2] = and_bits(floor( and_bits(floor(c/4),7)*255/7),255 )
   p[c+1][3] = and_bits(floor( and_bits(c,3)*255/3),255 )
  end for
  p[256] = {255,0,255}
  p[1] = {0,0,0}
  return p
end function

..or you could create a list consisting of every color in all the images'
palettes and use f.x. the 256 most frequent colors.

Step 2 is to convert all images to use the palette you've just created using
color-matching.



>
>Also,, what do the numbers in the [] mean?
>

Those numbers are indexes into that sequence.

Example:

sequence s, s2
integer i
s = {100, "foo", 3.14,'x'}
i = s[1]     -- i=100
s2 = s[2]    -- s2="foo"
s = s[2..3]  -- s={"foo",3.14}


________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu