SVG (Structured Vector Graphics) Test Charts

for improved MTF measurements

 



Download

Test Charts creates test chart files for printing on high quality inkjet printers. This page focuses on Scalable Vector Graphics (SVG) charts for measuring sharpness (MTF) with Imatest SFR. (Bitmap charts are described elsewhere.) SVG charts can be printed any size at a printer's maximum quality (i.e., resolution) with no limitations, and they generally require much less storage than bitmap images. Several of the SVG charts are well suited for automated testing and have significant advantages over the widely-used ISO 12233 chart, which is not required to make ISO-type MTF measurements.

Color HQ: Affordable Color Management Solutions. 1-800-568-6993

Vector graphic images consist of primitives such as lines, polygons, etc., that can be scaled to any size and do not suffer from the pixellation problems of bitmap images. They print at the printer's maximum quality, regardless of size. Vector graphics are excellent for generating test charts consisting of lines, curves, and areas that don't require complex tone variations such as sine modulation.

Scalable Vector Graphics (SVG) is an XML file format recognized by the World Wide Web Consortium (W3C). SVG files can be read, edited, and printed by Inkscape— an excellent free open-source program (described in Wikipedia). They can also be imported into Adobe Illustrator, Corel Draw, and others. SVG implementations are listed here.

Imatest can create SVG files consisting of lines and polygons, but unfortunately not circles or Bezier curves. This is sufficient for making outstanding targets for measuring SFR and aliasing (moiré patterns, usually colored). Contrast, lightness, and highlight color are selectable.

Introduction: SVG chart designs and advantages

Slanted squares on m x n grids

All but one of the SVG charts consist of slanted squares arranged on an m x n grid. A step chart (density increment = 0.1) and a pair of hyperbolic wedges may be optionally added to some of the charts. The chart's contrast, brightness, and several other details are adjustable. A typical SVG  SFR chart, consisting of a 5x9 grid, is shown below.

SVG SFR chart: 5x9 grid
SVG SFR chart: 5x9 grid, 20:1 contrast, with optional hyperbolic wedge
and step patterns (0.1 density increment)
.

This chart is optimized to print at 20x36 inches (50x90 cm) or larger. It is designed to work with a new module that will have automatic ROI (region of interest) selection. It should not be printed small (letter-size or A4) on inkjet printers because SFR test results would be limited by the printer's resolution. Other grid patterns are available that are optimized for printing at different sizes. Grid choices include 1x2, 2x3, 3x5, 4x7, 5x9, and 7x11. The larger grids (3x5 and up) are optimized for printing on wide format printers, and are available in Imatest Pro only.

The squares are tilted as shown to facilitate the measurement of lateral chromatic aberration, which is done best using tangential (or near-tangential) edges near the boundaries of the image.

The SVG charts have a number of significant advantages over the standard ISO 12233 chart, shown on the right.

ISO 12233 chart
ISO 12233 chart.
  • Far less wasted area. The ISO chart was designed by committee. (I know some members who joke about it.) Less that 10% of its total area is useful for SFR measurements; 90% is wasted. Slanted-edges may not be available in important regions, such as the corners.
  • Larger ROI location tolerance. The Imatest API SFR module requires that ROIs (regions of interest) be selected prior to the run. On the ISO chart, very limited areas are available for selecting ROIs. They have to be just right or they may go outside the pattern or include interfering patterns. The relatively large squares in the SVG charts allow for considerable tolerance. The illustration below shows how the ROI can be shifted much further (vertically) for the SVG chart. The square in the ISO chart is very small: the ROI needs to be as large as possible to ensure good results.
