WhyWaitForever

London England

VisibleGif

Image As Data Rows

Within the XML file, within the <image> tag block, image data can be displayed within the <data-rows> tag block. A single tag <row count=" ">, with the optional "count" attribute, is valid within this block. This page describes the characteristics and use of this data.



Image data as rows

 ^  Why work with the <data-rows> tag block?

The <data-rows> view of image data provides an insight into some of the visual aspects of the image. At a glance can be seen if few colours are being used or if many colours are being used. For simple images, used as "icons" or "buttons", the fewer the colours the better. The more colours at cololur boundaries the more likely anti-aliasing was applied.

The <data-rows> view provides some insights into the efficiency of the image editor software that created the original GIF image.

For simple images the <data-rows> tag block can be created from scratch. An image comprises a number of rows each of height 1 pixel. Each character in the <row> tag represents a pixel of a particular colour at that position in the row.

 ^  Small images with few colours

These are the sort of images that are ideal for VisibleGif.

 ^  Large images with lots of colours

The <data-rows> view is more difficult to use on large images and on images which use lots of colours. VisibleGif can be used to to get a good idea of how the image has been implemented. Image editor software should be to reduce the colour pallet or decrease depth of colour or turn off anti-aliasing or turn on interlacing. The <data-packed> view can be used to re-check the implementation.

 ^  Precedence in generation - after <data-packed> and after <data-codes>

If an XML file contains the three versions of the image data, the precedence when generating the GIF image file is as follows.

  1. <data-packed>
  2. <data-codes>
  3. <data-rows>

So if both <data-packed> is not present and <data-codes> is not present and <data-rows> is present in an XML file, the image will be generated from the <data-rows> tag block.


Technical details

 ^  Colour tables and character representations

Each colour table can have up to 256 colour entries. The first colour entry is index 0 and the last colour entry is index 255. Each entry comprises 3 bytes where the first byte is the red component, the second byte is the green component and the third byte is the blue component.

VisibleGif assigns an editable (and printable) character to each index value. It is this editable character that is used in the <data-rows> view. Unfortunately there are insufficient number of unique editable characters. VisibleGif is not designed to create images with large numbers of colours from scratch. There are many other image editor software products more suitable for this work.

