Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Morhaus

Pages: [1]
1
Lua / Re: [Library] Compress
« on: June 18, 2013, 03:49:25 pm »
Thanks :)

New version ! 0.0.4
https://mega.co.nz/#!owxVXbAQ!MPb4JRfuZbVcEriqC6IqsUbJRjdcQw9CMYDzvEuwahc

  • RLE encoding/decoding fixed (was completely broken).
  • LZW encoding heavily optimised.
  • the "convert" executable path is now manually resolved, to avoid confusion with Windows' own "convert" executable
  • the images obtained via -z/--zip are no longer loaded at start, but rather dynamically loaded to avoir memory errors. As a side effect, scripts that contain multiple images now load faster.

2
Lua / Re: [Library] Compress
« on: June 12, 2013, 02:47:20 pm »
New version !
https://mega.co.nz/#!UxYBAZQR!BfvEC079-PEB0j98wG58RGjTjJRrt4GDA5xsJMV1KYY

Changelog :
  • image.py won't try to correct colors anymore.
  • lzw.compress is much faster.
  • convert.py throws an error when no input files were found.
  • convert.py can build lua or tns files with more than one image with the paramter -z/--zip.
  • convert.py now accepts the optional parameter -l [N], which limits the maximum size of the code table used by LZW (useful for big files).
  • convert.py now accepts the optional parameter --rle, which forces the use of the RLE encoding.
  • zoom keys :
  • +: zoom in
  • -: zoom out
  • *: the image uses the entire screen width.
  • /:  the image uses the entire screen height.
  • 0: zoom 1:1-
  • keys 1, 2, 3, 4, 6, 7, 8, 9 allow for fast travel between the different corners of the image.
  • keys A, B, C, ..., Z allow to navigate between images.

3
Lua / Re: [Library] Compress
« on: June 06, 2013, 08:36:27 am »
Minor fixes, if you downloaded the last version before this post, you should download it again now.

4
Lua / Re: [Library] Compress
« on: June 06, 2013, 08:07:38 am »
Updated to the last version.

New download link : https://mega.co.nz/#!w8hTnIJB!SDoEbCshxMgHZbV3bNXFcxCMy-0d9H3iK7fUiFTpoZ8

Changelog :
- image.py now uses ImageMagick instead of PIL. It's a bit slower, but should produce a better output and it allows more control on the output. As a consequence, it now requires ImageMagick to be installed on your system and the 'convert' and 'identify' utilities to be in your PATH.
- example.py renamed to convert.py, now takes command line arguments to allow automatic generation of lua or tns files. TNS file generation requires luna to be installed on your system and to be in your PATH.
- lzw.decompress and rle.decompress (lua) now take a table as an optional third argument. It allows to prepend a header directly onto the output instead of concatenating strings.

Examples :
Display help message
Code: [Select]
python convert.py -h
Converts every image in img/ to lua files in lua/
Code: [Select]
python convert.py img/* -o lua/
Converts every png and gif image in img/ to tns files in the same directory, restricted to a palette of 128 colors (default is 256)
Code: [Select]
python convert.py --tns -c 128 img/*.png img/*.gif
If your path selector targets non image file, an error will be thrown.
Example :
Code: [Select]
python convert.py passwords.txt

5
Lua / [Library] Compress
« on: June 01, 2013, 04:02:18 pm »
Hey guys.

The default image format TI uses doesn't have any compression, which results in very slow loadings and big file size. I've written a small library which allows to compress images or data on your computer and decompress it in Lua on the calculator.

Decompressing in Lua might seem a bit overkill but it actually works out quite nicely, and I've experienced substantial gains in loading speed and file size.

Currently, only two algorithms are supported : RLE (Run-length encoding) and LZW (Lempel-Ziv-Welch). RLE tends to produce lighter files, but they also tend to load slower than those produced by LZW.

The library is located in src/compress.lua. You can use packages lzw.py, rle.py, lua.py and image.py to compress your data or your images. The convert.py utility allows for fast conversion between any image format to lua or tns files. Examples of use can be found below.
The image.py package requires ImageMagick to be installed on your computer and the 'convert' and 'identify' utilities to be in your PATH.
In order to produce tns files, the convert.py package requires luna to be installed on your computer and the 'luna' executable to be in your PATH.

Version 0.0.4 :
https://mega.co.nz/#!owxVXbAQ!MPb4JRfuZbVcEriqC6IqsUbJRjdcQw9CMYDzvEuwahc
Changelog: http://ourl.ca/19010/351502

Version 0.0.3 :
https://mega.co.nz/#!UxYBAZQR!BfvEC079-PEB0j98wG58RGjTjJRrt4GDA5xsJMV1KYY
Changelog: http://ourl.ca/19010/350707

Version 0.0.2 :
https://mega.co.nz/#!w8hTnIJB!SDoEbCshxMgHZbV3bNXFcxCMy-0d9H3iK7fUiFTpoZ8

Changelog :
- image.py now uses ImageMagick instead of PIL. It's a bit slower, but should produce a better output and it allows more control on the output. As a consequence, it now requires ImageMagick to be installed on your system and the 'convert' and 'identify' utilities to be in your PATH.
- example.py renamed to convert.py, now takes command line arguments to allow automatic generation of lua or tns files. TNS file generation requires luna to be installed on your system and to be in your PATH.
- lzw.decompress and rle.decompress (lua) now take a table as an optional third argument. It allows to prepend a header directly onto the output instead of concatenating strings.

Examples :
Display help message
Code: [Select]
python convert.py -h
Converts every image in img/ to lua files in lua/
Code: [Select]
python convert.py img/* -o lua/
Converts every png and gif image in img/ to tns files in the same directory, restricted to a palette of 128 colors (default is 256)
Code: [Select]
python convert.py --tns -c 128 img/*.png img/*.gif
If your path selector targets non image file, an error will be thrown.
Example :
Code: [Select]
python convert.py passwords.txt
Traceback (most recent call last):
  File "convert.py", line 23, in <module>
    image = Image(path, colors=args.colors)
  File "/Users/alexandre/Projets/compress/image.py", line 17, in __init__
    raise Exception(stderr_output)
Exception: identify: no decode delegate for this image format `passwords.txt' @ error/constitute.c/ReadImage/550.

Version 0.0.1 :
https://mega.co.nz/#!UwhnDRAJ!Tuad9XC01kTMPOZRa7DztkY7okJrhJ7NgMElQwSm8GQ

The library is located in src/compress.lua. You can use packages lzw.py, rle.py, lua.py and image.py to compress your data or your images. Examples can be found in example.py and src/example.lua.
The image.py package requires the PIL to be installed on your computer. If you already have Python 2.7.3/3.X, you can install it via "pip install pillow".

Pages: [1]