<i>Important note when using this image in Wikipedia articles: do not use thumbnails or force a change in the size of the image! The Wikimedia thumbnailing processes hide the increase in colour depth</i>.
<p>A typical GIF file is limited to 256 colours. This limit can be overcome by taking advantage of the fact that a single GIF image may be formed from many frames, each frame having its own local palette of 256 colours, including 1 transparent "colour". These frames are most often used in animations by displaying them one after the other with an appropriate time delay. Instead, each frame can contain a portion of the full image having no more than 255 colours with the rest of the frame being transparent. If all the frames are displayed simultaneously (i.e., with a delay time between each of zero) a full colour image results.
</p>
<div class="thumb tright"><div class="thumbinner" style="width:212px;"><a href="//commons.wikimedia.org/wiki/File:SmallRainbow3483Colours.png" class="image"><img src="https://upload.wikimedia.org/wikipedia/commons/f/f7/SmallRainbow3483Colours.png" decoding="async" width="210" height="210" class="thumbimage" data-file-width="210" data-file-height="210"></a>  <div class="thumbcaption"><div class="magnify"><a href="//commons.wikimedia.org/wiki/File:SmallRainbow3483Colours.png" class="internal" title="Enlarge"></a></div>The original 3,483 colour image</div></div></div>The animation first shows a 255 colour image generated from the full colour image shown to the right. Reducing the number of colours from the 3,483 in the original results in obvious transitions between regions of different colours. The image is then split into 9 smaller blocks. For each of those blocks, a separate frame is created from the original full colour image containing just the content of that block with the rest of the frame being a transparent colour. A local palette of up to 255 colours is generated for each block to recreate that portion of the original image as accurately as possible. All 9 frames are then displayed together to create the final image. The improvement in image quality is obvious and the resulting image has 1859 colours. Further improvements in image quality could be obtained by selecting the blocks more carefully such that each block has no more than 255 colours in the original image; the blocks also need not be contiguous regions. Alternatively, smaller blocks could be used: a 16x16 block has 256 pixels so would contain at most that many colours and would be a suitable choice for all but the most complex of images.
<p>In practice, this technique for displaying full colour GIFs is rarely used due to its complexity and the existence of other file formats which can more easily display more than 256 colours. There are also technical limitations in the computer programs commonly available for both creating and displaying GIF files which make it unfeasible. For example, to reduce file sizes, many GIF creation programs generate a single global palette of colours across all frames of an animation rather than separate local palettes for each individual frame. Also, most programs for displaying GIFs, such as web browsers, have a minimum delay time that can exist between animation frames. Consequently, rather than all of the frames being displayed simultaneously, the image is built up gradually as each frame appears in sequence.
</p><p>The delay between each frame of the animation is at least 0.1 seconds to ensure that all common desktop web browsers are able to display it correctly. Other display programs, such as those on mobile devices, may not render the animation correctly and thumbnails of the animation generated by Wikimedia apply a global palette across the whole animation, hiding the increase in colour depth. If it can be used at full size, or if you consider it acceptable to tell readers to click through to the full-size image, <a href="//commons.wikimedia.org/wiki/File:FullColourGIF.gif" class="mw-redirect" title="File:FullColourGIF.gif">FullColourGIF</a> is a larger and clearer version of this animation.
</p>
Each frame of the animation was created using Corel PaintShop Pro X5. The animation itself was created using Zoner GIF Animator 5, one of a limited number of programs capable of generating a separate local palette for each frame of an animation.
<a href="//commons.wikimedia.org/wiki/User:GDallimore" title="User:GDallimore">GDallimore</a>
CC BY-SA 3.0
<span class="int-own-work" lang="en">Own work</span>