# man > ppmtoacad(1)

> **TLDR:** Convert a PPM image to an AutoCAD database or slide.
>
- Convert a PPM image to an AutoCAD slide:
  `ppmtoacad {{path/to/file.ppm}} > {{path/to/file.acad}}`
- Convert a PPM image to an AutoCAD binary database import file:
  `ppmtoacad {{-d|-dxb}} {{path/to/file.ppm}} > {{path/to/file.dxb}}`
- Restrict the colors in the output to 8 RGB shades:
  `ppmtoacad -8 {{path/to/file.ppm}} > {{path/to/file.dxb}}`

*Source: tldr-pages*

---

[ppmtoacad(1)](https://www.chedong.com/phpMan.php/man/ppmtoacad/1/markdown)                           General Commands Manual                          [ppmtoacad(1)](https://www.chedong.com/phpMan.php/man/ppmtoacad/1/markdown)



## NAME
       ppmtoacad - convert portable pixmap to AutoCAD database or slide

## SYNOPSIS
       **ppmtoacad** [**-dxb**] [**-poly**] [**-background** _colour_] [**-white**] [**-aspect** _ratio_] [**-8**] [_ppmfile_]

## DESCRIPTION
       Reads  a portable pixmap as input.  Produces an AutoCAD® slide file or binary database import
       (.dxb) file as output.  If no _ppmfile_ is specified, input is read from standard input.

## OPTIONS
### -dxb
              DXBIN  command  and, once loaded, becomes part of the AutoCAD geometrical database and
              can be viewed and edited like any other object.  Each sequence of identical pixels be‐
              comes a separate object in the database; this can result in very large AutoCAD drawing
              files.  However, if you want to trace over a bitmap, it lets you zoom and  pan  around
              the bitmap as you wish.

### -poly -dxb
              Normally each row of pixels is represented by an AutoCAD line entity.  If **-poly** is se‐
              lected,  the pixels are rendered as filled polygons.  If the slide is viewed on a dis‐
              play with higher resolution than the source pixmap, this will cause the pixels to  ex‐
              pand instead of appearing as discrete lines against the screen background colour.  Re‐
              grettably, this representation yields slide files which occupy  more  disc  space  and
              take longer to display.

### -background
              Most  AutoCAD  display  drivers  can  be configured to use any available colour as the
              screen background.  Some users perfer a black screen background, others  white,  while
              splinter  groups advocate burnt ocher, tawny puce, and shocking grey.  Discarding pix‐
              els whose closest AutoCAD colour representation is equal to the background colour  can
              substantially  reduce  the size of the AutoCAD database or slide file needed to repre‐
              sent a bitmap.  If no **-background** colour is specified, the screen background colour is
              assumed  to  be black.  Any AutoCAD colour number may be specified as the screen back‐
              ground; colour numbers are assumed to specify the hues defined in the standard AutoCAD
              256 colour palette.

### -white
              a short-cut.  Specifying **-white** is identical in effect to **-background** **7**.

### -aspect
              If the source pixmap had non-square pixels, the ratio of  the  pixel  width  to  pixel
              height  should  be  specified as _ratio_.  The resulting slide or .dxb file will be cor‐
              rected so that pixels on the AutoCAD screen will be square.  For example,  to  correct
              an image made for a 320x200 VGA/MCGA screen, specify **-aspect** **0.8333**.

### -8

       All flags can be abbreviated to their shortest unique prefix.

## BUGS
       AutoCAD has a fixed palette of 256 colours, distributed along the hue, lightness, and satura‐
       tion axes.  Pixmaps which contain many nearly-identical colours, or colours not  closely  ap‐
       proximated by AutoCAD's palette, may be poorly rendered.

       **ppmtoacad** works best if the system displaying its output supports the full 256 colour AutoCAD
       palette.  Monochrome, 8 colour, and 16 colour configurations will produce less  than  optimal
       results.

       When  creating a .dxb file or a slide file with the **-poly** option, **ppmtoacad** finds both verti‐
       cal and horizontal runs of identical pixels and consolidates them into rectangular regions to
       reduce  the  size  of the output file.  This is effective for images with large areas of con‐
       stant colour but it's no substitute for true raster to  vector  conversion.   In  particular,
       thin diagonal lines are not optimised at all by this process.

       Output files can be huge.

## SEE ALSO
       AutoCAD  Reference  Manual:  _Slide_  _File_  _Format_  and _Binary_ _Drawing_ _Interchange_ _(DXB)_ _Files_,
       [**ppm**(5)](https://www.chedong.com/phpMan.php/man/ppm/5/markdown)

## AUTHOR
            John Walker
            Autodesk SA
            Avenue des Champs-Montants 14b
            CH-2074 MARIN
            Suisse/Schweiz/Svizzera/Svizra/Switzerland
            Usenet:  <kelvin@Autodesk.com>
            Fax:     038/33 88 15
            Voice:   038/33 76 33

       Permission to use, copy, modify, and distribute this software and its documentation  for  any
       purpose  and  without  fee  is  hereby granted, without any conditions or restrictions.  This
       software is provided ``as is'' without express or implied warranty.

       AutoCAD and Autodesk are registered trademarks of Autodesk, Inc.



                                           10 October 1991                              [ppmtoacad(1)](https://www.chedong.com/phpMan.php/man/ppmtoacad/1/markdown)
