Graphic File Formats
Major Graphic File Formats
Graphics, which can include figures, photos, maps, line drawings, logos and any other information presented in graphical rather than text based form, are typically stored in one of three primary formats.
Raster or image formats
Rasters or images store data in gridded or pixelated forms. This means they are built from grids of numerical values. Pixels may be defined with a single value to represent spatial data, such as elevation in a digital elevation model. Pixels can also be represented by multiple values, such as RGB mixtures for storing color data in photos.
Raster images are defined by the number of pixels in the file (rows and columns), the resolution of data stored in each pixel (int, float, color density), and the compression type used to reduce the size of the image. Original information is lost once a figure is converted to an image, and the abiity to resize the image while maintaining quality is constrained by the quality of the original image. Techniques can be emplotyed to smooth and sharpen low-resolution images to make them look better at higher resolutions, but resulting values are not original.
Raster image file formats, such as PNG, TIFF, GIF, and JPEG, are best for large gridded datasets and for photos. When creating a raster, make sure that the resolution is suitable for the intended purpose. Raster image formats are also best for use in digital formats, such as on web pages and in presentations. Vector files have to be converted to raster to be viewed digitally, and many itimes those on the fly rederings result in raster images that are lower resolution than desired.
Vector formats
Vector files contain a geometric description of the objects or text that can be rendered smoothly at any desired display size. There are no pixels in a vector file as . A vector file’sthe embedded graphical descriptions capture shape, border, size, font and fill color to build an image. Because the descriptions recalibrate to any size, you can scale a vector image up or down without impacting its quality.
Vector formats are best for graphics that will be used in a variety of sizes, and for graphics where sharp edges or lines are displayed on uniform backgrounds, such as line and scatter plots. Take a line, rasterize it and try to zoom in on it and the edges are blurred since the original line infomraiton has been lost.
Vector files are also best when the intended use is printing rather than digital display. That is because vector files will be rendered at the maximum resolution of the printer, which is typically much higher than digital displays. Rendering of vector files for digital display is less commonly supported, and often results in the use of low-resolution preview images, so convert images to rasters for use on web pages and presentations run through programs such as Powerpoint.
Page description languages
Page description langauges, such as postscript and the portable document format (PDF), are used to describe the layout of a printed page containing text, objects and images. In their simpliest for page description languages can contain a single figure or graphic, which would appear on only a portion of a page. Such files can contain both vector and raster type graphics, allowing for the creation and storage of more complex images that either of the other formats independently.
Modern printers mostly accept Postscript as their standard control language, thus Whether or not you change the format of a file yourself, it has likely been converted to Postscript in the process of printing.
Properties of raster and image files
In order to get the best preformace and results from raster or image files, there are specific properties to which you must pay attention.
Image resolution
Image resolution is typically expressed as the number of pixels in the image, though there are many ways to state the resolution. Some examples that you may encounter are included in the table:
and the depth of color used. - Resolution, typically stated in dots per inch (dpi) - 72 dpi standard screen resolution (default for images stored in PowerPoint) - 600 or 1200 dpi resolution of most printers
| Resolution | Pixels | Ratio | Description |
|---|---|---|---|
| 72 dpi | 72 x 72 | 1:1 | Resolution (density) of a standard computer screen, default for many applications such as Powerpoint. Provides best balance of load time and clarity on most screens. |
| 600 dpi | 600 x 600 | 1:1 | Resolution (density) of most printers. Good balance of clarity and printing speed. |
| 1200 dpi | 1200 x 1200 | 1:1 | Resolution (density) of most printers and often minimum required for journal publications. Larger file size and longer load times are balanced against very high resolution and good clarity even when zoomed. |
| 720P HD | 1280 x 720 | 16:9 | Standard HD Resolution (early HD TVs and content) |
| 1080p FHD | 1920 x 1080 | 16:9 | Full HD Resolution (common on HD TVs and computer monitors) |
| Ultra HD (UHD) | 3840 x 2160 | 16:9 | Ultra HD Resolution (sometimes called 4K UHD, but used exclusively on TVs and monitors) |
| 4K | 4096 x 2160 | 1.9:1 | 4K Resolution (standard for digital movies) |
| 8K | 7680 x 4320 | 16:9 | 8K Resolution (very high resolution screens) |
| 16MP | 5312 x 2988 | 3:2 | Digital camera resolution (e.g., Canon EOS 1D Mark IV, Fujifilm X-Pro1, Fujifilm X-E1) |
| 24MP | 6000 x 4000 | 3:2 | Digital camera resolution (e.g., Canon EOS 80D, Canon EOS 750D, Canon EOS 760D, Nikon D5300, Nikon D5500) |
| 44.8MP | 8192 x 5464 | 3:2 | Digital camera resolution (e.g., Canon EOS R5) |
These are only a selection of relatively common resolutions, for more check out this discussion of commen aspect ratios used in digital photography. It also discusses ratios used for printing imagery.
Image compression
Two types of image compression
-
Lossless compression
- Reduce file size without losing image quality.
- File size larger than with lossy compression.
- Choose when image quality is valued above file size.
- Choose for line figures and schematics.
-
Lossy compression
- Takes advantage of the inherent limitations of the human eye to discard invisible information.
- Allow for variable quality levels (compression).
- Image deterioration becomes noticeable as "compression artifacting" at higher compressions.
- Use for photos.
Color depth
- Color depth
- 8-bit pixel (1 byte) stores 256 colors
- 24-bit pixel (3 bytes) stores 16 million colors (truecolor)
Raster image color depth (or bit depth) defines the number of bits used to represent the color of each pixel, directly determining the image's total color capacity and file size. Higher bit depths allow for finer gradations of color and more realistic images, commonly ranging from 1-bit (black and white) to 24-bit "true color" (16.7 million colors) or 32-bit (including alpha transparency). Autodesk Autodesk +3 Key Color Depth Types 1-bit (Monochrome): 2 colors (black or white). 8-bit (Indexed/Grayscale): 256 colors or shades of gray. 24-bit (True Color): 16.7 million colors (8 bits each for Red, Green, and Blue). 32-bit (True Color + Alpha): 16.7 million colors plus a 8-bit alpha channel for transparency. 16/48-bit (High Color/Deep Color): Used for advanced editing to avoid color distortion. Autodesk Autodesk +8 Impact on Image Quality and Size Color Range: A formula dictates the colors, where is the bit depth (e.g., 8-bit = = 256 colors). File Size: Higher color depth increases memory usage and file size. Editing: 16-bit per channel (48-bit total) is ideal for color grading to prevent quality loss. Esri Esri +5 Common formats like JPEG and PNG typically use 24-bit color, while GIF uses 8-bit, according to Encyclopedia Britannica.
Standard File Formats
- Web Use
- PNG – new standard
- JPEG – for photos (Lossy compression)
- GIF – older standard, being replaced with PNG
- Using within Word
- EPS – create with preview to see in Word, put will always print at maximum resolution, standard for journals.
- BMP – Microsoft raster image file format works well limited compression options
- TIFF – Images can be compressed with Lossy or Lossless compression, standard for journals.
- Using within Powerpoint
- BMP – Microsoft raster image file format, best results after standard PowerPoint reduction of image resolution to 72 dpi
- Avoid EPS, since you will only get the preview unless you are printing
- If you are creating a poster with PowerPoint using EPS can result in high final image quality, but also potential hiccups when printing.
Tools for Working with Image Files
- Microsoft Windows or Mac OSX
- Photoshop – painting, image manipulation and format conversion.
- Adobe Illustrator or Macromedia Freehand – drawing packages for figure/schematic creation (Illustrator can view and edit EPS).
- Word/Powerpoint – drawing tools for simple figure creation.
- WARNING – Powerpoint converts all figures to 96 dpi by default!! 220 dpi is maximum available.
- GSview – display of postscript files (http://pages.cs.wisc.edu/~ghost/gsview/).
- Multiple image display packages are available.
Tools for Working with Image Files
- Linux/Unix
- The GIMP - painting, image manipulation and format conversion. http://www.gimp.org/
- Xfig – drawing package for figure/schematic creation. http://www.xfig.org/
- ImageMagick – suite of tools to create, edit, compose or convert bitmap images. http://www.imagemagick.org/script/index.php
- convert – used to convert images between formats
- display – displays bitmap images in many formats
- gs, ghostview, gv – postscript viewers
- evince – document viewer (PS, EPS and PDF)
- acroread – PDF viewer
- xv – bitmap image viewer
Tools for Working with Spatial Data
- ArcGIS is perhaps the best known, but not the only one and not necessarily the best tool.
- Some other options
- Use matplotlib with the mpl_toolkits.basemap to provide coastlines and boundaries.
- Use the GDAL tools (“module load gdal” on cluster systems) for projection transformations and file type conversions.
- Use SAGA for hydrologic mapping (use saga_cmd on cluster systems; NOTE: include “lib” prefix to use libraries).
- Use QGIS as a free multi-function GIS package, relies on GDAL, SAGA, GRASS and other GIS packages (can be hard to install)
- Use the Generic Mapping Tools (GMT) – a Linux command toolset building complex plots (spatial and Cartesian)