1. gif_paletteS
Upon using gifload.e I encountered a slight difficulty.
In particular , selecting a palette that's compatible with a number of
*.gifs' that I attempt to display at the same time.
I know that this is possible , I have Lviewpro that produces a collection
of *.gifs' on the same page , with , what appears to be; their original,
individual palette selections.
Just using , all_palette(buffer[PALETTE]) doesn't produce the desired
result , nor does averaging of the individual palettes.
P.S.
Is gifload.e , available for distribution with any software I may
develop and if so ; are there any clauses I need be aware of ?
Net-Tamer V 1.11 - Test Drive
2. Re: gif_paletteS
Hello Beaumont Furniss,
> Upon using gifload.e I encountered a slight difficulty.
> In particular , selecting a palette that's compatible with a number of
>*.gifs' that I attempt to display at the same time.
I'm not sure how gifload.e works but There are a couple ideas
that should at least head you in the right direction.
The first would be to load each gif and convert each pixel
value into its pallette's rgb value. This would be done
BEFORE displaying them. Of course, this method might make
it dificult to display if you are using graphics.e or some
graphics library that requires a pallette.
The second possibility would be to convert them to the same
pallete. yes, this will cause them to lose some color
definition but if done properly, should not be too bad.
I personally would use Neil.e and try the first method.
Neil handles rgb values well with a simple hex format:
#RRGGBB. I'm assuming that gifload.e returns the image
in the {pallete, 2dSequence} format. After loading a gif I
would loop through each pixel of the image and replace
it's value with the rgb value found in the pallete. If
the rgb pallette values are stored like this: {R,G,B}
they can be converted to #RRGGBB with this simple
function:
function seq2hex(sequence s)
return s[1] * #10000 +
s[2] * #100 +
s[3]
end function
-- Here is one to convert back, if you need to.
-- It looks more complex but its very fast.
-- Gabriel Boehme posted these on Thu, 15 Jul 1999 13:17:00 -0500
function hex2seq(integer x)
integer r, g, b
-- move "backwards" through the rgb value
b = remainder(x, #100)
x = floor(x / #100)
g = remainder(x, #100)
x = floor(x / #100)
r = remainder(x, #100)
return {r,g,b}
end function
You should LOSE NO COLORS with these conversions. Afterwards
you can just discard the pallete since it is no longer
used. The only drawback is that only libraries (like Neil)
that use #RRGGBB values can use the altered bitmap.
>nor does averaging of the individual palettes.
You MIGHT be going about it the wrong way. I assume you
are are talking about using one pallete for all the
images. This is what I mean in the Second suggestion.
I think this would be very complex to accomplish tho
some have. However, even with the best "average" pallete
you can still get major color loss.
I hope my ramblings have been helpful,
Lewis Townsend
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com