top of page
Search
kirasdwo

GIFs Graphics: Tips, Tricks, and Tools for Making and Editing Your Own



The PNG format is newer than the GIF file but offers similar benefits, including lossless compression. One key difference is that only GIFs support animation. Some people prefer PNGs over GIFs for static website graphics because they can display more than 16 million colors, instead of just 256.




GIFs Graphics



The format supports up to 8 bits per pixel for each image, allowing a single image to reference its own palette of up to 256 different colors chosen from the 24-bit RGB color space. It also supports animations and allows a separate palette of up to 256 colors for each frame. These palette limitations make GIF less suitable for reproducing color photographs and other images with color gradients, but well-suited for simpler images such as graphics or logos with solid areas of color.


In the early days of graphical web browsers[when?], graphics cards with 8-bit buffers (allowing only 256 colors) were common and it was fairly common to make GIF images using the websafe palette.[according to whom?] This ensured predictable display, but severely limited the choice of colors. When 24-bit color became the norm, palettes could instead be populated with the optimum colors for individual images.


A small color table may suffice for small images, and keeping the color table small allows the file to be downloaded faster. Both the 87a and 89a specifications allow color tables of 2n colors for any n from 1 through 8. Most graphics applications will read and display GIF images with any of these table sizes; but some do not support all sizes when creating images. Tables of 2, 16, and 256 colors are widely supported.


The GIF encoding process can be modified to create a file without LZW compression that is still viewable as a GIF image. This technique was introduced originally as a way to avoid patent infringement. Uncompressed GIF can also be a useful intermediate format for a graphics programmer because individual pixels are accessible for reading or painting. An uncompressed GIF file can be converted to an ordinary GIF file simply by passing it through an image editor.


Metadata can be stored in GIF files as a comment block, a plain text block, or an application-specific application extension block. Several graphics editors use unofficial application extension blocks to include the data used to generate the image, so that it can be recovered for further editing.


And while it has swelled or dipped, the debate over how to pronounce the acronym for those minute looping animations became a thing once the GIF really took off. Is it a hard g like in graphics? Or a soft g like giant? Answering that question depends who you ask and whose authority on the matter you believe in.


GIFs have become so popular that even politicians are getting in on the fun. Last year, the House Judiciary Committee published a listicle (or "gifsticle") about President Obama's immigration policies, complete with GIFs from films like Pitch Perfect and The Little Mermaid. Pundits debated whether this appeal to the youth demographic was unbecoming of an official legislative body. But as The Wolf of Wall Street said: "The real question is this, was all this legal?"


If you start with a template, you have the ability to completely customize it to fit your brand and your needs. Or you can start from scratch to create your own custom GIF image. You can upload your own fonts, images and graphics or use the ones provided in the editor.


There are several GIF makers out there, but we think Visme is the best one. This is due to the array of animated graphics and capabilities our tool offers as well as the full customization ability our users get to create a completely unique GIF, unlike anything they've seen on GIPHY or Vimeo before. Plus, you won't be stuck with a massive file size that your iPhone or Android can't handle.


Lossy compression is actually a misnomer for GIFs and PNGs. The compression algorithms used in GIFs and PNGs (LZW and Deflate) are lossless, so there is no loss of data when compressing these palette-based formats. The lossiness comes in when a graphics program automatically prefilters or alters the image to compress more efficiently. The loss of data occurs in the prefiltering phase by increasing redundant patterns along scan lines to improve compression (see Figure 2). Lossy compression has become a shorthand, yet somewhat misleading, phrase for this process.


The format supports up to 8 bits per pixel, allowing a single image to reference a palette of up to 256 distinct colors chosen from the 24-bit RGB color space. It also supports animations and allows a separate palette of 256 colors for each frame. The color limitation makes the GIF format unsuitable for reproducing color photographs and other images with continuous color, but it is well-suited for simpler images such as graphics or logos with solid areas of color.


