VisibleGif
Image As Data Packed
Within the XML file, within the
- Warning on manually editing the "packed" data
-
Why work with the
<data-packed> tag block? - Tags which can be amended
-
Precedence in generation before
<data-codes> and<data-rows>
Generating similar images
Technical details
Generating similar images
^ Warning on manually editing the "packed" data
The data in the
^ Why work with the <data-packed> tag block?
If the
It is faster to generate large numbers of similar images if the
^ Tags which can be amended
The following are tags that can be changed without needing to regenerate the
| Tags | Description |
|---|---|
|
A different entry in the |
|
The table size must not be changed. Each existing entry (red, green, blue) can be changed. |
| All elements that are able to be changed can be. The order of images in an animation can be changed. |
|
If a local colour table exists its size must not be changed. If a local colour table does not exist a new one can be added. The new table must have the same size as the existing global colour table. |
| It is important to set the transparent colour to be an entry in the colour table. |
|
If a |
| Note: No other tags should be changed. If other tags are changed the program can fail. | |
^ Precedence in generation before <data-codes> and <data-rows>
If an XML file contains the three versions of the image data, the precedence when generating the GIF image file is as follows.
<data-packed> <data-codes> <data-rows>
So if
Technical details
^ Bytes and blocks
Each byte comprises two hex characters. Contigous groups of bytes comprise a block. A block can be up to 255 bytes in length. Groups of blocks are terminated by a block of zero length. This termination block must always be present
<lzw-minimum-code-size>2</lzw-minimum-code-size> <data-packed> <blocksize>29</blocksize> <bytes>848FA9CBED0FA39CB4DA4B83DE5CB70E065FC88DA4C79C9B79B224E614</bytes> <blocksize>0</blocksize> <bytes></bytes> </data-packed> |
It is usual and most efficient to hold an image as a number of maximum sized blocks each of 255 bytes, a last block containing the remainder and a final zero sized termination block.
^ Bytes and bits
A byte comprises eight bits.
A variable group of bits represent a "compression table" code.
The minimum number of bits which can store a code is three and the maximum number of bits is twelve.
The
^ Inefficient block sizes
Some image editor software generates variable sized blocks. This is inefficient. The "reblock" sub-parameter will reblock the data to the optimal efficiency.
If the "reblock" sub-parameter is used with the "packed" sub-parameter both the original
The presumption must be that the original blocking was created for a reason. The reasons lie outside the scope of performance considerations. For example the variable sizes of blocks might indicate additional meaning for the data such as might be used in a security application. Alternatively it might imply a poor implementation of the image editor software.
If the "reblock" sub-parameter is used with the "-packed" sub-parameter only an optimally blocked
It is usually worth generating first without the "-packed" sub-parameter to try and assess the quality of the original image editor software blocking.
^ Warning when handling interlaced images
The
This may be a quick and easy low grade encryption technique.
- The sender would take a GIF image and generate the XML.
- The sender would change the
<interlaced> tag and regenerate the scrambled GIF image. - The scrambled GIF image would be sent to the receipient.
- The recipient would generate the XML, change the tag and recreate the original GIF image.