[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Encoding GIFFs on an Apple II



mdj <mdj.mdj@gmail.com> wrote:
> If you're going to generate a web-friendly format though, why not
> implement PNG instead? It's certainly not been done before on the Apple
> II

It's considerably slower and requires substantially more memory.  I don't
think it would be practical or worthwhile for Apple II images.

The beauty of LZW is that it's very simple (IIRC, IBM was implementing
it in hardware 20 years ago).  It's well suited to machines with limited
memory and CPU power.  LZH ("deflate", used by PNG, ZIP, etc.) is slower
and eats more memory.  BWT (found in bzip2) wants about 500K just to
get started.

It should be possible to derive substantial benefit by just compressing the
image with LZW or LZSS.  You can test this idea by adding the files to a
ShrinkIt archive and checking the size.  (You can evaluate LZW vs. LZH by
recompressing the ShrinkIt archive with CiderPress -- I included "deflate"
as an option, even though it's not practical for an Apple II.)

Source code for LZW and LZSS in C and 65816 assembly are available from
my web site (http://fadden.com/dl-apple2/index.htm#hpsource and the course
materials at http://fadden.com/techmisc/hdc/).

The beauty of LZSS is that you can write the uncompress code in a handful
of 6502 instructions.

-- 
Send mail to fadden@fadden.com (Andy McFadden) - http://www.fadden.com/
CD-Recordable FAQ - http://www.cdrfaq.org/
CiderPress Apple II archive utility for Windows - http://www.faddensoft.com/
Fight Internet Spam - http://spam.abuse.net/spam/ & http://spamcop.net/