The creators of the format pronounced GIF with a soft "g", /ˈdʒɪf/, as in "George". However, many people pronounce GIF with a hard "G", as in a 'gift' /ˈɡɪf/,[citation needed] reflecting the way it is pronounced in its own acronym (Graphics Interchange Format). According to the creator of the GIF format, Steve Wilhite, the pronunciation deliberately echoes that of an American peanut butter brand, Jif, and the employees of CompuServe would often say "Choosy developers choose GIF", spoofing this brand's television commercials.[citation needed] This pronunciation was also identified by CompuServe in their documentation of a graphics display program called CompuShow.[2] Both pronunciations are given as correct by the Oxford English Dictionary[3] and the American Heritage Dictionary.[4]


GIF is palette based: although any palette selection can be one of millions of shades, the maximum number that can be used in a frame is 256. These are stored in a "palette", a table that associates each palette selection number with a specific RGB value. The limitation to 256 colors seemed reasonable at the time of GIF's creation because few people could afford the hardware to display more. Simple graphics, line drawings, cartoons, and grey-scale photographs typically need fewer than 256 colors. In addition, one of the colors in the palette can optionally be set as fully transparent. A transparent pixel takes on the color of the pixel in the same positions from the background, which may have been determined by a previous frame of animation.


In the early days of graphical web browsers, graphics cards with 8-bit buffers (allowing only 256 colors) were common and it was fairly common to make GIF images using the websafe palette.[citation needed] This ensured predictable display but severely limited the choice of colors. Now that 32-bit graphics cards, which support 24-bit color, are the norm, palettes can be made up of the optimum colors for individual images.


The GCEs allow the duration for which each frame is displayed to be specified in hundredths of second. Some economy of data is possible where a frame need only rewrite a portion of the pixels of the display, because the Image Descriptor can define a smaller rectangle to be rescanned instead of the whole image.Displays that do not support animated .gifs show only the first frame.


There are three file formats for graphics used on the web: JPG, GIF, and PNG. Each of these file formats are designed with a specific purpose in mind, so it is important to understand the differences when we use them in our websites.


Choose Drawtify if you want to create stunning graphics that help you quickly convey your message. It allows you to create everything from logos to labels, stamps, and illustrations with zero experience.


Designed for bloggers, social media marketers, small business owners, and entrepreneurs, Stencil is effortless to use. It offers pre-made templates, 5M stock images, and an easy-to-use UI to make quality graphics accessible for all.


