RLE

Ben Rubinstein benr_mc at cogapp.com
Thu Jul 27 19:19:10 EDT 2006


On 27/7/06 23:44, Dar Scott wrote:
> The impression I get from several comments on this list is that I can 
> drop "RLE" data into an image (and it work).
> 
> Is this a homemade RLE format that Scott made?  Or is this a standard 
> Like the Utah RLE?  If a standard, are only certain options allowed?
> 
> What are the details on this format?  Can I make one and set the text of 
> an image to it?  Can this be exported?
> 
> I found Utah RLE here:
> 
>     http://www.martinreddy.net/gfx/2d/RLE.txt
> 
> Long, long ago I knew a kid who ran into the house the night after 
> getting his glasses and called out "Mommy, mommy!  There really are stars!"
> 
> I'm having trouble believing that this legendary RLE exists.

I'm having trouble understanding why anyone wants it.  (This is sincere, not
snide.)

If you want to examine the pixels of an image, or modify it, use the
imageData.  It's by far the easiest format to work with.

If you want to create an image based on data in a standard format, use the
import command.  If the data is in memory, I can't imagine many situations in
which it's tough to bounce it off a temporary file on disk.  If the format is
PNG or JPEG or GIF and you really don't want to store it temporarily in a
file, you may be able to set the paintCompression appropriately and then set
the 'text' - I'm not sure if this works (or if paintCompression makes a
difference to the interpretation of the incoming data).

If you want to do the reverse, create a description in a standard format, 
based on an existing image, use the export command.  Maybe you can also get 
the 'text' of the image, but I don't see the advantage given that you can 
'export' into a wider range of formats, and can do so into a container or file.

If you really want to change the format in which the image is stored
internally in the stack record you can: change the global paintCompression and
then modify the image (I think just "set the imagedata ... to the
imagedata..." will do it) and change card.  But again, I can't imagine why
you'd want to do this, which will generally reduce image quality.  (I suppose
there might be a few cases in which you know that you can reduce the stored
size of the image without reducing image quality, or where you're prepared to
accept the quality loss.)

But why does anyone care what the RLE format is?  It's just used internally.
We don't need to understand the internal format that a field's data is stored
in, as long as we can get at it by properties.

For the record, I'm pretty certain that isn't Utah RLE, but a very very very
much simpler format.  Take a look at it and see.  But I still wish someone
would explain to me why so many people seem to care?

   Ben Rubinstein               |  Email: benr_mc at cogapp.com
   Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
   http://www.cogapp.com        |  Fax  : +44 (0)1273-728866





More information about the use-livecode mailing list