# img element

Type: | Images and Specials
Attributes: | dpi • src • align • background-color • background-image-dpi • background-image-position • background-image • background-pdf • border-color • border-style • border-width • border • clear • corner-radius • display • float • font-size • height • href • left • line-cap • line-height • line-join • margin • onmouseover • overflow • padding • page-break-after • page-break-inside • position • rotate • size • top • vertical-align • visibility • white-space • width • class • colorspace • direction • id • lang
See: | circle ellipse pdf shape

Embeds a bitmap image into the PDF. Recognized image formats are PNG, JPEG, GIF and TIFF.
There are several restrictions on the type of image:

- PNG images must be either indexed or specify 8 or less bitplanes per color. PNG images may include an ICC Color Profile and gamma information, which will be embedded in the pdf if found. PNGs with full alpha transparency are not supported.
- Progressive JPEGs can't be rendered in viewers earlier than Acrobat 4.0. They're larger and give no benefit in pdf, so aren't recommended.
- For animated GIF images, only the first frame is embedded.
- The NeXT and Thunderscan TIFF image formats are not supported.

The size of the image in the document is a result of the size of the actual bitmap in pixels multiplied by the dpi of the image. The dpi may be specified by the image (common in TIFF, possible in PNG and JPEG) or may be set explicitly using the dpi attribute. If it's not set by the image or explicitly, it defaults 72dpi - which means 1 pixel = 1 point. Alternatively the width and height attributes may be set to force the size of the image.

These show the three methods of inserting an image

    <img src="myimage.jpg"/>                           <!-- embed at images default resolution -->
    <img src="myimage.jpg" dpi="200"/>                 <!-- embed at 200dpi -->
    <img src="myimage.jpg" width="150" height="100"/>  <!-- embed at a specified size -->