ISO chart selection tolerance
ISO chart ROI selection:
Low (vertical) position tolerance.
SVG chart selection tolerance
SVG chart ROI selection:
High position tolerance.
  • Better suited to automated testing.  The spacing of the slanted squares, the absence of interfering patterns, and the large ROI selection tolerance in the SVG charts is highly compatible with automated ROI refinement, available with Imatest Pro 2.6 (released January 2008). This feature allows regions to be automatically refined (shifted) in repeated runs, where it may not be possible to maintain exact chart alignment.
  • Better contrast control: less clipping.  The standard ISO chart is specified to have a minimum contrast ratio of 40:1, and is typically printed closer to 80:1. This can result in clipping in the shadows or highlights (image too close to levels 0 or 255) in many contrasty digital cameras (sometimes both). It can also reduce the accuracy of MTF measurements because many cameras have complex tonal response curves (pictorially-pleasing "S" curves), which are hard to linearize. This problem has been recognized by the ISO committee, which is designing a chart with much lower contrast for the revised standard (which will include several charts rather than trying to fit all measurements into one chart). A 20:1 contrast ratio is a good choice for a high-contrast SVG chart.
  • Analysis of nonlinear image processing.  Many (perhaps most) digital cameras employ some type of nonlinear signal processing to enhance image appearance. In practice this means that sharpness is increased (increasing MTF at high spatial frequencies) in the proximity of contrasty edges and noise is reduced (reducing MTF at high spatial frequency edges) if there are no contrasty edges nearby. Hence, low and high contrast edges often have very difference MTF response. The SVG charts can have two contrasts (primary and secondary), as illustrated below: primary contrast is 20:1; secondary contrast (in two sections) is 2:1. Tones have been inverted to illustrate one of the many options.

SVG pattern, 4x7 grid, dual contrast, inverted
SVG SFR chart: 4 x7 grid, inverted tones, 20:1 primary (2:1 secondary) contrast,
with optional step pattern (0.1 density increment).

Imatest will supply 5x9 grid charts in sizes up to 24x43 inches. A printed length of about 39 inches is recommended for mounting on standard 30x40 inch foam board. Contact sales at imatest dot com for details.

SVG Squares & Wedges (for printing letter size, A4, etc.)

This pattern consists of tilted squares, "hyperbolic" wedges, bars of varying spatial frequencies, and a replica of the Kodak Q-13 step chart with density steps of 0.1. It is optimized for printing A4 or letter size on a high quality inkjet printer and mounted on a 3x3 grid, as shown on the right— though it can be printed any size without loss of quality. This arrangement it will have a field width of around 32 inches (80 cm), sufficient for measuring the performance of the best modern DSLRs.

If you require a chart printed on a single sheet or if you plan to do automated testing, one of the m x n slanted square on grid charts described above (preferably 5x9) is recommended.

Small SVG chart; 3x3 arrangement
3x3 chart arrangement (for letter/A4 prints)

The chart below was created using Contrast ratio = 20, Gamma = 2.2, Highlight color = White, and Chart lightness = Light. The highlight and dark pixel values are 243 and 62, respectively, resulting in a display contrast of (243/62)2.2 = 20.2 at display gamma = 2.2. One or two of the corner charts could have very low contrast (2 or lower) to better characterize cameras with nonlinear signal processing.

A contrast ratio of 20 is high enough to turn on the maximum sharpening in cameras with nonlinear signal processing (which sharpen only in the presence of edges), but not so high that it is likely to cause clipping (pixel levels 0 or 255). It is half the minimum value of 40 in the soon-to-be-replaced ISO 12233 standard, now understood to be too high for reliable results. We also recommend printing a low contrast target— with contrast = 2 or lower— to better characterize camera performance. Results at contrasts = 20 and 2 will differ— often strongly— in the presence of nonlinear signal processing, which is nearly universal in consumer digital cameras.

Small pattern
SVG Squares and Wedges pattern

Chart details: The edges in the center square and the solid on the lower right are tilted approximately 5.7 degrees (arctan(0.1) ) for use in SFR. The converging line patterns ("hyperbolic" wedges) are intended for viewing moiré patterns: colors resulting from aliasing near the Nyquist frequency. They will eventually be analyzed in a module that includes the CIPA DC-003 measurements . The high frequency pattern goes from 400 to 2000 line widths/box height (LW/BH), where "box height" is the distance from the top to bottom of the active chart area (the rectangle just inside the outer rectangle, which represents the entire page). The low frequency pattern goes from 50 to 500 LW/BH. To convert to line widths per picture height (LW/PH), multiply LW/BH by the vertical pixel count and divide by the number of vertical pixels in the box. Some scale marks are omitted because of chart crowding.

