------------------------------------------------------------------------------------------------ ALN IMAGE CODEC For Ti-83 ------------------------------------------------------------------------------------------------ Author: Alain Meunier Date: 10/december/2001 Version: First e-mail: alain@bol.com.br ICQ: 13617226 --------------------------------------- *MAKE SURE YOU READ 'GETTING STARTED' BEFORE RUNNING ALN IMAGE CODEC --------------------------------------- CONTENTS: 1 - DESCRIPTION 1.1 - ALN IMAGE COMPRESSOR - FEATURES 1.2 - ALN IMAGE DECOMPRESSOR - FEATURES 2 - GETTING STARTED 3 - HOW DOES THE COMPRESSION WORK? 4 - COMPRESSION RATIO 5 - FAQS 6 - KNOWN PROBLEMS/FUTURE IMPROVEMENTS 7 - TIP - How to transfer a downloaded ALN image from your pc to your calc with VTI ------------------------------------------------------------------------------------------------ 1 - DESCRIPTION ALN IMAGE CODEC is an image compressor / decompressor program for Ti-83(+) calculators. The compressed image is not stored in a normal "Picture" file. Because of this, you can store as many ALN compressed images as your calculator's memory can hold. Features include image compressor/decompressor, two encoding types, viewer, hability to send and receive ALN images inside the program, compression up to 76:1 (blank image =), built-in file size and compression ratio viewer for each image, etc.. The program is slow for big and detailed images, but it's perfect (and fast enough) for small drawings that are not important enough to be stored in Pics. The program uses two lists (ALN and ALN2), Str7, Str8, Str9, Str0 and Pic7 for temporary data. All the compressed images are stored in Str7 (unlimited number of images), and when you exit the program it will erase list ALN, Str8, Str9, Str0 and Pic7, so they do not take any space while the program isn't running. Also, once it runs it will store your calc's graph settings and recall them when exiting the program, so your graph screen won't be changed. In this first version, the image compression/decompression only works horizontaly, but maybe I'll be making future versions so user will be able to choose horizontal or vertical compression. The image quality is not afected in the compression, so the compressed image looks exactly like the uncompressed image. This means you will still be able to read any text the compressed image eventually contains. ALN IMAGE CODEC contains 3 programs: ALNCOD and ZALNCOD (for the compressor) and ALNDEC (decompressor / viewer and utilities). ------------------------------------------------------------------------------------------------ 1.1 - ALNCOM (ALN IMAGE COMPRESSOR) ALN IMAGE COMPRESSOR is the program you will use to compress and save your images. This program has an unique feature that is you can select only a part of the image to be compressed, by indicating the first and last pixels to be encoded, top to bottom and left to right. This way you can or crop the image, or if the image dosen't use all the screen, you can save processing time by not processing the space on the screen that there's nothing to process. Of course you can also use the entire image, just put the minimum value for first pixel to be encoded and the maximum value in the last. ALN IMAGE DECOMPRESSOR is user-friendly. Wheever you need to input a number, the program displayes the minimum and maximum numbers allowed. ALNCOD will process te image that is in your GRAPH. When you exit the program (when compressing is complete), the image that was in your GRAPH will still be there. If you want to compress an image that is stored on a Pic, recall it first and then run ALN IMAGE COMPRESSOR. There are two available types of encoding: low (faster) and high (slower but images are even smaller). You can save as many compressed images as you want. The program displayes how many images are already stored. The images have filenames in the format "ALNIMG*", where * is a number. The files can only be seen / viewed with ALN IMAGE DECOMPRESSOR (included). It's recommended that you only select the space in the image that there really are something to compress, this way you save time by not scanning blank spaces in the image (when you view the image, the borders will be white). ------------------------------------------------------------------------------------------------ 1.2 - ALNDEC (ALN IMAGE DECOMPRESSOR) ALN IMAGE DECOMPRESSOR is the decompressor/viewer and utilities for ALN compressed images. With this program you will not only be able to open ALN compressed images, but also check each image's file size and compression ratio, send ALN compressed images to other calc that is running the program (one image sent at a time), receive ALN compressed images from other calc and, if you want, delete all the images you have. ALN IMAGE DECOMPRESSOR is user-friendly. Whenever you need to input a number, the program displayes the minimum and maximum numbers allowed. Every time you need to input the number of an image's filename, if you want to cancel, press 'Clear' and you will go back to the main menu. ------------------------------------------------------------------------------------------------ 2 - GETTING STARTED To be able to start compressing and saving your images, you first need to format your image directory. Do this with ALN IMAGE DECOMPRESSOR, with the "FORMAT IMG DIR" option. You can also use this option if you want to delete all your compressed images, or if you changed something in Str7 or in the lists ALN and ALN2 and the program does not work because of that. ------------------------------------------------------------------------------------------------ 3 - HOW DOES THE COMPRESSION WORK? Basically, the ALN compression works by scanning an image and replacing 2 or more black dots that are together horizontaly with a line. ------------------------------------------------------------------------------------------------ 4 - COMPRESSION RATIO The compression ratio is not constant, it is variable. Remember that with ALN IMAGE DECOMPRESSOR you can check both file size and compression ratio for each one of your images, so you don't need to do any math to discover your image's compression ratio :D Try compressing some images and then check them with the "DISPLAY FILE SIZE" option in ALN IMAGE DECOMPRESSOR, to get an idea of the average compression ratio. If you want to have an idea, an all-white image compressed in ALN (with high compression) is only 10 bytes (compression: 76.4:1), and an all-black image is only 214 bytes (compression: 3.56:1). The sample image included in this zip file is only 254 bytes (compression: 3:1), with high compression. if it was encoded with low compression, it would be 499 bytes (compression: 1.52:1), but faster to decompress. ------------------------------------------------------------------------------------------------ 5 - FAQS 1. I tried running ALN IMAGE CODEC for the first time but when I try to compress/decompress my image it gives me an error message. Is there a problem with the program? How can I fix this? No, this is not a problem. The first thing you should do after sending ALN IMAGE CODEC is running ALN IMAGE DECOMPRESSOR (ALNDEC in your calc's PRGM menu) and use the option "FORMAT IMG DIR", to format the ALN images directory. With this option the program will do everything needed so you can start compressing images. Read 'GETTING STARTED' for details about this. 2. Why does ALN IMAGE COMPRESSOR store all the images in a string instead of in a list? Altough lists are much better than strings in many aspects, there are two aspect that lists are really bad: 1: their size. Compressed images stored in a list are something like 10x bigger than when stored in a string. 2: Lists are limited at 999 independant numbers in the Ti-83, strings are unlimited. BUT, I will be making some day a version of ALN IMAGE CODEC that uses lists, because some days ago I figured out a way to compress lists 5 times smaller than they normally are. To know more about that, see 'KNOWN PROBLEMS/FUTURE IMPROVEMENTS' 3. Why do I have to use ALN IMAGE DECOMPRESSOR to view the image? Can't I just do RecallPic, like I do with Pics? ALN compressed images work in a different data format from a Pic. A Pic is not compressed, so you can only recall it and it appears on the graph screen. Since an ALN format image is compressed, you will have to decompress it before you are able to view it. 4. I know there is an option to delete all my compressed images ( "FORMAT IMG DIR" in ALN IMAGE DECOMPRESSOR ). But how can I delete only one image? You can delete images by saving blank images with the same filename. Then later you can save an image over a empty image. Each blank image takes only 10 bytes. 5. I accidentaly did something that changed Str7 or list ALN or list ALN2 and now the program gives me an error message everytime I try to compress/open an image. How can I fix this? Use the option "FORMAT IMG DIR" in ALN IMAGE DECOMPRESSOR to fix these kind of problems. It will be like running ALN IMAGE CODEC for the first time. All your compressed images will be deleted, though. 6. I have a ti-83, and would like to compress images using an Ti-83 emulator (because it's faster than my calc) and then transfering them to my ti-83 with a link cable, using it only to open the images. Is this a good idea? Yes, that's a good idea, using an Ti-83 emulator for compressing images and using your ti-83 only to decompress/view them. For this, there are the options "SEND IMG" and "RECEIVE IMG" in ALN IMAGE DECOMPRESSOR. Make sure you transfer your images with this program, not with your calc's LINK option. Otherwise the images might not be able to be openned. 7. I know that in a near future there maybe is going to be a version of ALN IMAGE CODEC that supports vertical compression. What would happen then if I sent a vertical-compressed ALN image to someone who's running this first version of ALN IMAGE DECOMPRESSOR, that does not support this future vertical-compressed ALN images? This is a good question. I'm not positive, but almost sure that this would happen: the person would be able to receive the vertical-compressed ALN image, would also be able to view it's file size and compression ratio, would even be able to open/decompress the image, but it would be shown on the screen like if it had been 90-degree rotated to the right. That would even be fun to some people :D . 9. Before I send the sample image (file sampleimage.aln.83G in this zip file) to my calc with VTI I would like to know what does this image look like. Where can I find a screenshot of this ALN image? To see a screenshot of this image open your internet browser and go to this address: http://alain.vila.bol.com.br/sample_alnimage.gif *DO YOU HAVE ANY OTHER QUESTION? ask me: alain@bol.com.br ------------------------------------------------------------------------------------------------ 6 - KNOWN PROBLEMS/FUTURE IMPROVEMENTS Ok, this is the first image compressing/decompressing program for ti-83 I make, in it's first release. Of course there still are improvements to do. Here are a list of known problems: 1- The String problem. If the program used only lists to store the images, it would be faster. But lists take up more memory than strings, right? Well, not exactly. I found out a way to compress lists 5 times: instead of storing a 2-digit number in one space in a list, you can store five 2-digit numbers. This happens because the numbers in lists can be up to 10-digit. So, instead of putting like 10 in [ALN(1), 11 in [ALN(2), 12 in [ALN(3), 13 in [ALN(4), 14 in [ALN(5), I can just put 1011121314 in [ALN(1), and then processing it to get 5 different numbers. I already made the code to compress and decompress lists, so if you want it to you program, ask me and I'll email you the code. Altough using lists will make the program faster for de/compressing images, there is a problem: lists can only be 999 lenght... 2- Horizontal+vertical encoding (this is a problem for future releases, not for this first version). Next releases will contain an option to compress it with vertical or horizontal ALN compression (in this first version only horizontal ALN compression is available by standard), but they will be only horizontal or only vertical. there's got to be a way to mix both and get an optimal compression. But if I can figure out a way to do this, another problem would come, that would be the size of the compression program... You are welcome to suggest improvements! my e-mail is alain@bol.com.br ------------------------------------------------------------------------------------------------ 7 - TIP - How to transfer a downloaded ALN image from your pc to your calc with VTI If somehow you download an ALN compressed image from the internet (I might put some for download in ticalc.org), you'll have to send it to your calc with VirtualTI, (or other TI-83 emulator, but VTI is recommended and was already tested). Here's how: Step 1 - Open VTI Step 2 - Send the downloaded ALN image to VTI Step 3 - Enable cable link (choosing your correct type of cable) Step 4 - Don't do anything else, Let VTI as it is Step 5 - In your calc (not in VTI!) Enter ALN IMAGE DECOMPRESSOR Step 6 - Certify that VTI is still on (it might be off because of APD). If it's not, turn it on. Step 7 - Plug your cable to your calc and your pc Step 8 - In ALN IMAGE DECOMPRESSOR, select "RECEIVE IMG" (then select "RECEIVE"). Step 9 - But don't run any program in VTI, let it stay as it is, and your calc will receive the downloaded ALN image from VTI. Step 10 - Now in your calc, save your received ALN image. You can now exit VTI. In the zip file you will find a file named (aln)imagesample.83G . This file is a sample of an ALN compressed image. You can transfer it to your calc using the steps listed above, just like with an ALN image you might download some day. ------------------------------------------------------------------------------------------------- Thank you for downloading my program. I hope you enjoy it and use it many times. You can distribute this zip file if you like, but please do not change it. I would like to hear your comment about ALN IMAGE CODEC. You are welcome to send me an e-mail telling me what you think of the program. Alain Meunier alain@bol.com.br 10/december/2001 -------------------- INDUSTRIA BRASILEIRA --------------------