The first 90 entries in a colour table are assigned the editable characters as listed below. Other entries are assigned a unique character that represents the correct index BUT most text editor programs (such as MS Notepad) will represent this "non printing" character as a "?" or a square.


  <index> 0</index>  <edit>!</edit>
  <index> 1</index>  <edit>"</edit>
  <index> 2</index>  <edit>#</edit>
  <index> 3</index>  <edit>$</edit>
  <index> 4</index>  <edit>%</edit>
  <index> 5</index>  <edit>&</edit>
  <index> 6</index>  <edit>'</edit>
  <index> 7</index>  <edit>(</edit>
  <index> 8</index>  <edit>)</edit>
  <index> 9</index>  <edit>*</edit>
  <index>10</index>  <edit>+</edit>
  <index>11</index>  <edit>,</edit>
  <index>12</index>  <edit>-</edit>
  <index>13</index>  <edit>.</edit>
  <index>14</index>  <edit>/</edit>
  <index>15</index>  <edit>0</edit>
  <index>16</index>  <edit>1</edit>
  <index>17</index>  <edit>2</edit>
  <index>18</index>  <edit>3</edit>
  <index>19</index>  <edit>4</edit>
  <index>20</index>  <edit>5</edit>
  <index>21</index>  <edit>6</edit>
  <index>22</index>  <edit>7</edit>
  <index>23</index>  <edit>8</edit>
  <index>24</index>  <edit>9</edit>
  <index>25</index>  <edit>:</edit>
  <index>26</index>  <edit>;</edit>
  <index>27</index>  <edit><</edit>
  <index>28</index>  <edit>=</edit>
  <index>29</index>  <edit>></edit>
  <index>30</index>  <edit>?</edit>
  <index>31</index>  <edit>@</edit>
  <index>32</index>  <edit>A</edit>
  <index>33</index>  <edit>B</edit>
  <index>34</index>  <edit>C</edit>
  <index>35</index>  <edit>D</edit>
  <index>36</index>  <edit>E</edit>
  <index>37</index>  <edit>F</edit>
  <index>38</index>  <edit>G</edit>
  <index>39</index>  <edit>H</edit>
  <index>40</index>  <edit>I</edit>
  <index>41</index>  <edit>J</edit>
  <index>42</index>  <edit>K</edit>
  <index>43</index>  <edit>L</edit>
  <index>44</index>  <edit>M</edit>
  <index>45</index>  <edit>N</edit>
  <index>46</index>  <edit>O</edit>
  <index>47</index>  <edit>P</edit>
  <index>48</index>  <edit>Q</edit>
  <index>49</index>  <edit>R</edit>
  <index>50</index>  <edit>S</edit>
  <index>51</index>  <edit>T</edit>
  <index>52</index>  <edit>U</edit>
  <index>53</index>  <edit>V</edit>
  <index>54</index>  <edit>W</edit>
  <index>55</index>  <edit>X</edit>
  <index>56</index>  <edit>Y</edit>
  <index>57</index>  <edit>Z</edit>
  <index>58</index>  <edit>[</edit>
  <index>59</index>  <edit>\</edit>
  <index>60</index>  <edit>]</edit>
  <index>61</index>  <edit>^</edit>
  <index>62</index>  <edit>_</edit>
  <index>63</index>  <edit>`</edit>
  <index>64</index>  <edit>a</edit>
  <index>65</index>  <edit>b</edit>
  <index>66</index>  <edit>c</edit>
  <index>67</index>  <edit>d</edit>
  <index>68</index>  <edit>e</edit>
  <index>69</index>  <edit>f</edit>
  <index>70</index>  <edit>g</edit>
  <index>71</index>  <edit>h</edit>
  <index>72</index>  <edit>i</edit>
  <index>73</index>  <edit>j</edit>
  <index>74</index>  <edit>k</edit>
  <index>75</index>  <edit>l</edit>
  <index>76</index>  <edit>m</edit>
  <index>77</index>  <edit>n</edit>
  <index>78</index>  <edit>o</edit>
  <index>79</index>  <edit>p</edit>
  <index>80</index>  <edit>q</edit>
  <index>81</index>  <edit>r</edit>
  <index>82</index>  <edit>s</edit>
  <index>83</index>  <edit>t</edit>
  <index>84</index>  <edit>u</edit>
  <index>85</index>  <edit>v</edit>
  <index>86</index>  <edit>w</edit>
  <index>87</index>  <edit>x</edit>
  <index>88</index>  <edit>y</edit>
  <index>89</index>  <edit>z</edit>


 ^  Rows and character representation

The following example uses two colours ' ! ' at index 0 and ' " ' at index 1.


  <lzw-minimum-code-size>2</lzw-minimum-code-size>

    <data-rows>
      <row count="0"   >!!!!!!!!!!!!!!!!!!!!!!</row>
      <row count="1"   >!!!!!!!!!!!!!!!!!!!!!!</row>
      <row count="2"   >!!!!!!!!!!!!!!!!!!!!!!</row>
      <row count="3"   >!!!!!!!!!!!!!!!!!!!!!!</row>
      <row count="4"   >!!!!!!!!!!!!!!!!!!!!!!</row>
      <row count="5"   >!!!!!!!!!!!!!!!!!!!!!!</row>
      <row count="6"   >!!!!!!!!!!!!!!!!!!!!!!</row>
      <row count="7"   >!!!!!!!!!!!!!!!!!!!!!!</row>
      <row count="8"   >!!!!!!!!!!!!!!!!!!!!!!</row>
      <row count="9"   >!!!!!!!!""""""""""""!!</row>
      <row count="10"  >!!!!!!!""""""""""""!!!</row>
      <row count="11"  >!!!!!!""""""""""""!!!!</row>
      <row count="12"  >!!!!!""""""""""""!!!!!</row>
      <row count="13"  >!!!!""""""""""""!!!!!!</row>
      <row count="14"  >!!!""""""""""""!!!!!!!</row>
      <row count="15"  >!!""""""""""""!!!!!!!!</row>
      <row count="16"  >!!!!!!!!!!!!!!!!!!!!!!</row>
    </data-rows>


 ^  Counts and interlaced images

The "count" attribute needs to be present but is not used in processing.

If an image is not interlaced the "count" in the <row count="." > represents the row identifier with the first row being count="0". The second row has count="1" and so on. Each row is listed in sequence.

If the "counts" are not in order the image is interlaced as in the table below. Here the first row processed has count=0, the second row processed has count=1 (which is actually the ninth row (eighth from row 0). Small images shoule not be interlaced.


  <lzw-minimum-code-size>2</lzw-minimum-code-size>

    <data-rows>
      <row count="0"   >""""""""""""</row>
      <row count="7"   >"!!!!!!"""""</row>
      <row count="4"   >"!"!""!"""""</row>
      <row count="8"   >"!!!""!!!"""</row>
      <row count="2"   >"!""""!"!"""</row>
      <row count="9"   >"!""""!"!!!"</row>
      <row count="5"   >"!""""!"!"!"</row>
      <row count="10"  >"!""""!"!"!"</row>
      <row count="1"   >"!!!!!!"!"!"</row>
      <row count="11"  >"""!""""!"!"</row>
      <row count="6"   >"""!!!!!!"!"</row>
      <row count="12"  >"""""!""""!"</row>
      <row count="3"   >"""""!!!!!!"</row>
    </data-rows>


Life's too short why wait forever
Privacy Declaration
Copyright © 2000 - 2005. WhyWaitForever. All rights reserved.
Legal Disclaimer