Graphics

From MobileRead

(Redirected from BMP)
Jump to: navigation, search

In the context of this wiki, graphics refers to pictures, images, and other artwork that can be used in an eBook.

Contents

[edit] Types of Graphics

There are two types of graphics data, bitmapped and vector.

[edit] Bitmapped

This format is also called raster images from the way is it usually displayed. In its simplest form a bitmap draws a picture by laying down a series of dots. If these dots are small enough and laid closely together in a rectangle the image can be discerned. This is the way a TV and a computer screen displays a picture. It is also the way digital camera pictures are stored.

One dot is referred to as a pixel when it is represented on an electronic screen since it may be represented with more than one dot. For example, on a TV a color pixel is built from 3 different colored dots (Red, Green, Blue). RGB is another term used to describe the bitmapped format utilizing the first letters of the three colors.

While RGB is a popular format there are also other formats. For example a format described as YCbCr would describe the data information by breaking out the Brightness (monochrome data) Y from the Color component. With this definition a Gray scale image could be produced from the Y component alone. The Cb, chroma blue, would contain the data needed to represent the Blue and Cr represents the red data. Note that subtracting the B and R data from the Y data would represent the G data.

[edit] Vector

This format is more like a person would would draw. It is lines and shapes drawn like you would do with a pen. However, unlike a free hand drawing these lines and shapes are described mathematically like you or a draftsman might do with graph paper. A line could be described by two xy coordinates on the paper. Attributes could be defined to describe the thickness of the line, the color, etc. Curved lines can also be described mathematically. Closed vector objects can be empty or filled with a color similar to coloring the image in a coloring book. Objects are typically rendered in a defined order such that later objects are on top of earlier objects which may cause them to obscure a portion of the earlier object. In some cases transparency can be defined to permit the earlier object to show through.

Of the popular graphic formats used in eBooks only TIFF can use a vector format. Vector and Bitmaps images can be combined by drawing the vector data over the top of a bitmap image.

The ePUB standard requires support for SVG, Scalable Vector Graphics, format. This is a full vector format and is intended to provide searchable text and scalable images, two things that raster images have trouble with.

[edit] Zooming

The concept of zooming means to reduce (zoom out) or enlarge (zoom in) the object. For text this generally means to change the amount of text on a screen by increasing or decreasing the individual fonts that are used for the text and then reflowing the page. The font change can be done with scaleable fonts or by replacing the font with one of a different size. For images zooming does different things depending on the type of image.

A bitmap image starts at 100% when there is a one to one correspondence between the pixels in the image with the pixels on the screen. Bitmapped graphic images zoom out by removing or merging pixels to achieve the desired size. There can be slight distortion of content unless the zoomed scale is an exact multiple of the source file. Zooming in replicates the pixels which can cause distortion due to uneven replication and will cause blockiness if the zoom in is so much that the duplicated pixels start becoming visible as pixels. Zooming an image beyond the edge of the screen will require panning to see the rest of the image. With some eBook formats the original image is intentionally shrunk for initial display so that the user can zoom in without losing display resolution of the image. Sometimes zooming is accomplished by replacing the image with another image with more or less pixels to avoid the distortion effects. Of course this causes the eBook to be larger to accommodate the separate images.

A vector image typically does not change quality or get distorted as it is zoomed in or out. The image itself is stored as points and objects in a database so it is not stored in a form that looks like an image. Instead the image is created on the screen based on the scaling of coordinates. Zooming just recomputes and recreates the image with a new scale factor.

[edit] Graphic Formats

The Graphics formats listed here are the predominant ones that are used in eBooks. There are many other formats that are not covered because of their limited use in eBooks.

[edit] BMP

BMP is the extension used for a BitMaP image file which is an uncompressed graphics format developed by Microsoft. The same format can be compressed and if so the extension is normally changed to RLE. A program that claims to support BMP files may or may not be able to support and RLE file. A generic term that is applied to BMP files is RGB files since the bitmap is made up of red, green, and blue information. Some Generic bitmap files may not list the colors in this order.

A 24 bit uncompressed BMP file is huge and should not be used on any but the smallest of images. Reducing the number of bits may reduce the file size considerably with a sacrifice in the quality of the color image due to the reduced colors if they were in use.

Most other OS's do not support BMP files and it is not standard for web browsers although accepted by Internet Explorer. TIF files can contain a generic version of BMP data. Device-independent bitmap, DIB, is the term used to describe a generic bitmap.

[edit] GIF

GIF stands for€“ Graphics Interchange Format and developed in 1987 by CompuServe. It is a lossless bitmapped graphics format which means the compression technology does not lose any of the image detail. It was designed for the reproduction of line drawings but can work well with photographs. Widely used on the Internet for logotypes and drawings. The coding scheme uses a LZW lossless compression scheme which is patented but patents ran out in 2004.

GIF files use a palletized color scheme which means that the pixel color is selected from a predefined pallet of colors. There can be only a maximum of 256 different colors (8 bits) in the pallet but different pictures can have their own pallet. The pallet of colors itself is defined as needed by upto 24 bits of data. Using less colors and less bits will reduce the file size of the picture. Large areas of one color will also reduce the file size.

It is possible to define one of the colors as a transparency color. When this is done the rendering code will not draw that color on the screen. This allows the background color of the screen to be seen in the image. This is mostly used to make the image shape look like it is the total shape rather than a picture with a frame around it.