See also the web directory for GIF.GRAPHICS INTERCHANGE FORMAT(sm)Version 89a1987,1988,1989,1990CopyrightCompuServe IncorporatedColumbus, OhioConverted to HTML by Christophe TroncheLaboratoire de Recherche en InformatiqueCover Sheet for the GIF89a SpecificationDEFERRED CLEAR CODE IN LZW COMPRESSION There has been confusion about where clear codes can be found in the data stream. As the specification says, they may appear at anytime. There is not a requirement to send a clear code when the string table is full. It is the encoder's decision as to when the table should be cleared. When the table is full, the encoder can chose to use the table as is, making no changes to it until the encoder chooses to clear it. The encoder during this time sends out codes that are of the maximum Code Size. As we can see from the above, when the decoder's table is full, it must not change the table until a clear code is received. The Code Size is that of the maximum Code Size. Processing other than this is done normally. Because of a large base of decoders that do not handle the decompression in this manner, we ask developers of GIF encoding software to NOT implement this feature until at least January 1991 and later if they see that their particular market is not ready for it. This will give developers of GIF decoding software time to implement this feature and to get it into the hands of their clients before the decoders start "breaking" on the new GIF's. It is not required that encoders change their software to take advantage of the deferred clear code, but it is for decoders.APPLICATION EXTENSION BLOCK - APPLICATION IDENTIFIER There will be a Courtesy Directory file located on CompuServe in the PICS forum. This directory will contain Application Identifiers for Application Extension Blocks that have been used by developers of GIF applications. This file is intended to help keep developers that wish to create Application Extension Blocks from using the same Application Identifiers. This is not an official directory; it is for voluntary participation only and does not guarantee that someone will not use the same identifier. E-Mail can be sent to Larry Wood (forum manager of PICS) indicating the request for inclusion in this file with an identifier.CompuServe IncorporatedGraphics Interchange FormatDocument Date : 31 July 1990Programming Reference Table of Contents Disclaimer Foreword Licensing About the Document General Description Version Numbers The Encoder The Decoder Compliance About Recommendations About Color Tables Blocks, Extensions and Scope Block Sizes Using GIF as an embedded protocol Data Sub-blocks Block Terminator Header Logical Screen Descriptor Global Color Table Image Descriptor Local Color Table Table Based Image Data Graphic Control Extension Comment Extension Plain Text Extension Application Extension TrailerAppendix A.Quick Reference TableAppendix B.GIF GrammarAppendix C.GlossaryAppendix D.ConventionsAppendix E.Interlaced ImagesAppendix F.Variable-Length-Code LZW CompressionAppendix G.On-line Capabilities Dialogue1. Disclaimer.The information provided herein is subject to change without notice. In noevent will CompuServe Incorporated be liable for damages, including any loss ofrevenue, loss of profits or other incidental or consequential damages arisingout of the use or inability to use the information; CompuServe Incorporatedmakes no claim as to the suitability of the information.2. Foreword.This document defines the Graphics Interchange Format(sm). The specificationgiven here defines version 89a, which is an extension of version 87a.The Graphics Interchange Format(sm) as specified here should be consideredcomplete; any deviation from it should be considered invalid, including but notlimited to, the use of reserved or undefined fields within control or datablocks, the inclusion of extraneous data within or between blocks, the use ofmethods or algorithms not specifically listed as part of the format, etc. Ingeneral, any and all deviations, extensions or modifications not specified inthis document should be considered to be in violation of the format and shouldbe avoided.3. Licensing.The Graphics Interchange Format is the copyright property of CompuServe Incorporated. Only CompuServe Incorporated is authorized to define, redefine,enhance, alter, modify or change in any way the definition of the format.CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-freelicense for the use of the Graphics Interchange Format(sm) in computersoftware; computer software utilizing GIF(sm) must acknowledge ownership of theGraphics Interchange Format and its Service Mark by CompuServe Incorporated, inUser and Technical Documentation. Computer software utilizing GIF, which isdistributed or may be distributed without User or Technical Documentation mustdisplay to the screen or printer a message acknowledging ownership of theGraphics Interchange Format and the Service Mark by CompuServe Incorporated; inthis case, the acknowledgement may be displayed in an opening screen or leadingbanner, or a closing screen or trailing banner. A message such as the followingmay be used: "The Graphics Interchange Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated."For further information, please contact : CompuServe Incorporated Graphics Technology Department 5000 Arlington Center Boulevard Columbus, Ohio 43220 U. S. A.CompuServe Incorporated maintains a mailing list with all those individuals andorganizations who wish to receive copies of this document when it is correctedor revised. This service is offered free of charge; please provide us with yourmailing address.4. About the Document.This document describes in detail the definition of the Graphics InterchangeFormat. This document is intended as a programming reference; it isrecommended that the entire document be read carefully before programming,because of the interdependence of the various parts. There is an individualsection for each of the Format blocks. Within each section, the sub-sectionlabeled Required Version refers to the version number that an encoder will haveto use if the corresponding block is used in the Data Stream. Within eachsection, a diagram describes the individual fields in the block; the diagramsare drawn vertically; top bytes in the diagram appear first in the Data Stream.Bits within a byte are drawn most significant on the left end. Multi-bytenumeric fields are ordered Least Significant Byte first. Numeric constants arerepresented as Hexadecimal numbers, preceded by "0x". Bit fields within a byteare described in order from most significant bits to least significant bits.5. General Description.The Graphics Interchange Format(sm) defines a protocol intended for the on-linetransmission and interchange of raster graphic data in a way that isindependent of the hardware used in their creation or display.The Graphics Interchange Format is defined in terms of blocks and sub-blockswhich contain relevant parameters and data used in the reproduction of agraphic. A GIF Data Stream is a sequence of protocol blocks and sub-blocksrepresenting a collection of graphics. In general, the graphics in a DataStream are assumed to be related to some degree, and to share some controlinformation; it is recommended that encoders attempt to group together relatedgraphics in order to minimize hardware changes during processing and tominimize control information overhead. For the same reason, unrelated graphicsor graphics which require resetting hardware parameters should be encodedseparately to the extent possible.A Data Stream may originate locally, as when read from a file, or it mayoriginate remotely, as when transmitted over a data communications line. TheFormat is defined with the assumption that an error-free Transport LevelProtocol is used for communications; the Format makes no provisions forerror-detection and error-correction.The GIF Data Stream must be interpreted in context, that is, the applicationprogram must rely on information external to the Data Stream to invoke thedecoder process.6. Version Numbers.The version number in the Header of a Data Stream is intended to identify theminimum set of capabilities required of a decoder in order to fully process theData Stream. An encoder should use the earliest possible version number thatincludes all the blocks used in the Data Stream. Within each block section inthis document, there is an entry labeled Required Version which specifies theearliest version number that includes the corresponding block. The encodershould make every attempt to use the earliest version number covering all theblocks in the Data Stream; the unnecessary use of later version numbers willhinder processing by some decoders.7. The Encoder.The Encoder is the program used to create a GIF Data Stream. From raster dataand other information, the encoder produces the necessary control and datablocks needed for reproducing the original graphics.The encoder has the following primary responsibilities. Include in the Data Stream all the necessary information toreproduce the graphics. Insure that a Data Stream is labeled with the earliest possibleVersion Number that will cover the definition of all the blocks init; this is to ensure that the largest number of decoders canprocess the Data Stream. Ensure encoding of the graphics in such a way that the decodingprocess is optimized. Avoid redundant information as much aspossible. To the extent possible, avoid grouping graphics which mightrequire resetting hardware parameters during the decoding process. Set to zero (off) each of the bits of each and every fielddesignated as reserved. Note that some fields in the Logical Screen Descriptor and the Image Descriptor were reserved under Version87a, but are used under version 89a.8. The Decoder.The Decoder is the program used to process a GIF Data Stream. It processes theData Stream sequentially, parsing the various blocks and sub-blocks, using thecontrol information to set hardware and process parameters and interpreting thedata to render the graphics.The decoder has the following primary responsibilities. Process each graphic in the Data Stream in sequence, withoutdelays other than those specified in the control information. Set its hardware parameters to fit, as closely as possible, thecontrol information contained in the Data Stream.9. Compliance.An encoder or a decoder is said to comply with a given version of the GraphicsInterchange Format if and only if it fully conforms with and correctlyimplements the definition of the standard associated with that version. Anencoder or a decoder may be compliant with a given version number and notcompliant with some subsequent version.10. About Recommendations.Each block section in this document contains an entry labeled Recommendation;this section lists a set of recommendations intended to guide and organize theuse of the particular blocks. Such recommendations are geared towards makingthe functions of encoders and decoders more efficient, as well as makingoptimal use of the communications bandwidth. It is advised that theserecommendations be followed.11. About Color Tables.The GIF format utilizes color tables to render raster-based graphics. A colortable can have one of two different scopes: global or local. A Global ColorTable is used by all those graphics in the Data Stream which do not have aLocal Color Table associated with them. The scope of the Global Color Table isthe entire Data Stream. A Local Color Table is always associated with thegraphic that immediately follows it; the scope of a Local Color Table islimited to that single graphic. A Local Color Table supersedes a Global ColorTable, that is, if a Data Stream contains a Global Color Table, and an imagehas a Local Color Table associated with it, the decoder must save the GlobalColor Table, use the Local Color Table to render the image, and then restorethe Global Color Table. Both types of color tables are optional, making itpossible for a Data Stream to contain numerous graphics without a color tableat all. For this reason, it is recommended that the decoder save the lastGlobal Color Table used until another Global Color Table is encountered. Inthis way, a Data Stream which does not contain either a Global Color Table ora Local Color Table may be processed using the last Global Color Table saved.If a Global Color Table from a previous Stream is used, that table becomes theGlobal Color Table of the present Stream. This is intended to reduce theoverhead incurred by color tables. In particular, it is recommended that anencoder use only one Global Color Table if all the images in related DataStreams can be rendered with the same table. If no color table is available atall, the decoder is free to use a system color table or a table of its own. Inthat case, the decoder may use a color table with as many colors as itshardware is able to support; it is recommended that such a table have black andwhite as its first two entries, so that monochrome images can be renderedadequately.The Definition of the GIF Format allows for a Data Stream to contain only theHeader, the Logical Screen Descriptor, a Global Color Table and the GIFTrailer. Such a Data Stream would be used to load a decoder with a Global ColorTable, in preparation for subsequent Data Streams without a color table at all.12. Blocks, Extensions and Scope.Blocks can be classified into three groups : Control, Graphic-Rendering andSpecial Purpose. Control blocks, such as the Header, the Logical Screen Descriptor, the Graphic Control Extension and the Trailer, contain informationused to control the process of the Data Stream or information used in settinghardware parameters. Graphic-Rendering blocks such as the Image Descriptor andthe Plain Text Extension contain information and data used to render a graphicon the display device. Special Purpose blocks such as the Comment Extension andthe Application Extension are neither used to control the process of the DataStream nor do they contain information or data used to render a graphic on thedisplay device. With the exception of the Logical Screen Descriptor and theGlobal Color Table, whose scope is the entire Data Stream, all other Controlblocks have a limited scope, restricted to the Graphic-Rendering block thatfollows them. Special Purpose blocks do not delimit the scope of any Controlblocks; Special Purpose blocks are transparent to the decoding process.Graphic-Rendering blocks and extensions are used as scope delimiters forControl blocks and extensions. The labels used to identify labeled blocks fallinto three ranges : 0x00-0x7F (0-127) are the Graphic Rendering blocks,excluding the Trailer (0x3B); 0x80-0xF9 (128-249) are the Control blocks;0xFA-0xFF (250-255) are the Special Purpose blocks. These ranges are defined sothat decoders can handle block scope by appropriately identifying block labels,even when the block itself cannot be processed.13. Block Sizes.The Block Size field in a block, counts the number of bytes remaining in theblock, not counting the Block Size field itself, and not counting the BlockTerminator, if one is to follow. Blocks other than Data Blocks are intended tobe of fixed length; the Block Size field is provided in order to facilitateskipping them, not to allow their size to change in the future. Data blocksand sub-blocks are of variable length to accommodate the amount of data.14. Using GIF as an embedded protocol.As an embedded protocol, GIF may be part of larger application protocols,within which GIF is used to render graphics. In such a case, the applicationprotocol could define a block within which the GIF Data Stream would becontained. The application program would then invoke a GIF decoder uponencountering a block of type GIF. This approach is recommended in favor ofusing Application Extensions, which become overhead for all other applicationsthat do not process them. Because a GIF Data Stream must be processed incontext, the application must rely on some means of identifying the GIF DataStream outside of the Stream itself.15. Data Sub-blocks.a. Description. Data Sub-blocks are units containing data. They do not have a label, these blocks are processed in the context of control blocks, wherever data blocks are specified in the format. The first byte of the Data sub-block indicates the number of data bytes to follow. A data sub-block may contain from 0 to 255 data bytes. The size of the block does not account for the size byte itself, therefore, the empty sub-block is one whose size field contains 0x00.b. Required Version 87a.c. Syntax. 7 6 5 4 3 2 1 0 Field Name Type +---------------+ 0 Block Size Byte +---------------+ 1 +- -+ 2 +- -+ 3 +- -+ Data Values Byte +- -+ up +- . . . . -+ to +- -+ +- -+255 +---------------+ Block Size - Number of bytes in the Data Sub-block; the size must be within 0 and 255 bytes, inclusive. Data Values - Any 8-bit value. There must be exactly as many Data Values as specified by the Block Size field.d. Extensions and Scope. This type of block always occurs as part of a larger unit. It does not have a scope of itself.e. Recommendation None.16. Block Terminator.a. Description. This zero-length Data Sub-block is used to terminate a sequence of Data Sub-blocks. It contains a single byte in the position of the Block Size field and does not contain data.b. Required Version 87a.c. Syntax. 7 6 5 4 3 2 1 0 Field Name Type +---------------+ 0 Block Size Byte +---------------+ Block Size - Number of bytes in the Data Sub-block; this field contains the fixed value 0x00. Data Values - This block does not contain any data.d. Extensions and Scope. This block terminates the immediately preceding sequence of Data Sub-blocks. This block cannot be modified by any extension.e. Recommendation None.17. Header.a. Description. The Header identifies the GIF Data Stream in context. The Signature field marks the beginning of the Data Stream, and the Version field identifies the set of capabilities required of a decoder to fully process the Data Stream. This block is REQUIRED; exactly one Header must be present per Data Stream.b. Required Version Not applicable. This block is not subject to a version number. This block must appear at the beginning of every Data Stream.c. Syntax. 7 6 5 4 3 2 1 0 Field Name Type +---------------+ 0 Signature 3 Bytes +- -+ 1 +- -+ 2 +---------------+ 3 Version 3 Bytes +- -+ 4 +- -+ 5 +---------------+ Signature - Identifies the GIF Data Stream. This field contains the fixed value 'GIF'. Version - Version number used to format the data stream. Identifies the minimum set of capabilities necessary to a decoder to fully process the contents of the Data Stream. Version Numbers as of 10 July 1990 : "87a" - May 1987 "89a" - July 1989 Version numbers are ordered numerically increasing on the first two digits starting with 87 (87,88,...,99,00,...,85,86) and alphabetically increasing on the third character (a,...,z).d. Extensions and Scope. The scope of this block is the entire Data Stream. This block cannot be modified by any extension.e. Recommendations Signature - This field identifies the beginning of the GIF Data Stream; it is not intended to provide a unique signature for the identification of the data. It is recommended that the GIF Data Stream be identified externally by the application. (Refer to Appendix G for on-line identification of the GIF Data Stream.) Version - ENCODER : An encoder should use the earliest possible version number that defines all the blocks used in the Data Stream. When two or more Data Streams are combined, the latest of the individual version numbers should be used for the resulting Data Stream. DECODER : A decoder should attempt to process the data stream to the best of its ability; if it encounters a version number which it is not capable of processing fully, it should nevertheless, attempt to process the data stream to the best of its ability, perhaps after warning the user that the data may be incomplete.18. Logical Screen Descriptor.a. Description. The Logical Screen Descriptor contains the parameters necessary to define the area of the display device within which the images will be rendered. The coordinates in this block are given with respect to the top-left corner of the virtual screen; they do not necessarily refer to absolute coordinates on the display device. This implies that they could refer to window coordinates in a window-based environment or printer coordinates when a printer is used. This block is REQUIRED; exactly one Logical Screen Descriptor must be present per Data Stream.b. Required Version Not applicable. This block is not subject to a version number. This block must appear immediately after the Header.c. Syntax. 7 6 5 4 3 2 1 0 Field Name Type +---------------+ 0 Logical Screen Width Unsigned +- -+ 1 +---------------+ 2 Logical Screen Height Unsigned +- -+ 3 +---------------+ 4 See below +---------------+ 5 Background Color Index Byte +---------------+ 6 Pixel Aspect Ratio Byte +---------------+ = Global Color Table Flag 1 Bit Color Resolution 3 Bits Sort Flag 1 Bit Size of Global Color Table 3 Bits Logical Screen Width - Width, in pixels, of the Logical Screen where the images will be rendered in the displaying device. Logical Screen Height - Height, in pixels, of the Logical Screen where the images will be rendered in the displaying device. Global Color Table Flag - Flag indicating the presence of a Global Color Table; if the flag is set, the Global Color Table will immediately follow the Logical Screen Descriptor. This flag also selects the interpretation of the Background Color Index; if the flag is set, the value of the Background Color Index field should be used as the table index of the background color. (This field is the most significant bit of the byte.) Values : 0 - No Global Color Table follows, the Background Color Index field is meaningless. 1 - A Global Color Table will immediately follow, the Background Color Index field is meaningful. Color Resolution - Number of bits per primary color available to the original image, minus 1. This value represents the size of the entire palette from which the colors in the graphic were selected, not the number of colors actually used in the graphic. For example, if the value in this field is 3, then the palette of the original image had 4 bits per primary color available to create the image. This value should be set to indicate the richness of the original palette, even if not every color from the whole palette is available on the source machine. Sort Flag - Indicates whether the Global Color Table is sorted. If the flag is set, the Global Color Table is sorted, in order of decreasing importance. Typically, the order would be decreasing frequency, with most frequent color first. This assists a decoder, with fewer available colors, in choosing the best subset of colors; the decoder may use an initial segment of the table to render the graphic. Values : 0 - Not ordered. 1 - Ordered by decreasing importance, most important color first. Size of Global Color Table - If the Global Color Table Flag is set to 1, the value in this field is used to calculate the number of bytes contained in the Global Color Table. To determine that actual size of the color table, raise 2 to [the value of the field + 1]. Even if there is no Global Color Table specified, set this field according to the above formula so that decoders can choose the best graphics mode to display the stream in. (This field is made up of the 3 least significant bits of the byte.) Background Color Index - Index into the Global Color Table for the Background Color. The Background Color is the color used for those pixels on the screen that are not covered by an image. If the Global Color Table Flag is set to (zero), this field should be zero and should be ignored. Pixel Aspect Ratio - Factor used to compute an approximation of the aspect ratio of the pixel in the original image. If the value of the field is not 0, this approximation of the aspect ratio is computed based on the formula: Aspect Ratio = (Pixel Aspect Ratio + 15) / 64 The Pixel Aspect Ratio is defined to be the quotient of the pixel's width over its height. The value range in this field allows specification of the widest pixel of 4:1 to the tallest pixel of 1:4 in increments of 1/64th. Values : 0 - No aspect ratio information is given. 1..255 - Value used in the computation.d. Extensions and Scope. The scope of this block is the entire Data Stream. This block cannot be modified by any extension.e. Recommendations None.19. Global Color Table.a. Description. This block contains a color table, which is a sequence of bytes representing red-green-blue color triplets. The Global Color Table is used by images without a Local Color Table and by Plain Text Extensions. Its presence is marked by the Global Color Table Flag being set to 1 in the Logical Screen Descriptor; if present, it immediately follows the Logical Screen Descriptor and contains a number of bytes equal to 3 2Size of Global Color Table+1. This block is OPTIONAL; at most one Global Color Table may be present per Data Stream.b. Required Version 87ac. Syntax. 7 6 5 4 3 2 1 0 Field Name Type +===============+ 0 Red 0 Byte +- -+ 1 Green 0 Byte +- -+ 2 Blue 0 Byte +- -+ 3 Red 1 Byte +- -+ Green 1 Byte +- -+ up +- . . . . -+ ... to +- -+ Green 255 Byte +- -+767 Blue 255 Byte +===============+d. Extensions and Scope. The scope of this block is the entire Data Stream. This block cannot be modified by any extension.e. Recommendation None.20. Image Descriptor.a. Description. Each image in the Data Stream is composed of an Image Descriptor, an optional Local Color Table, and the image data. Each image must fit within the boundaries of the Logical Screen, as defined in the Logical Screen Descriptor. The Image Descriptor contains the parameters necessary to process a table based image. The coordinates given in this block refer to coordinates within the Logical Screen, and are given in pixels. This block is a Graphic-Rendering Block, optionally preceded by one or more Control blocks such as the Graphic Control Extension, and may be optionally followed by a Local Color Table; the Image Descriptor is always followed by the image data. This block is REQUIRED for an image. Exactly one Image Descriptor must be present per image in the Data Stream. An unlimited number of images may be present per Data Stream.b. Required Version 87a.c. Syntax. 7 6 5 4 3 2 1 0 Field Name Type +---------------+ 0 Image Separator Byte +---------------+ 1 Image Left Position Unsigned +- -+ 2 +---------------+ 3 Image Top Position Unsigned +- -+ 4 +---------------+ 5 Image Width Unsigned +- -+ 6 +---------------+ 7 Image Height Unsigned +- -+ 8 +---------------+ 9 See below +---------------+ = Local Color Table Flag 1 Bit Interlace Flag 1 Bit Sort Flag 1 Bit Reserved 2 Bits Size of Local Color Table 3 Bits Image Separator - Identifies the beginning of an Image Descriptor. This field contains the fixed value 0x2C. Image Left Position - Column number, in pixels, of the left edge of the image, with respect to the left edge of the Logical Screen. Leftmost column of the Logical Screen is 0. Image Top Position - Row number, in pixels, of the top edge of the image with respect to the top edge of the Logical Screen. Top row of the Logical Screen is 0. Image Width - Width of the image in pixels. Image Height - Height of the image in pixels. Local Color Table Flag - Indicates the presence of a Local Color Table immediately following this Image Descriptor. (This field is the most significant bit of the byte.) Values : 0 - Local Color Table is not present. Use Global Color Table if available. 1 - Local Color Table present, and to follow immediately after this Image Descriptor. Interlace Flag - Indicates if the image is interlaced. An image is interlaced in a four-pass interlace pattern; see Appendix E for details. Values : 0 - Image is not interlaced. 1 - Image is interlaced. Sort Flag - Indicates whether the Local Color Table is sorted. If the flag is set, the Local Color Table is sorted, in order of decreasing importance. Typically, the order would be decreasing frequency, with most frequent color first. This assists a decoder, with fewer available colors, in choosing the best subset of colors; the decoder may use an initial segment of the table to render the graphic. Values : 0 - Not ordered. 1 - Ordered by decreasing importance, most important color first. Size of Local Color Table - If the Local Color Table Flag is set to 1, the value in this field is used to calculate the number of bytes contained in the Local Color Table. To determine that actual size of the color table, raise 2 to the value of the field + 1. This value should be 0 if there is no Local Color Table specified. (This field is made up of the 3 least significant bits of the byte.)d. Extensions and Scope. The scope of this block is the Table-based Image Data Block that follows it. This block may be modified by the Graphic Control Extension.e. Recommendation None.21. Local Color Table.a. Description. This block contains a color table, which is a sequence of bytes representing red-green-blue color triplets. The Local Color Table is used by the image that immediately follows. Its presence is marked by the Local Color Table Flag being set to 1 in the Image Descriptor; if present, the Local Color Table immediately follows the Image Descriptor and contains a number of bytes equal to3x2Size of Local Color Table+1. 2ff7e9595c


0 views0 comments

Recent Posts

See All

Ball merge 2048

Ball Merge 2048: um jogo de quebra-cabeça divertido e desafiador Se você está procurando um novo e emocionante jogo de quebra-cabeça para...

Comments


bottom of page