Export
Usage
Notes
Additional Information
Many Export formats have private options that are specified using the option ConversionOptions: Export["file", expr, "format", ConversionOptions -> {opts}]. AIFF The following option can be given:
| "SampleDepth" | Automatic | sample depth of sound in bits |
• The default setting is "SampleDepth" -> 8 unless a different depth is explicitly specified in the Sound object. Sound can be exported to "AIFF" with a "SampleDepth" of 8 or 16. AU The following option can be given:
| "SampleDepth" | Automatic | sample depth of sound in bits |
• The default setting is "SampleDepth" -> 8, which creates a mu-law 8-bit encoded sound file, unless a different depth is explicitly specified in the Sound object. • Sound can be exported to "AU" with a "SampleDepth" of 8, 16, or 32. AVI The following options can be given:
| "FrameRate" | 15 | determines how many frames should be shown per second | | "Padding" | Automatic | determines whether frame widths are padded |
• With the setting "Padding" -> Automatic, the width of the frames is padded to a multiple of 4 using whitespace. Some media players require the width to be a multiple of 4. • With the setting "Padding" -> None, the width of the frames is not padded. BMP The following option can be given:
| "RLECompression" | True | specifies whether image data should be compressed with run-length encoding |
CSV The following options can be given:
| "ColumnAlignment" | None | how to align elements in the same column | | "FieldSeparator" | "," | string that delimits elements | | "FormatType" | "Automatic" | format of table elements | | "Numeric" | False | determines whether integers, rationals, and mathematical constants be converted to real values | | "TableHeadings" | None | headings for table columns and rows |
• The option "ColumnAlignment" can be set to the values Left, Right, Center, or None. • The option "FormatType" is a function which is applied to every element in the table. • "TableHeadings" None gives no labels for the rows or columns. • "TableHeadings" Automatic gives successive integer labels for the rows and columns. • "TableHeadings" list gives a list of labels for the rows and columns. • "TableHeadings" {columnheadings, rowheadings} gives separate sets of labels for the columns and rows. DICOM The following options can be given:
| "DataDictionary" | Automatic | determines Data Element Tags used for different names | | "VRs" | Automatic | determines the form used to export data elements |
• Export creates files in the DICOM file format as specified in Section PS 3.10 of the DICOM standard. • DICOM Export accepts two forms. • Like other bitmap formats, it accepts Notebook, Cell, and Graphics expressions. These are used to generate the Pixel Data. Additional Data Elements are generated from the Pixel Data as needed. The default Transfer Syntax (Implicit VR Little Endian) is used. • DICOM export also accepts a list of Data Elements of the form {DataElementTag value, ... }. • The ConversionOption "DataDictionary" determines the Data Element Tags used for names when a list of Data Elements is exported. • With "DataDictionary" Automatic, all Data Element Names in Section PS 3.6 of the DICOM Standard are recognized. All Data Element Names of the form {"Group Number", "Element Number"} are also exported. Any other names cause the export to fail. • A different set of Data Element Tags can be set using "DataDictionary" {"name" {"Group Number", "Element Number"}, ... }. • The ConversionOption "VRs" determines how a Data Element Value is encoded when a list of Data Elements is exported. • With "VRs" Automatic, all VRs in Section PS 3.6 of the DICOM Standard are used. All other Data Elements are exported with an unknown ( "UN") VR. • A different set of VRs can be set using "VRs" {{"Group Number", "Element Number"} "vr", ... }. • Allowed VRs include "AE", "AS", "AT", "CS", "DA", "DS", "DT", "FL", "FD", "IS", "LO", "LT", "OB", "OW", "PN", "SH", "SL", "SQ", "SS", "ST", "TM", "UI", "UL", "UN", "US", and "UT". DXF The following option can be given:
| "GeometryOnly" | True | determines whether to save geometric information without color directives |
EPS The following option can be given:
| "IncludeSpecialFonts" | True | whether to include special fonts in the eps file |
• With "IncludeSpecialFonts" True, Mathematica fonts are embedded in the eps file, making the file self-contained. • With "IncludeSpecialFonts" False, fonts are not embedded in the eps file, making the file significantly smaller. The eps file can be viewed in applications or printed to printers that have access to the Mathematica fonts. ExpressionML In addition to the options listed for "XML", the following option can be given:
| "Annotations" | {"DocumentHeader", "XMLDeclaration", "DOCTYPEDeclaration"} | which annotations to include |
• The setting for "Annotations" is a list which may include any number of the choices "DocumentHeader", "XMLDeclaration", and "DOCTYPEDeclaration". FITS The following option can be given:
| "BITPIX" | Automatic | determines how the data is represented |
• The option "BITPIX" determines whether data is represented as integer or real data. It also determines the number of bytes used to store each number. • The option "BITPIX" can be any of the following values:
| "UnsignedInteger8" | 8-bit unsigned integer | | "Integer16" | 16-bit signed integer | | "Integer32" | 32-bit signed integer | | "Real32" | IEEE single-precision real number | | "Real64" | IEEE double-precision real number | | Automatic | automatically calculated from data |
• The "BITPIX" option cannot be used to alter the data. It must be possible to express the data in the requested form. • The "BITPIX" option does not override the "BITPIX" entry in any headers. Only if there is no header or a header without a "BITPIX" entry will the option be used. • Export accepts a list of Header Data Units (HDUs). Each HDU is a list containing a header and a data unit. If headers are not provided, a basic header is automatically generated. • Each header is a list of entries of the form entry_String {"Value" val_, "Comment" com_String} or, for entries with no comment, entry_String val_. • Data units are tensors. A 0-dimensional tensor is represented by Null. • The primary HDU, IMAGE extensions, and ASCII table extensions are supported. GIF The following options can be given:
| "Background" | False | sets the background color of the image | | "ColorReductionDither" | True | determines whether to use dithering | | "ColorReductionPalette" | Automatic | determines colors in the resulting image | | "Interlace" | False | creates an interlaced GIF | | "Transparency" | False | sets the transparent color of the image |
• "Background" -> RGBColor[r, g, b] sets the background color of the exported GIF to the specified graphics directive. Many applications will ignore this setting and will also not display this color if there is no transparency set. • "ColorReductionDither" -> True will provide better resulting images once a color map is chosen by dithering the image. • "ColorReductionPalette" -> Automatic will choose an adaptive set of at most 256 colors. "ColorReductionPalette" -> n will choose at most n colors for the color palette. "ColorReductionPalette" -> { , , ... } specifies a list of color directives to use to color reduce the image. The values for  must be CMYKColor, GrayLevel, Hue, or RGBColor directives. The number of colors chosen for "ColorReductionPalette" must be between 2 and 256. • The following example produces a color map of 216 "browser safe" colors: Export["file.gif", gr, "GIF", ConversionOptions -> {"ColorReductionPalette" -> Table[RGBColor[i,j,k], {i,0,1,0.2},{j,0,1,0.2},{k,0,1,0.2}] }]. • "Transparency" -> RGBColor[r, g, b] requests that the specified color directive defines the transparent color for the exported GIF. "Transparency" -> GrayLevel[1] defines white as the transparent color. By default, an adaptive "ColorReductionPalette" is used to produce the GIF color palette, and this, in some cases, could produce a set of colors that does not contain the transparent color requested. • A list of graphics objects exported to the GIF format will produce an animated GIF. • The following additional options can be given when exporting as an animated GIF:
| "AnimationDisplayTime" | 0 | sets the delay time in seconds for each frame | | "Disposal" | None | determines how each frame is replaced when displayed | | "GlobalColorReduction" | True | specifies whether to create one color palette shared by all frames | | "Loop" | False | determines whether an animation loops when finished | | "Pause" | False | determines whether there is a pause after each frame |
• "AnimationDisplayTime" -> n sets the delay time in seconds for each frame. By default no delay time is used. If a list of delay times is used, the sequence of delay times is applied to the entire list of frames, repeating the delay time sequence if necessary. • The option "Disposal" tells an application what should replace each frame after the frame is done displaying. The option can have the values of None, False, Background, or Previous. The default setting of "Disposal" -> None will not do anything, and with no transparency in the GIF, this setting will have no noticeable effect. However, if you are creating a transparent GIF animation, you will usually want "Disposal" -> Background as this will clear each frame in the animation before the next frame is displayed; otherwise you will see each frame image drawn on top of the other. • When exporting a list of images for an animated GIF, "GlobalColorReduction" -> True will build one color reduction palette from all images to get one global color map used by the entire GIF, as opposed to building a unique color map for each frame, which could increase the size of the resulting animated GIF. • "Loop" -> True will create an animated GIF that will loop forever, while "Loop" -> n will make the animation loop n times. • With the setting "Pause" -> True, user intervention is required for the animated GIF to continue to the next frame. Currently, there are very few applications that support this feature of the GIF format. HDF/HDF5 The following options can be given:
| "Append" | False | specifies whether to add the data to an existing file | | "FormatType" | Automatic | determines the binary format of the data |
• With the setting "Append" -> True, the HDF/HDF5 dataset is appended to the existing file instead of completely replacing any existing file. The file is created if it does not already exist. • With the default setting of "FormatType" -> Automatic, a multidimensional array of integers is exported as an array of 32-bit integers, and real arrays are exported as an array of 32-bit reals. If an array contains a mixture of integers and reals, all data in the array will be exported as reals. All values are exported modulo the specified data format size limits. • "FormatType" can be set to the following possible binary formats:
| "Byte" | 8-bit unsigned integer | | "Integer8" | 8-bit signed integer | | "Integer16" | 16-bit signed integer | | "Integer32" | 32-bit signed integer | | "Real32" | IEEE single-precision real number | | "Real64" | IEEE double-precision real number | | "UnsignedInteger8" | 8-bit unsigned integer | | "UnsignedInteger16" | 16-bit unsigned integer | | "UnsignedInteger32" | 32-bit unsigned integer |
• Export of HDF currently only supports the "scientific datasets" SDS interface. HTML All of the options to HTMLSave are also options that can be used in ConversionOptions when exporting to "HTML". JPEG The following options can be given:
| "Colorspace" | Automatic | specifies the color space of the exported JPEG | | "Progressive" | False | determines whether a progressive JPEG is created | | "Quality" | 75 | sets the quality factor in the interval 0 to 100 | | "Smoothing" | 0 | sets the smoothing factor in the interval 0 to 100 |
• The option "Colorspace" can be explicitly set to RGBColor or GrayLevel to force the resulting image to a specific color space. • The "Quality" factor determines the quality and size of an exported JPEG, 0 being the lowest quality and smallest file size, and 100 being the highest quality and largest file size. • A smoothing factor can be used to smooth the resulting JPEG image. "Smoothing" -> 0 performs no smoothing, and "Smoothing" -> 100 provides maximum smoothing. List The following options can be given:
| "FormatType" | "Automatic" | format of elements | | "ListSeparator" | "\n" | string that delimits elements |
• The option "FormatType" is a function which is applied to every element in the list. MathML In addition to the options listed for "XML", the following options can be given:
| "Annotations" | {} | which annotations to include | | "Formats" | {"PresentationMathML","ContentMathML"} | forms of MathML to include |
• The setting for "Annotations" is a list which may include any number of the choices "DocumentHeader", "XMLDeclaration", and "DOCTYPEDeclaration". NotebookML In addition to the options listed for "XML", the following options can be given:
| "Annotations" | {"DocumentHeader", "XMLDeclaration", "DOCTYPEDeclaration", "StyleAdvisories"} | which annotations to include | | "BoxFormats" | Automatic | which formats to use for box data | | "GraphicsFormats" | Automatic | which formats to use for graphics data | | "StyleSheets" | {} | CSS or XSLT style sheets |
• The setting for "Annotations" is a list which may include any number of the choices "DocumentHeader", "XMLDeclaration", "DOCTYPEDeclaration", and "StyleAdvisories". PBM, PGM, PPM, PNM The following option can be given:
| "FormatType" | Automatic | specifies whether a binary or text format is created |
• With the default setting "FormatType" -> Automatic, a PBM image will normally be saved as a raw binary PBM file if the number of colors in the image is below the maximum number of levels for a binary format; otherwise the image will be saved in ASCII text PBM format. "FormatType" -> "Text" will force the use of the ASCII text PBM format. STL The following options can be given:
| "SurfaceOrientation" | Automatic | specifies how triangles should be oriented | | "TextFormat" | False | specifies whether data should be stored in ASCII format. |
• The default setting "SurfaceOrientation" -> Automatic results in no orientation applied to triangles. • Setting "SurfaceOrientation" -> {x, y} orients all triangles such that the "top" of each triangle faces the point. • Specifying "SurfaceOrientation" -> Infinity orients all triangles so that they face away from the origin. Table The following options can be given:
| "ColumnAlignment" | None | how to align elements in the same column | | "FormatType" | "Automatic" | format of table elements | | "TableHeadings" | None | headings for table columns and rows | | "TableSeparators" | {"\n", " "} | strings that delimit rows and columns |
• The option "ColumnAlignment" can be set to the values Left, Right, Center, or None. • The option "FormatType" is a function which is applied to every element in the table. • "TableHeadings" None gives no labels for the rows or columns. • "TableHeadings" Automatic gives successive integer labels for the rows and columns. • "TableHeadings" list gives a list of labels for the rows and columns. • "TableHeadings" {columnheadings, rowheadings} gives separate sets of labels for the columns and rows. TeX All of the options to TeXSave are also options that can be used in ConversionOptions when exporting to "TeX". TIFF The following options can be given:
| ByteOrdering | Automatic | determines the byte order of the TIFF | | "Compression" | "Packbits" | specifies how the image data is compressed | | "Planes" | "Single" | determines whether data is stored in a planar or meshed configuration | | "Predictor" | None | specifies a particular compression predictor method | | "ImageScaling" | True | specifies how image data is scaled |
• TIFF images can be saved in different byte ordering formats. By default the byte ordering for the current platform is used. ByteOrdering -> 1 or ByteOrdering -> -1 will force the use of a specific byte ordered TIFF. • The option "Compression" can have the values None, "Packbits", "LZW", "JPEG", or "ZIP". A TIFF exported with "LZW", "JPEG", or "ZIP" compression schemes may not be recognized by certain applications. • TIFF images can be saved in a meshed or planar configuration. "Planes" -> "Single" stores RGBColor data in an "RGBRGB..." order, while "Planes" -> "Multiple" stores the data as "RRR...GGG...BBB...". • The "Predictor" option is only used with "LZW" and "ZIP" compression schemes and can be set to either None or "HorizontalDifferencing". Depending upon the contents of the image, a different "Predictor" value could result in better compression. • The option "ImageScaling" determines whether exported data is scaled to standard byte values or whether the "MaxValue" TIFF tag is used and the data is left unscaled. Some applications do not correctly check the "MaxValue" TIFF tag and may display images incorrectly if this method is used. • A list of graphics objects can be exported to the TIFF format and each image will be stored in a TIFF directory of the file. Some applications will only read the first image of a TIFF file containing multiple images. TSV The following options can be given:
| "ColumnAlignment" | None | how to align elements in the same column | | "FormatType" | "Automatic" | format of table elements | | "Numeric" | False | determines whether integers, rationals, and mathematical constants be converted to real values | | "TableHeadings" | None | headings for table columns and rows |
• The option "ColumnAlignment" can be set to the values Left, Right, Center, or None. • The option "FormatType" is a function which is applied to every element in the table. • "TableHeadings" None gives no labels for the rows or columns. • "TableHeadings" Automatic gives successive integer labels for the rows and columns. • "TableHeadings" list gives a list of labels for the rows and columns. • "TableHeadings" {columnheadings, rowheadings} gives separate sets of labels for the columns and rows. WAV The following option can be given:
| "SampleDepth" | Automatic | sample depth of sound in bits |
• The default setting is "SampleDepth" -> 8 unless a different depth is explicitly specified in the Sound object. Sound can be exported to "WAV" with a "SampleDepth" of 8 or 16. XML The form of output produced by Export["file", data, "XML"] depends on the kind of data being exported. When the data to be exported is a symbolic XML expression (as obtained from Import["file", "SymbolicXML"], for example), the symbolic expression is converted into XML text. When the data to be exported is a notebook or cell expression, NotebookML is generated. For expressions that are neither symbolic XML nor notebooks nor cells, ExpressionML is generated. For these cases, see the options listed for NotebookML and ExpressionML. The following options may be given for any form of XML:
| "ElementFormatting" | Automatic | indentation of elements and line breaking of long strings in the output | | "Entities" | None | rules for replacing characters with named entities | | "CheckXML" | True | whether to attempt to repair small errors in the symbolic XML expression being exported | | "NamespacePrefixes" | {} | namespace prefix designations, of the form "namespace" -> "prefix" | | "AttributeQuoting" | "'" | quotation mark character to use around attribute values |
|