How to increase the resolution in a .tif graph?

How to increase the resolution in a .tif graph?

book

Article ID: KB0080948

calendar_today

Updated On:

Products Versions
Spotfire S+ All supported versions

Description

Many journals require that any graphs submitted be in .tif format and at least 600 dpi. The default resolution created by export.graph() seems to be 72 dpi.

 

Issue/Introduction

How to increase the resolution in a .tif graph?

Environment

Product: TIBCO Spotfire S+ Version: All supported versions OS: Windows only --------------------

Resolution

Resolution is fixed in all of our bitmapped files as a function of page dimensions.  There exists a standing enhancement request to allow users to specify how many pixels per inch they want in the file (similar to dpi on a printer).  With that said, you have two options:

        1) You can change the default resolution of a (TIFF) graphics file from 72 dpi (the default) by instead creating a wmf graphics file (using wmf.graph) and converting it to a TIFF in another application that provides the ability to change resolution.  Currently there is not a way for a user to change this in S-PLUS.

        2) The java.graph function takes arguments width and height (in pixels) that can be used to set the size of the bitmap that the graphics is drawn on, before the bitmap is converted to a jpeg, etc.  By increasing these values from the defaults, you can make a higher-quality image.  Of course, the jpeg, etc files will be bigger.  If just one of width, height is given, the other is set to keep the normal width/height ratio.

Following is some additional information regarding exporting graphs that may be helpful:

        JPEG, BMP, TIFF, and GIF are bitmapped graphics.  They are raster formats more suited for displaying images (pictures) than vector based graphics.  S-PLUS displays graphics internally as vector graphics.  Vector graphics are redrawn according to scale and do not suffer from pixilization as do bitmaps.

        A Windows Metafile is the suggested graphics format because it is a vector-based type of file.  Graphsheets look sharp inside of S-PLUS because vector graphics are used to create images.  This means that S-PLUS plots are drawn with complete lines.  In contrast, JPEG, GIF, TIFF, BMP, and other bitmapped file formats use pixels, and can result in some information loss due to compression.  These formats work well with photographs, in which there is usually so much information that the loss isn't dramatic.  However, all of the information in a graphics file is necessary, so S-PLUS plots don't tend to export well to bitmapped formats.

        If you export an S-PLUS graph directly to a GIF, JPEG, TIFF, or BMP file, the resulting image can have poor resolution and appear badly pixelated.  Enlarging a bitmapped image produces additional image deterioration: the resolution is not increased, but merely enlarged so that you can see more of the individual pixels.  Instead, you should try exporting your S-PLUS graphics to a Windows Metafile (WMF) or Encapsulated Postscript (EPS) format.  Both of these formats support vector graphics, and will retain all of the information in your S-PLUS plots.

        Overall, WMF format is the best of the options, essentially because it is the only format drawn from the original graphics primitives.  Our suggestion is to export as wmf (windows metafile).