GIF images can be animated to some degree but eBook readers typically do not support animation although many browser do. In this case only the first image in the animation sequence will be shown. Removing the animation frames will make the image size smaller.

[edit] JPG

JPG (or JPEG) stands for the Joint Photographic Experts Group. It uses 24 bits to represent a color pixel. It uses a lossy compressed graphics format that is designed to support photographs rather than line art. It was developed in 1992 and issued as the ISO 10918-1 standard in 1994, the quality depends directly on the amount of compression employed. It is widely used on the Internet and by most digital camera manufacturers.

The JPEG File Interchange Format (JFIF) is a minimal version of the JPEG Interchange Format that was deliberately simplified so that it could be widely implemented and thus has become the de-facto standard. Another standard format is the Exchangeable image file format (Exif). This is the specification used for the image files on digital cameras.

Jpeg also supports a 256 level gray scale mode which is not lossy. There is also a newer format is called JPEG 2000. It generally has a jp2 or jpg2 extension to distinguish the new improved format from the original format however that is not always the case. Older imaging display programs will not display this newer format. PDF files may have images in this format which can make converting them difficult.

[edit] PNG

PNG stands for Portable Network Graphics format. It is a bitmapped graphic format that employs a lossless compression system. It was designed to improve upon and replace GIF files back when the GIF patent was in effect. PNG does not require a patent license. Its main drawback is the complexity of its color model. It supports many different color schemes including both palettes and direct with differing number of bits. Some software that support PNG may specify that it only supports 8 bit images or have other restrictions on what is supported.

PNG files with more bits per pixel can use some of those bits for transparency. For example a 32 bit pixel might use 24 bits for color (8 for each of the 3 primary colors) and 8 bits for transparency. This is similar to the transparency of GIF images but an existing color is not used. Instead the amount of transparency can be defined per color so that some amount, but perhaps, not all of a background image can show through.

[edit] TIF

TIF (or TIFF) stands for Tagged Image File Format. It is a container that can hold images in a wide variety of bitmapped or even vector formats. They can also be compressed or uncompressed. If compressed they can use RLE, JPG, LZW, Zip or potentially other formats. This standard is owned by Adobe. TIF can even support multiple images and even a mix of bitmapped and vector images in the same file.

Its main drawback is that it is so versatile that saying that TIF is a supported format may mean nothing since there are really many TIF formats. As a result the lowest common denominator soon became what is called TIFF, and even today the vast majority of TIFF files, and the code that reads them, are based on a 32-bit CMYK or 24-bit RGB uncompressed image.

[edit] SVG

SVG, scalable vector graphics, is a vector graphic system and is a required feature of the ePUB publishing standard. It is the only vector graphics system with any standardized use in the eBook field. Scalable Vector Graphics (SVG) is a text-based graphics language that describes images with vector shapes, text, and embedded raster graphics.

[edit] Tips on Graphics for eBooks

Here are some tips to get the best results for graphic images in eBooks.

  • Irfanview is a great graphic editor to use to tweek graphic images. It is free but requires windows.
  • eBooks formats that support PalmOS devices will often have a 64K file size limit for one image. To keep the creation programs from altering your image you may want to adjust it yourself.
  • Some eBook formats have alternate images for different screen sizes. Be sure you consider this when creating an eBook for distribution.
  • Reducing the number of colors, number of layers, and the image size can greatly reduce the size of the image and thus reduce the size of the eBook.
  • JPEG image size is greatly influenced by the quality setting. For eBook use you can often decrease this setting with no visible change in the image.
  • Most dedicated eBook readers are monochrome while most other devices that can read eBooks are color. If your target device is monochrome you may want to convert the image to monochrome to decrease its size and perhaps improve the look However be careful.
    • If the format is also used on PDA's you may want to keep it in color for those platforms.
    • Reducing the bit depth too much can come back to haunt you. For example the original Sony e-Ink device supported only 4 gray levels. If you reduced the image to 4 gray levels the image will look worse that it could in the latest reader which can support 8 levels.
    • When reducing colors avoid dithering. Dithering is a technique used to simulate higher color or gray image levels by mixing black and white dots spaced close together to simulate a gray. This is the technique used in newspapers to produce gray images. Used carefully it can work well but indiscriminant use can cause a speckled appearance to the image.
  • consider clear borders around images to keep text from crowding the image.
  • Some readers are capable of zooming in an image. Don't make the original, such as a map, too small to be able to display the information. However, you may need to cut the image in half to make it viewable.
  • Jpeg can blur simple graphics. Use GIF or PNG for line drawings, particularly if the image is sparse.
  • Images can show text. This can be a work around to display text when you don't have the correct font or text size available in the reader.
  • Increasing the chroma level can often improve dark images better than any other technique.
  • Know the pixel size limit of your target device. Most devices do not support a full screen mode so the graphic pixel size is less due to progress bars and other items that are always on the page. Making your images conform to the maximum will result in the best quality image since it will not have to be shrunk to fit.

[edit] For more information

http://en.wikipedia.org/wiki/Graphics

http://en.wikipedia.org/wiki/BMP_file_format

http://en.wikipedia.org/wiki/Graphics_Interchange_Format

http://en.wikipedia.org/wiki/JPEG

http://en.wikipedia.org/wiki/Tagged_Image_File_Format

Personal tools
MobileRead Networks