This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
geniuscobywalker


Newbie


Joined: 26 Feb 2009
Posts: 8

Posted: 01 Mar 2009 08:16:33 pm    Post subject:

I want to make a program that has compressed pictures in it,
and decompress pictures when it needs them.

I wanted it so that after I have lots of pictures they will not take up so much room.
Making it so my program can hold more pictures.

Does anyone know anything about compression or how to implement it in Asm?
Any ideas?

Thanks,
Genius Coby Walker
Back to top
WikiGuru
ADOS (Attention deficit... Oh! Shiny!)


Elite


Joined: 15 Sep 2005
Posts: 923

Posted: 01 Mar 2009 09:34:14 pm    Post subject:

Pick a Compression method, and then google Smile Or just google Smile
Back to top
FloppusMaximus


Advanced Member


Joined: 22 Aug 2008
Posts: 472

Posted: 01 Mar 2009 09:43:53 pm    Post subject:

It depends on how much data you have to compress (since if you have more data you can afford to use a more complicated decompression algorithm.) It also depends on how much time and memory you can afford to spend on decompression.

Probably the most commonly implemented image compression on TIs is run-length encoding (similar to the formerly-popular PCX image format.) In this style of compression, sequences of matching bytes are replaced with an escape sequence. This reduces image size slightly if the image contains a lot of solid white or black areas; it doesn't work very well for more complicated images. There are several different ways of performing RLE, so you may want to try a few of them to see which works best on your images.

A more sophisticated approach is the Lempel-Ziv family of compression algorithms, in which an escape sequence refers back to the previously decompressed data. This is really a generalization of RLE, so it generally works as well or better than RLE in most situations. A basic LZ77/LZSS type algorithm is only slightly more difficult to implement than RLE; more advanced versions (such as the LZW compression used by the GIF image format) can be considerably more complicated and require more time and memory to decompress.

The PNG image format uses the Deflate algorithm, which is quite cool but also quite memory-intensive, and requires a lot of overhead compared to the size of the images you're interested in. Besides which, it probably doesn't work all that well with monochrome images. Deflate wasn't really intended for images to begin with.

If you're looking for decent compression without having to do much work, you might look into the Pucrunch algorithm, which is an RLE/LZ77 type algorithm designed for compressing executables for very-low-memory systems (there are a couple of Z80 implementations out there.) There is a bit of overhead per chunk of data to be decompressed (although with a little hacking you could turn this into a constant global overhead.)

One area I haven't seen explored on TIs is lossy image compression. An algorithm like JPEG would probably be too slow and memory-intensive, and wouldn't work very well with monochrome images, but depending on your needs it might be worth investigating.
Back to top
tr1p1ea


Elite


Joined: 03 Aug 2003
Posts: 870

Posted: 02 Mar 2009 01:04:46 am    Post subject:

I am using pucrunch with my latest project and for my level data it works exceptionally. I believe Iambian tried it with images but wasnt as impressed. He is going with spiffy compression (which can be found on ticalc.org) iirc.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement