"R" <[EMAIL PROTECTED]> wrote in message
001501c1f369$060a52a0$0a6da8c0@lgwezec83s94bn">news:001501c1f369$060a52a0$0a6da8c0@lgwezec83s94bn...
> Hey,
> Thanks for replying,
> Do you by any chance have the code or functions that i can use to do this?
> even to output on jpeg should be ok.
> Cheers,
> -Ryan

If outputting a JPEG is ok, why bother?  I guess you
could up the output quality to prevent blurring...


I don't have code to hand, but I can tell you
how to go about it:

Look up the Gif89a format spec; it will tell you
how to write the header (desired bits-per-
pixel, size, etc).

Count the number of different colors you use.
Set the bits-per-pixel to the lowest value
such that 2^bpp>= numcols+1, and encode
at bpp+1 actual bits per pixel, always referring
to entries in the _existing_ palette, one entry
per pixel.  This is obviously less efficient than
the LZW expanding-dictionary scheme, but
avoids patent infringement.

I recommend writing this as a PHP function
that accepts an image structure and returns
a bit-string; that will make it very easy to
integrate into your scripts.

... if this sounds too complicated, you
could always hire me to do it instead (hint, hint).



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to