The bar patterns on the left and right vary in spatial frequency from about 50 to 2000 LW/BH. They are uncalibrated. The step chart pattern on the right has density steps of 0.1 if the image is printed correctly: it is a replica of the Kodak Q-13 chart. If the printout is correctly calibrated, i.e., if the printer actually prints with the specified gamma, a Kodak Q-13 chart placed adjacent to the pattern will have identical tones (by visual inspection or scanner image readout). In this case, the printed chart contrast (10 in the above example) will be as specified.

Two charts are available for download. Each is 304 KB (SVG) or 500 KB (PDF— for those of you who don't want to bother installing Inkscape). Right-click on the links to save the file.

The high contrast (20:1) chart may be too contrasty for some cameras— highlights and/or shadows may clip. Chart contrast can be edited by opening the chart in Inkscape and selecting the white area of the image. A message at the bottom of the window will say something like, "Group of 5 objects in root." Rght-click, select Ungroup, click outside the object, then click inside the white area again. Now the message at the bottom will say something like, "Group of 548 objects in root." Again, right-click, select Ungroup, click outside the object, then click inside the white area. This time the message at the bottom should say, "Group of 1 object." Click on Object, Fill and Stroke... Select the Fill tab and click on the Flat color box (to the right of X). Click on the HSL tab. The original value of L should be 243 for this chart (it may not display). Set L for a a lower value. Around 200-220 should work well, even for very contrasty cameras. The final contrast for charts printed at gamma = 2 2 is (L/62)2.2.

Operation

To run Test Charts, run Imatest and click on Test Charts in the Imatest main window. The following dialog box, shown for a 5x9 SVG grid pattern, appears. The available settings change for different patterns. Pattern selections for the SVG charts are shown in boldface on the left.

Pattern selections
SFR: quadrants
SFR: 2 rectangles
Grid
Star
Log frequency-contrast
Zone plate
SVG Squares & Wedges (letter, A4...)
SVG Squares 1x2 (letter, A4...)
SVG Squares 2x3 (>=A3)
SVG Squares 3x5 (>=Super A3/B)
SVG Squares 4x7 (>=Super A3/B)
SVG Squares 5x9 (>= 50 cm (20") h)
SVG Squares 7x11 (>= 60 cm (24") h)
SVG Squares 2x3 (Same orientation)


Test Charts input dialog box for SVG patterns

Select the Pattern (the type of chart), the options, and the folder (directory) and file name for the test chart file. When you are ready to create the file, click on Create test chart. You may cancel by clicking on Close. When the calculations are complete a figure showing the chart (not for printing) appears. You can zoom in to see the fine detail.

The figure with the image of the chart is for preview only: it shows you what the chart looks like and lets you zoom in if you want. Do not print the chart directly from this figure. To print SVG charts, load the Print Test SVG output file (chart_temp.svg in the above example) into an editor that supports SVG. (Inkscape is recommended; Adobe Illustrator, Corel Draw, and others can also be used.) This will allow you to select the size of the print, add annotations, use color management, etc.

Options


SVG Squares and WedgesPattern

Two types of SVG pattern are available: Squares and Wedges (shown on the right; described above), and squares on a grid (1x2, 2x3, 3x5, 4x7, 5x9,  or 7x11; described above). The Squares and Wedges pattern and the 1x2 patterns are designed to be printed small (letter-sized or A4) and mounted in a grid arrangement (typically 3x3) to be photographed. The other grid patterns (3x5 and larger) are designed to be printed larger. The 5x9 and 7 x11 charts are particularly well suited for large format (24 inch and greater) printing. The 2x3 (same orientation) chart is designed to be printed up to Super A3/B (13x19 inches) and placed near the corners of a large target (typically 40x60 inches; 1x1.5 meters). This requires that two of the charts be printed as mirror images, which can be obtained in Inkscape by selecting the chart then clicking on Object, Flip Horizontal.

Highlight color

Magenta highlight colorIn addition to the standard White/Black (or White/Gray) charts, you can replace white with any additive or subtractive primary color: R, G, B, C, M, or Y.

Different colors are of particular interest in analyzing Bayer sensors, where alternate rows of pixels are sensitive to {R, G, R, B, R, ...} and {G, B, G, B, G, ...}. Since there are only half as many R and B sensors as green sensors (and one quarter as many as total pixels), one would expect MTF to be poorer for red-black and blue-black charts than for white-black). Demosaicing algorithms typically make use of different colored pixels for calculating detail (i.e., an edge in the red channel would be sharper if information is present in the other channels). Also, different algorithms perform differently.

Contrast ratio

Choices: None, Maximum, 80, 50, 40, 25, 20, 10, 5, 4, 2, 1.414, 1.2, 1.1

The ratio of the reflectivity of the light to dark areas (the upper zone only in the Log frequency chart). The maximum contrast ratio depends on the printer and paper. It is typically around 100 for glossy (or luster) surfaces, but only around 40 for matte surfaces. Maximum print density = -log10(minimum reflectivity) can be measured in Print Test or estimated by Gamutvision. Available selections are Maximum and 80 through 1.1.

Clipping is often a problem with high contrast targets. The ISO-12233 standard calls for a contrast ratio between 40 and 80, but recent experiments have shown that lower contrast ratios produce more accurate and consistent results, which are less affected by gamma and camera nonlinearities. In 2007 the ISO standard will change to recommend lower contrast chart. The default value for Test Chart is 40 (the minimum recommended in the ISO standard), but 20 is preferred in many cases.

Contrast ratio affects MTF (SFR) measurements in cameras that perform nonlinear signal processing, i.e., noise reduction and sharpening with thresholds— nearly universal in consumer cameras. Charts with at least two contrast ratios: 20 and 2 (or lower) are recommended for characterizing cameras. This is handles with Contrast (alt) (below).

Contrast (alt)

Choices: None, Maximum, 80, 50, 40, 25, 20, 10, 5, 4, 2, 1.414, 1.2, 1.1

Selects a second contrast ratio to display in a few regions in the lower left quadrant — Contrast (alt) = 2.0 is used in four regions in the 5x9 chart shown in the preview images above and below. Available selections are None, Maximum, and 80 through 1.1. All squares in the chart have the same contrast if None is selected. Contrast (alt) is of interest because the nonlinear signal processing in many (perhaps most) digital cameras causes high contrast edges to be sharpened much more strongly than low contrast edges so that high and low contrast edges have different MTF measurements.

Gamma

Choices: 2.5, 2.2, 2.0, 1.8, 1.5, 1.0

You should use the value of gamma for your typical color space and workflow (2.2 is standard for Windows; 1.8 for older Mac systems). The default value is 2.2. Gamma affects the accuracy of the printed contrast ratio and the optional step chart: it must be the same value used for printing (the value of the color space, i.e., 2.2 for Adobe RGB (1998), if color management is used) to get the correct contrast ratio. Note that this is printer gamma, which is only indirectly related to camera gamma, which can be measured with Stepchart using the optional grayscale Step chart.

Added graphics

Affects the slanted square on m x n grid patterns.
None:  No added graphics. The chart is a pure grid of squares.
Stepcharts:  Stepcharts (density step = 0.1) are added to all m x n grid patterns except 2x3.

All:  Add Stepcharts, and add a pair of hyperbolic wedge patterns (converging lines) to the 5x9 and 7x11 patterns.
All (small step ch):  Add small Stepcharts and hyperbolic wedges to the 5x9 and 7x11 patterns.

Chart lightness

Choices: Lightest, Light, Mid-light, Middle, Mid-dark, Darkest

Determines the grayscale level of both the light and dark areas of the chart. Valuable for SFR edge charts, where middle tones are likely to be in the camera's linear response region.

Hexagon chartInvert light/dark, hexagons

Choices: Normal, Invert, Normal (Hexagons), Invert (Hexagons)

Invert light and dark in all regions of the chart except for the Step chart (grayscale). Illustrated above.

If (Hexagons) is specified, replace squares with hexagons. Hexagons have near-45 degree edges in addition to near vertical and near-horizontal edges, which makes them useful for examining motion-related blur. Hexagon orientation alternates. Illustrated on the right.

Lightness (alt)

Choices: Lightest, Light, Mid-light, Middle, Mid-dark, Darkest

Lightness of the regions with the second (alternate) contrast ratio.

Output figure


The output figure contains a preview image of the test chart. It is not anti-aliased. This figure is not intended for printing. To obtain a printout of the chart, open the SVG image file in an editor such as Inkscape, following the instructions below. A high quality inkjet printer is recommended.


SVG chart previwe (not for printing; use the output file!)

You can zoom in on the chart by selecting an area or clicking on a point of interest. Double-clicking restores the complete image.

SVG chart preview zoomed
The preview looks jagged because the preview image lacks anti-aliasing.

Printing SVG charts

To view, edit, and print an SVG chart in Inkscape,

  • Download and install Inkscape. Version 0.45 or higher is recommended. To access the excellent built-in tutorials, open Inkscape and click Help, Tutorials.
  • Run Imatest Test Charts to create an SVG chart or download one of the SVG charts available above. Be sure to choose an appropriate folder and file name. The file extension is svg.
  • Open the saved svg file with Inkscape. You may want to do light editing. For example, to create a mirror image, select the chart image and click Object, Flip Horizontal. You can right-click on the selected chart, click Ungroup, then rearrange the chart to meet your needs.
  • Set the print options. The settings for correct printing are somewhat complex.

Click File, Document Properties... to open the Document Properties window, shown on the right. Display the Page tab. Under Format you can select a standard page size such as US Letter, A4, etc., or you can select a custom page size. Surprisingly, most large inkjet printers require custom page size. For example, for a 13x19 inch print, enter 19.00 for Width, 13.00 for Height, and in (inches) in the units box to the right of Width. Page orientation: should be set to Landscape. When you have finished selecting the page size, click X on the upper-right to close the window.

In the Inkscape window (below), select the figure, click on the small padlock icon between W and H to lock the aspect ratio, then set either W or H to the desired dimension. The other will follow. Set X to the left and Y to the bottom margins. The values shown (X = 0.5, Y = 0.25, W = 10, H = 8, in (inches)) center the image on US Letter-size 8.5x11 inch paper. Alternatively, you can enlarge the image by dragging one of the corner arrows while pressing the Ctrl key to maintain the aspect ratio.

Document Properties window
Document Properties window

Inkscape window
Portion of Inkscape window showing print settings (X, Y, W, H,...)

  • Click on File, Print... to open the Print dialog window. Then click on Properties... to open the printer Properties dialog window. High quality print settings and papers should always be used. Set Orientation to Landscape. If ICC color management is not used and the printer driver can select gamma, be sure to use the same gamma you used to create the chart (2.2 is generally recommended).
  • The image on the right shows the Print dialog box for the Epson R2400, set to perform color management in the printer driver because Inkscape is not ICC compliant. (It does not recognize ICC profiles). Using color management/ICC profiles results in the most accurate tonal response: the contrast will be closest to what you expect.

    Adobe RGB (1998) is the recommended input profile because it has a gamma of exactly 2.2 (sRGB is only approximately 2.2). Relative Colorimetric rendering intent should have a more linear response than Perceptual (see Black Point Compensation). Print Preview should be checked because the print size will only be correct unless all settings described above are exactly correct-- Inkscape is quite unforgiving with print size settings. The preview can be rather slow.
Epson R2400 Print dialog box
  • Click OK in the Properties window, then OK in the Print dialog window. Printing starts after a processing delay, which can be quite long, depending on the computer's memory and speed — often over a minute.
 
Digital image quality testing    Copyright © 2008 Imatest LLC
Designed by VIPixel.com