Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Image Export Formats

  1. #1

    Post Image Export Formats

    Table of Contents

    Introduction

    Raster Formats

    Vector Formats

    Introduction to Image Formats

    There are several common image formats we use in creating maps. The purpose of this thread is to examine each of those formats, explain their strengths and weaknesses, and try to give some guidelines on when to use each one.

    First, there are two broad groups of formats: raster vs vector. A raster image is simply a grid of colored pixels (dots on your screen). Most images you see on the web are raster images, described by their resolution of horizontal and vertical pixels. The term "bitmap" is sometimes used interchangeably with raster. Raster images are defined by their resolution ( 800 X 600, for instance, meaning 800 pixels wide by 600 pixels tall ), and their color depth, or bit-depth. The color depth refers to how many possible colors there are in the image. I'll not go into the technical details of color depth here, but if you want further reading, try this article: http://www.luminous-landscape.com/tu...it-depth.shtml

    The other group of image formats are vector images. A vector graphic is described by mathematical formulae that the imaging software interprets and displays. Vector image formulas are continuous, so they are not limited by the resolution of the original picture. This means you can zoom in on a vector image and never see the ugly jaggies associated with increased magnification on a raster image. Unfortunately, web support for vector formats is limited, so although you can create images in a vector format, you will almost certainly have to export to a raster format if you want to share your work on the Internet. Many printshops can accept a variety of vector image formats, though, so if your target output is print, you can stay in vector from beginning to end if you so desire.
    Last edited by Midgardsormr; 02-07-2013 at 03:17 PM.
    Bryan Ray, visual effects artist
    http://www.bryanray.name

  2. #2

    Post Raster Images: the Bitmap

    Among the oldest image formats currently supported is Microsoft's Bitmap (bmp). The bitmap is very simple: it is simply the basic grid of colored dots with no compression. Because bitmaps are not compressed, they can get very large very quickly. For instance, an image with a resolution of 800 X 600 has 480,000 pixels. If it has 8 bits per pixel (256 colors possible), the file will be 480KB. That's one byte for every pixel. Suppose you want a 24-bit image, though? Your image shoots up to 1.44 MB. 800 X 600 is pretty small. If you're wanting a good-sized battle mat, say 24" X 36" at 200 dpi (dots per inch), you're talking about a resolution of 4800 X 7200. That's over 34 million pixels, and at 24 bits per pixel, you've got an image that requires more than 103 MB of memory just to load, to say nothing of emailing it to a friend for critiques.

    The advantage to using the bitmap format is that it requires very little processing to manipulate an image. The computer is not forced to decode a compression scheme, so changes are very quick. That can be an advantage when dealing with complicated computations, although the processor speeds of most modern computers make the time savings minute.

    Bitmaps are best used for small objects that are being prepared for extensive processing. The format does not support transparency, though, so its use is limited. Also, many internet browsers cannot natively display a bitmap. All in all, the bitmap format is largely obsolete, although it is still the default file format for MS Paint for some reason.
    Last edited by Midgardsormr; 06-20-2011 at 06:20 PM.
    Bryan Ray, visual effects artist
    http://www.bryanray.name

  3. #3

    Post Raster Images: Graphic Interchange Format (GIF)

    In the early days of the Web, Compuserve's GIF format was everywhere. The GIF added three important things to imaging: compression, transparency, and animation.

    Unlike the bitmap, GIF uses a compression scheme to reduce file sizes. GIF uses a lossless compression algorithm called Lempel-Ziv Welch (LZW), which looks for repeating horizontal patterns and stores each pattern only once. Every time the pattern is encountered in the image, it is replaced with a code that represents the longer pattern. In this way, GIFs compress by removing horizontal redundancy. GIF's compression is lossless, meaning that no information is discarded during the compression process, so the image will not lose quality if it is resaved.

    GIF's second advantage over the bitmap is its ability to handle transparency. A GIF can have one color designated as transparent, allowing non-square images, and images with holes that let a background show through. However, since only one color can be made transparent, it is impossible to achieve anti-aliasing between a transparent graphic and the background it is placed on. Slanted lines or curves will show very obvious jagged edges.

    The third thing GIF added was simple animation. A GIF can be built with several frames, and it will cycle through them endlessly to allow for very rudimentary motion graphics. Unfortunately, the LZW algorithm is not applied across the frames, so even though two frames may be similar, they are not compressed together. A ten-frame animation will be roughly 10 times larger than a single frame still.

    All is not roses, though. GIF's maximum color depth is only 8 bits, so an image can have a maximum of 256 colors. Although that may seem like quite a lot, many colors are used to soften the jagged edges that appear on arcs and slanted lines. This anti-aliasing process can use far more colors than are allowed by the GIF format.

    GIF is best used for images that have wide areas of solid color and simple geometric shapes. "Cartoony" images and text benefit the most from GIF compression. Text banners for web pages are often saved as GIFs because they allow a designer to use an unusual font, but they remain small enough to not add too much download time. Photographs and textured illustrations will receive almost no benefit from being saved as GIFs versus bitmaps. Also, the small color palette available with GIF means that a photograph will often lose quite a lot of color information, resulting in either ugly banding artifacts or very visible dithering.
    Last edited by Midgardsormr; 06-20-2011 at 06:48 PM.
    Bryan Ray, visual effects artist
    http://www.bryanray.name

  4. #4

    Post Raster Images: Joint Photographic Experts Group (jpeg)

    One of the most common image formats seen today is the jpeg. As its name implies, jpeg was invented for the benefit of digital photography. Like GIF, a jpeg uses compression to reduce file sizes. Unlike GIF, that is all it does; it has no additional features like transparency or animation.

    Jpeg compression is a complex topic, and one that I have to admit I have not completely understood. Fortunately, the fundamentals of the topic are sufficient to know when to use jpeg over other formats. Jpeg is a lossy format; it discards information in order to reduce the file size. Jpeg compression removes some of the intermediate colors in a gradient, resulting in color "banding." At high levels of compression, this banding can become very noticeable, but at lower compression ratios, 50% or higher, the color loss is much less obvious. The compression also tends to add noise to solid-color areas of an image.

    Because jpeg is a lossy algorithm, it is inadviseable to use it for anything other than final exports of an image. Each time a jpeg is resaved, a little more information is lost.

    Jpeg is best used for the final export of a photographic or highly textured image. It does not do well with flat-colored artwork or sharp lines. Compressing text with jpeg will almost always produce blurry edges and obvious visual artifacts.
    Bryan Ray, visual effects artist
    http://www.bryanray.name

  5. #5

    Post Raster Images: Portable Network Graphic (PNG)

    The PNG format is a tremendous improvement over GIF. It generally compresses better, allows more colors, and it allows much more flexibility in transparency. It does not support animation, though.

    PNG's compression algorithm is called Deflate. It is an improved version of LZW, and is the same algorithm used for zip archives. Where GIF compression looks at horizontal patterns, PNG is capable of also looking at vertical patterns, so it can compress an image even further than GIF.

    A GIF image allows only 256 colors, but PNG supports up to 48 bits of color (16 bits per channel) and 16 more bits of transparency information. That's over 280 billion colors--far more than you're ever likely to need. It also allows for an alpha channel, which is a grayscale overlay that determines the level of transparency the image has. The alpha channel allows parts of the image to be translucent, and the edges to fade away. It also makes it possible to anti-alias the edges of a non-square image, eliminating the jagged edges.

    The two most common varieties of PNG are PNG-8, which is an 8-bit palleted image very similar to a GIF, and PNG-24, which is a little bit of a misnomer, as it is 8 bits per channel. 24 bits for color, and 8 more for alpha, which means it is often actually a 32-bit image. Adobe (formerly Macromedia) Fireworks uses PNG as its native format, and a Fireworks PNG has a few extra features beyond the scope of this article. Some applications can open a Fireworks PNG, but those extra features will usually not be present.

    Like GIF, png is best used for illustrative images with flat colors and sharp lines. It can also be used for textured or photographic images when transparency is needed, although it does not compress as well. Because it is a lossless format, it is possible to use it for working images without fear that they will lose quality after multiple saves.
    Last edited by Midgardsormr; 06-20-2011 at 07:16 PM.
    Bryan Ray, visual effects artist
    http://www.bryanray.name

  6. #6
    Community Leader Facebook Connected Badger's Avatar
    Join Date
    Feb 2008
    Location
    Morton, TX
    Posts
    1,473

    Default

    You can delete this post later if it gets in the way... but here's some rep for such a good post on image formats, you go mid! ..
    Have Pen. Will Map.
    Have Dice. Will Travel.
    GM for Hire | Artist and Cartographer | Free Quotes on

  7. #7

    Post

    Thanks. It's pretty much finished now. If anyone notices any inaccuracies, please let me know. It's been quite some time since I learned this stuff, and I may have gotten some of it wrong. I haven't yet figured out how to approach the topic of vector images. If someone else gets inspired, go ahead and have a stab at it!
    Bryan Ray, visual effects artist
    http://www.bryanray.name

  8. #8
    Community Leader pyrandon's Avatar
    Join Date
    Feb 2007
    Location
    Michigan, USA
    Posts
    1,341

    Default

    OK, Bryan: this was amazingly helpful. In about four posts you explained concepts I've never understood (as a techno idiot, myself!) What a great idea and a great execution. Nicely done!
    Don
    My gallery is here
    __________________________________________________ _______
    "Keep your mind in hell, but despair not." --Saint Silouan [1866-1938]

  9. #9

    Post Raster Images: Key Terms

    Aliasing: Because a raster image is simply a grid of pixels, it is impossible to create a true slanted line or arc. The jaggedness seen at the edges of some images is called aliasing, and it is generally regarded as undesirable. However, if the number of colors available is limited, aliasing is unavoidable. See the image below for an example of aliasing.

    Anti-aliasing: Anti-aliasing is a technique for reducing the jagged appearance of slanted lines and arcs. It blends the edges of such figures by adding intermediate colors, which fool the eye and make the edges appear smooth. This image shows how an aliased line is made to appear smoother through anti-aliasing:

    anti-aliasing.png

    Alpha Channel: There are two ways to achieve transparency in an image: Declare pixels of a certain color to be transparent, or add an additional channel of transparency information. This additional channel is called an alpha channel, and it can be used to make areas of an image partially or completely transparent. When separated from the rest of the image, an alpha channel appears to be a greyscale image. When this greyscale image is overlaid on the final image, areas that are black appear transparent, white areas are opaque, and grey areas are translucent, with the level of opacity determined by the value of the grey at that point. The image below illustrates an alpha channel. Notice how the background layer is invisible in the upper left and fully visible in the lower right and how that corresponds with the greyscale gradient. Alpha channels can also be used as selection tools in Photoshop, but that goes beyond the scope of this article. Here's a nice video tutorial for Photoshop: http://www.planetphotoshop.com/desig...a-channel.html

    Alpha demo.png

    Bit Depth: In a computer, every piece of information is described by binary code. One bit is a single "switch" that is either off or on: 0 or 1. So a one-bit pixel has only two values: Black or white. By adding bits, the amount of information that can be stored increases exponentially. A two-bit image can have four values: 00, 01, 10, 11. Each bit added multiplies the number of possible colors by two. Therefore, the bit depth of an image is directly tied to the number of colors the image can display. It is also directly tied to the size of the image file. More bits used to describe each pixel means more space is required to store it. It is common to refer to the total bit-depth of an image as bits per pixel or bits per channel. So 8 bits might refer to a paletted image with a maximum of 256 colors or to an image with 8 bits per channel and millions of possible colors.

    There is also a distinction between integer and floating point numbers. I won't go into great detail here, but the basics are that integer numbers, regardless of depth, have a finite luminance range, running from black at 0 to white at whatever number is at the top of the scale. Floating point numbers run from black at 0 to white at 1, but they also permit negative numbers and values beyond 1. Visually, this doesn't make sense, but it opens some options for High Dynamic Range imaging (HDRi).

    Channel: Each pixel in an image is described by numbers. In a 32-bit RGBA image, each pixel is described by four 8-bit numbers whose values ( 0 - 255 ) determine the color and transparency of that pixel. Each of these numbers represents a channel: red, green, blue, and alpha (transparency). The channels are a way of organizing information about the pixels so that they can be more easily manipulated. Each channel, if viewed by itself, will appear to be a greyscale image, with the brightness of a given pixel indicating the amount of that color present in the full image.

    Color Depth: Color depth is the same as bit depth, except that it is a term more specific to graphics. When dealing with images, the two terms are mostly interchangeable.

    Compression: Compression is a process that reduces the size of a file. Compression can be either "lossy" or "lossless." Lossy compression discards information, so it can achieve very small file sizes at the expense of accuracy. Lossless compression retains all of the original information, so there are limits to how small a file can be made.

    CMYK: A color model that uses four values: cyan, magenta, yellow, and black. CMYK images do not display properly on a computer monitor, but they are ideal for printing. CMYK color mixing is subtractive: adding inks to the page causes fewer frequencies of light to be reflected, resulting in a darker color. Theoretically, equal quantities of cyan, magenta and yellow should produce black. Pigments are never perfect, though, so the result is typically dark brown instead, which is why black ink is added to the system. So-called "rich black" is produced by mixing a small amount of the colored inks with the black ink. The CMY primary hues are the complementary colors of the RGB primary hues. If you use curves to reduce the green in your RGB image, that is equivalent to boosting the magenta.

    Dithering: A process where noise is added to an image to counteract banding artifacts from reducing its color space. If you ever see banding in a very subtle gradient in your image, adding a little bit of noise or grain on that layer will often break it up and may be less obtrusive to the viewer.

    High Dynamic Range imaging (HDRi): A relatively new term in imaging, HDR is all about capturing more detail in images by reclaiming portions of the luminance range that normally fall outside of the limits of an image format. At the moment, it is primarily a topic for photographers, but as displays with greater bit-depth emerge (I have a 10-bit display at my workplace, and 12-bit displays are currently on the market) the limits of 8-bit per channel images are going to start making them obsolete. There are HDR variants of several of the image formats detailed here, but OpenEXR looks like it will be the format of the future. For more information on this topic, I recommend consulting the blog of my friend Christian Bloch: HDR Labs. And if you're interested in even deeper coverage, he wrote the book on the topic: The HDRI Handbook 2.0, available on Amazon.

    Paletted Image: An image for which the colors are preselected and stored in a table in the file rather than having color channels. Paletted images are frequently much smaller than images that use channels, but they are more difficult to work with. A paletted image is often temporarily converted to RGB when it is being edited, and the palette is reconstructed upon saving. Although most software does a good job of selecting a palette, some images might benefit from the user making a couple of decisions while saving to minimize file size.

    Pixel: A single "dot" on a computer screen. A raster image is composed of a grid of pixels, each with its own color information.

    Resolution: The number of pixels present in an image or computer display. Resolution is described with two numbers: the first is the number of horizontal dots (columns) and the second is the number of vertical dots (rows). 800 X 600 means 800 pixels wide by 600 pixels tall. This is distinct from the print resolution, which is described by the number of dots the printer places in a linear inch. The unit of print resolution is dots per inch (dpi), and in terms of image size, it is meaningless unless accompanied by the physical dimensions of the printed piece, measured in inches. So 300 dpi at 8"x10" is a useful description. The screen resolution of an image may be found by multiplying the horizontal and vertical measurements by the dpi. The screen resolution of the example is therefore 2400 x 3000 pixels (8 * 300 x 10 * 300).

    RGB: A color model that uses three values: red, green and blue. RGB images must be converted to CMYK prior to being printed, but they display correctly on a computer monitor. RGB color mixing is additive: adding light to the spectrum causes more frequencies to be perceived by the eye, resulting in a brighter color. The RGB primary hues are complementary to the CMY primary hues. If you need less yellow in your RGB image, increase the blue.
    Last edited by Midgardsormr; 07-06-2016 at 01:46 PM. Reason: corrected an error and expanded some definitions
    Bryan Ray, visual effects artist
    http://www.bryanray.name

  10. #10
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,244
    Blog Entries
    8

    Post

    Very good.. rep,rep,rep...

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •