WOLFRAM

Background & Context

    • Raster image format.
    • A very simple lossless data compression.
    • Compresses image data using run-length encoding.
    • Efficient in compressing black-and-white images.
    • Plain text format.
    • Superseded by other raster formats such as GIF.

Import & Export

  • Import["file.rle"] imports an RLE file, returning an Image object.
  • Import["file.rle",elem] imports the specified element from an RLE file.
  • The import format can be specified with Import["file","RLE"] or Import["file",{"RLE",elem,}].
  • Export["file.rle",expr] exports an image, graphics and numeric arrays to an RLE file.
  • Image objects are by default exported at their full raster size. Graphics and other arbitrary expressions are exported using the same raster size as their displayed form.
  • See the following reference pages for full general information:
  • Import, Exportimport from or export to a file
    CloudImport, CloudExportimport from or export to a cloud object
    ImportString, ExportStringimport from or export to a string
    ImportByteArray, ExportByteArrayimport from or export to a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Data representation elements:
  • "Array"initial state as a SparseArray object
    "Image"initial state as an Image object
  • Metadata elements:
  • "Comments"comments stored in the file
    "ImageSize"size of the imported raster
  • An RLE file may include additional images such as intermediate results of a cellular automaton evolution.
  • Elements to access additional data:
  • "ArrayList"list of SparseArray objects
    "FullData"a list of associations including "Rule", "Array" and "Comments" key-value pairs
    "ImageCount"total number of images stored in the file
    "ImageList"list of Image objects

Options

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Import an RLE file:

Out[1]=1

Import an RLE image:

Out[2]=2

Scope  (2)Survey of the scope of standard use cases

Plot data imported from an RLE file:

Out[1]=1

Export data to an RLE file:

Out[1]=1
Out[2]=2

Import Elements  (10)

Available Elements  (2)

List of available elements:

Out[1]=1

Import all elements as a list of rules:

Data Representation  (4)

"Array"  (1)

Import image data:

Out[1]=1

Construct the image using a proper type:

Out[2]=2

"ArrayList"  (1)

Import all the data stored in the file:

Out[1]=1

"Image"  (1)

Import image data stored in a file as an Image object:

Out[1]=1
Out[2]=2

"ImageList"  (1)

Import all the data stored in the file as Image objects:

Out[1]=1

Metadata Elements  (2)

"Comments"  (1)

Import comments stored in a file:

Out[1]=1

"ImageSize"  (1)

Import the dimensions of the image:

Out[1]=1

Additional Elements  (2)

"ImageCount"  (1)

Total number of images stored in the file:

Out[1]=1

"FullData"  (1)

A list of associations including rule, data and comments for each image stored in the file:

Out[1]=1

Export Options  (2)

"Rule"  (1)

Export data to a file:

Out[1]=1
Out[2]=2

Import the file back to see the full data:

Out[3]=3

Specify a custom rule on export:

Out[4]=4

"Comments"  (1)

Out[1]=1
Out[2]=2

By default, no comment is stored in the file:

Out[3]=3

Specify a custom rule on export:

Out[4]=4