Mathematica > 数据处理 > 导入和导出 > PBM (.pbm) >

PBM (.pbm)

MIME type: image/x-portable-bitmap
PBM monochrome raster image format.
Member of the Portable family of image formats.
Related to PGM and PPM.
Implements a subset of the PNM format.
Native format of the Netpbm graphics software package.
Primarily used as an intermediate file format on Unix systems.
PBM is an acronym derived from Portable Bit Map.
ASCII or binary format.
Stores raster images formatted as plain text, representing each pixel as a 0 (white) or 1 (black).
Developed in 1988 as part of the Pbmplus package.
  • Export creates binary PBM files.
  • If multiple images are present in a PBM file, Import returns the first of the images.
  • Export exports an image, graphics or any other expression as a raster image to PBM.
  • Export by default generates binary PGM files.
  • When exporting Mathematica graphics or arbitrary expressions to PBM, the resulting image has the same raster size as its displayed form.
  • Image objects are by default exported at their raster size.
  • Because PBM is a raster image format, all fonts are rasterized on export.
  • Import imports the specified element from a PBM file.
  • Import imports multiple elements.
  • The import format can be specified with Import["file", "PBM"] or Import.
  • Export creates a PBM file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
  • In the notebook front end, Insert ► Picture and the Open menu allow import of a PBM file into a cell.
  • Save Selection As exports the selected part of a notebook as a PBM file.
"Elements" list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties and settings
  • Data representation elements:
"Data"array of RGB triples
"Graphics"Graphics object representing an image
"Image"raster image, given as an Image object
"GrayLevels"array of normalized gray-level values
"RGBColorArray"array of RGBColor objects
"ImageSize"raster dimensions
  • General option:
ImageSizeAutomaticoverall image size
  • Detailed properties:
"ColorSpace"GrayLevelcolor space of the image
"ImageTopOrientation"Toporientation of the image in the file
This imports a PBM example file and renders it as Graphics:
Read meta-information elements and from this file:
This imports a PBM example file and renders it as Graphics:
In[1]:=
Click for copyable input
Out[1]=
Read meta-information elements and from this file:
In[2]:=
Click for copyable input
Out[2]=
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
格式:   HTML  |  CDF