Many different types of graphic file formats exist, but three graphic file formats are generally used in web pages—GIF, JPEG, and PNG. GIF and JPEG file formats are the best supported and can be viewed in most browsers. You can easily insert images and edit them using the Dreamweaver user interface.

GIF (Graphic Interchange Format)

GIF files use a maximum of 256 colors, and are best for displaying noncontinuous-tone images or those with large areas of flat colors, such as navigation bars, buttons, icons, logos, or other images with uniform colors and tones.

JPEG (Joint Photographic Experts Group)

The JPEG file format is the superior format for photographic or continuous-tone images, because JPEG files can contain millions of colors. As the quality of a JPEG file increases, so does the file size and the file download time. You can often strike a good balance between the quality of the image and the file size by compressing a JPEG file.

PNG (Portable Network Group)

The PNG file format is a patent-free replacement for GIFs that includes support for indexed-color, gray scale, and true-color images, and alpha channel support for transparency. PNG is the native file format of Adobe® Fireworks®. PNG files retain all the original layer, vector, color, and effects information (such as drop shadows), and all elements are fully editable at all times. Files must have the .png file extension to be recognized as PNG files by Dreamweaver.

Insert an image

When you insert an image into a Dreamweaver document, a reference to the image file is generated in the HTML source code. To ensure that this reference is correct, the image file must be in the current site. If it is not in the current site, Dreamweaver asks whether you want to copy the file into the site.

Dreamweaver also allows you to insert images dynamically. Dynamic images are those images that change often. For example, advertising banner rotation systems need to randomly select a single banner from a list of potential banners, and then dynamically display the selected banner’s image when a page is requested.

You can also drag and drop any layer in the Extract panel to any place in Dreamweaver Live View using Live Guides and Element Quick View. The Extract Panel allows you to upload PSD files in to it and then drag and drop any layer in the PSD file directly to your Dreamweaver document.

After you insert an image, you can set image tag accessibility attributes that can be read by screen readers for visually impaired users. These attributes can be edited in HTML code.

For a tutorial on inserting images, see Adding images.

For information on extracting images from your PSD compositions, see Extract images from PSD files.

  1. Place the insertion point where you want the image to appear in the Document window and do one of the following:

    • In the Common category of the Insert panel, click the Images icon .
    • In the Common category of the Insert panel, click the Images button and select the Image icon. With the Image icon displayed in the Insert panel, you can drag the icon to the Document window (or to the Code view window if you are working in the code).
    • Select Insert > Image.
    • Drag an image from the Assets panel (Window > Assets) to the desired location in the Document window; then skip to step 3.
    • Drag an image from the Files panel to the desired location in the Document window; then skip to step 3.
    • Drag an image from the desktop to the desired location in the Document window; then skip to step 3.
    • In Live View, drag an image from the Extract panel or the Layers tab and drop the element at the top, bottom, right or left of an element based on Live Guides (as explained in the following image), or drop the element at a precise place in the document structure by clicking </> and using Element Quick View.

  2. In the dialog box that appears, do one of the following:
    • Select File System to choose an image file.
    • Select Data Source to choose a dynamic image source.
    • Click the Sites And Servers button to choose an image file in a remote folder of one of your Dreamweaver sites.
  3. Browse to select the image or content source you want to insert.

    If you are working in an unsaved document, Dreamweaver generates a file:// reference to the image file. When you save the document anywhere in the site, Dreamweaver converts the reference to a document-relative path.

    Note:

    When inserting images it’s also possible to use an absolute path to an image that resides on a remote server (i.e., an image that is not available on the local hard drive). If you experience performance problems while working, however, you might want to disable viewing the image in Design view by deselecting Commands > Display External Files.

  4. Click OK. 

Set image properties

The Images Property inspector allows you to set properties for an image. If you do not see all of the image properties, click the expander arrow in the lower-right corner.

Images properties in the Property inspector.
  1. Click the image and select Window > Properties to view the Property inspector for a selected image.

  2. In the text box below the thumbnail image, enter a name so you can refer to the image when using a Dreamweaver behavior (such as Swap Image) or when using a scripting language such as JavaScript or VBScript.
  3. Set any of the image options.

    W and H

    The width and height of the image, in pixels. Dreamweaver automatically updates these text boxes with the image’s original dimensions when you insert an image in a page.

    If you set W and H values that do not correspond to the actual width and height of the image, the image may not display properly in a browser. (To restore the original values, click the W and H text box labels, or the Reset image size button that appears to the right of the W and H text boxes in entering a new value.)

    Note:

    You can change these values to scale the display size of this image instance, but this does not reduce download time, because the browser downloads all image data before scaling the image. To reduce download time and to ensure that all instances of an image appear at the same size, use an image-editing application to scale images.

    Src

    Specifies the source file for the image. Click the folder icon to browse to the source file, or type the path.

    Link

    Specifies a hyperlink for the image. Drag the Point-To-File icon to a file in the Files panel, click the folder icon to browse to a document on your site, or manually type the URL.

    Alt

    Specifies alternative text that appears in place of the image for text-only browsers or for browsers that have been set to download images manually. For visually impaired users who use speech synthesizers with text-only browsers, the text is spoken out loud. In some browsers, this text also appears when the pointer is over the image.

    Map Name and Hotspot tools

    Allow you to label and create a client-side image map.

    Target

    Specifies the frame or window in which the linked page should load. (This option is not available when the image isn’t linked to another file.) The names of all the frames in the current frameset appear in the Target list. You can also choose from the following reserved target names:

    • _blank loads the linked file into a new, unnamed browser window.

    • _parent loads the linked file into the parent frameset or window of the frame that contains the link. If the frame containing the link is not nested, the linked file loads into the full browser window.

    • _self loads the linked file into the same frame or window as the link. This target is the default, so you usually don’t need to specify it.

    • _top loads the linked file into the full browser window, thereby removing all frames.

    Edit

    Starts the image editor you specified in External Editors preferences and opens the selected image.

    Update from original

    When the web image (that is, the image on the Dreamweaver page) is out of sync with the original Photoshop file, Dreamweaver detects that the original file has been updated, and displays one of the Smart Object icon’s arrows in red. When you select the web image in Design view and click the Update from Original button in the Property inspector, the image updates automatically, reflecting any changes that you made to the original Photoshop file.

    Edit image settings

     Opens the Image Optimization dialog box and lets you optimize the image.

    Crop

     Trims the size of an image, removing unwanted areas from the selected image.

    Resample

     Resamples a resized image, improving its picture quality at its new size and shape.

    Brightness and Contrast

     Adjusts the brightness and contrast settings of an image.

    Sharpen

     Adjusts the sharpness of an image.

    Note:

    You can also edit image attributes in Live View using the Quick Property Inspector.

Edit image accessibility attributes in code

If you inserted accessibility attributes for an image, you can edit those values in the HTML code.

  1. In the Document window, click the image or select the image tag in code.

  2. Do one of the following to enter a name or a brief description for the image in less than 50 characters in to the Alternate Text box. The screen reader reads the information you enter here.  

    • Edit the appropriate image attributes in Code view.
    • Edit image attributes in Live View using the Quick Property Inspector.
    • Edit the Alt value in the Property inspector.


Visually resize an image

You can visually resize elements such as images, plug‑ins, Shockwave or SWF files, applets, and ActiveX controls in Dreamweaver.

Visually resizing an image helps you see how the image affects the layout at different dimensions but it does not scale the image file to the proportions that you specify. If you visually resize an image in Dreamweaver without using an image-editing application (such as Adobe Fireworks) to scale the image file to the desired size, the user’s browser scales the image when the page is loaded. This might cause a delay in page download time and the improper display of the image in the user’s browser. To reduce download time and to ensure that all instances of an image appear at the same size, use an image-editing application to scale images.

When you resize an image in Dreamweaver, you can resample it to accommodate its new dimensions. Resampling adds or subtracts pixels from a resized JPEG and GIF image files to match the appearance of the original image as closely as possible. Resampling an image reduces its file size and improves download performance.

Visually resize an element

  1. Select the element (for example, an image or SWF file) in the Document window.

    Resize handles appear at the bottom and right sides of the element and in the lower-right corner. If resize handles don’t appear, click somewhere other than the element you want to resize and then reselect it, or click the appropriate tag in the tag selector to select the element.

  2. Resize the element by doing one of the following:
    • To adjust the width of the element, drag the selection handle on the right side.
    • To adjust the height of the element, drag the bottom selection handle.
    • To adjust the width and the height of the element at the same time, drag the corner selection handle.
    • To preserve the element’s proportions (its width-to-height ratio) as you adjust its dimensions, Shift-drag the corner selection handle.
    • To adjust the width and height of an element to a specific size (for example, 1 x 1 pixel), use the Property inspector to enter a numeric value. Elements can be visually resized to a minimum of 8 x 8 pixels.
  3. To return a resized element to its original dimensions, in the Property inspector, delete the values in the W and H text boxes, or click the Reset Size button in the image Property inspector.

Revert an image to its original size

  • Click the Reset size button  in the image Property inspector.

Resample a resized image

  1. Resize the image as described above.
  2. Click the Resample button  in the image Property inspector.

    Note:

    You cannot resample image placeholders or elements other than bitmap images.

Insert an image placeholder

An image placeholder is a graphic you use until final artwork is ready to be added to a web page. You can set the placeholder’s size and color, as well as provide it with a text label.

  1. In the Document window, place the insertion point where you want to insert a placeholder graphic.
  2. Select Insert > Image Objects > Image Placeholder.

  3. For Name (Optional), enter text you want to appear as a label for the image placeholder. Leave the text box blank if you do not want a label to appear. The name must begin with a letter and can contain only letters and numbers; spaces and high ASCII characters are not allowed.
  4. For Width and Height (Required), type a number to set the image size in pixels.
  5. For Color (Optional), do one of the following to apply a color:
    • Use the color picker to select a color.
    • Enter the color’s hexadecimal value (for example, #FF0000).
    • Enter a web-safe color name (for example, red).
  6. For Alternate Text (Optional), enter text to describe the image for viewers using a text-only browser.

    Note:

    An image tag is automatically inserted into the HTML code containing an empty src attribute.

  7. Click OK.

    The placeholder’s color, size attributes, and label appear as follows:

    Image placeholder with attributes.

    When viewed in a browser, the label and size text do not appear.

Replace an image placeholder

An image placeholder does not display an image in a browser. Before you publish your site you should replace any image placeholders you’ve added with web-friendly image files, such as GIFs or JPEGs.

If you have Fireworks, you can create a new graphic from the Dreamweaver image placeholder. The new image is set to the same size as the placeholder image. You can edit the image, then replace it in Dreamweaver.

  1. In the Document window, do one of the following:
    • Double-click the image placeholder.
    • Click the image placeholder to select it; then in the Property inspector (Window > Properties), click the folder icon next to the Src text box.
  2. In the Image Source dialog box, navigate to the image you want to replace the image placeholder with and click OK.

Set image placeholder properties

To set properties for an image placeholder, select the placeholder in the Document window; then select Window > Properties to display the Property inspector. To see all properties, click the expander arrow in the lower-right corner.

Use the Property inspector to set a name, width, height, image source, alternate text description, alignment and color for a placeholder image.

Image Placeholder Property inspector.

In the placeholder Property inspector, the gray text box and the Align text box are disabled. You can set these properties in the image Property inspector when you replace the placeholder with an image.

  • Set any of the following options:

    W and H

    Set the width and height of the image placeholder, in pixels.

    Src

    Specifies the source file for the image. For a placeholder image, this text box is empty. Click the Browse button to select a replacement image for the placeholder graphic.

    Link

    Specifies a hyperlink for the image placeholder. Drag the Point-to-File icon to a file in the Files panel, click the folder icon to browse to a document on your site, or manually type the URL.

    Alt

    Specifies alternative text that appears in place of the image for text-only browsers or for browsers that have been set to download images manually. For visually impaired users who use speech synthesizers with text-only browsers, the text is spoken out loud. In some browsers, this text also appears when the pointer is over the image.

    Create

    Starts Fireworks to create a replacement image. The Create button is disabled unless Fireworks is also installed on your computer.

    Update from original

    When the web image (that is, the image on the Dreamweaver page) is out of sync with the original Photoshop file, Dreamweaver detects that the original file has been updated, and displays one of the Smart Object icon’s arrows in red. When you select the web image in Design view and click the Update from Original button in the Property inspector, the image updates automatically, reflecting any changes that you made to the original Photoshop file.

    Color

    Specifies a color for the image placeholder.

Edit images in Dreamweaver

You can resample, crop, optimize, and sharpen images in Dreamweaver. You can also adjust their brightness and contrast.

Image-editing features

Dreamweaver provides basic image-editing features that let you modify images without having to use an external image-editing application such as Fireworks or Photoshop. The Dreamweaver image-editing tools are designed to let you easily work with content designers responsible for creating image files for use on your website.

Note:

You do not need to have Fireworks or other image-editing applications installed on your computer to use the Dreamweaver image-editing features.

  • Select Modify > Image. Set any of these Dreamweaver image-editing features:

    Resample

    Adds or subtracts pixels from a resized JPEG and GIF image files to match the appearance of the original image as closely as possible. Resampling an image reduces its file size and improves download performance.

    When you resize an image in Dreamweaver, you can resample it to accommodate its new dimensions. When a bitmap object is resampled, pixels are added to or removed from the image to make it larger or smaller. Resampling an image to a higher resolution typically causes little loss of quality. Resampling to a lower resolution, however, always causes data loss and usually a drop in quality.

    Crop

    Edit images by reducing the area of the image. Typically, you’ll want to crop an image to place more emphasis on the subject of the image, and remove unwanted aspects surrounding the center of interest in the image.

    Brightness and Contrast

    Modifies the contrast or brightness of pixels in an image. This affects the highlights, shadows, and midtones of an image. You typically use Brightness/Contrast when correcting images that are too dark or too light.

    Sharpen

    Adjusts the focus of an image by increasing the contrast of edges found within the image. When you scan an image, or take a digital photo, the default action of most image capturing software is to soften the edges of objects in the image. This prevents extremely fine details from becoming lost in the pixels from which digital images are composed. However, to bring out the details in digital image files, it is often necessary to sharpen the image, thereby increasing edge contrast, and making the image appear sharper.

    Note:

    Dreamweaver image-editing features apply only to JPEG, GIF, and PNG image file formats. Other bitmap image file formats cannot be edited using these image-editing features.

Crop an image

Dreamweaver lets you crop (or trim) bitmap file images.

Note:

When you crop an image, the source image file is changed on disk. For this reason, you may want to keep a backup copy of the image file in the event you need to revert to the original image.

  1. Open the page containing the image you want to crop, select the image, and do either of the following:
    • Click the Crop Tool icon  in the image Property inspector.
    • Select Modify > Image > Crop.
    • Crop handles appear around the selected image.
  2. Adjust the crop handles until the bounding box surrounds the area of the image that you want to keep.
  3. Double-click inside the bounding box or press Enter to crop the selection.
  4. A dialog box informs you that the image file you are cropping will be changed on disk. Click OK. Every pixel in the selected bitmap outside the bounding box is removed, but other objects in the image remain.
  5. Preview the image and ensure that it meets your expectations. If not, select Edit > Undo Crop to revert to the original image.

    Note:

    You can undo the effect of the Crop command (and revert to the original image file) up until the time that you quit Dreamweaver, or edit the file in an external image-editing application.

Optimize an image

You can optimize images in your web pages from within Dreamweaver.

  1. Open the page containing the image you want to optimize, select the image, and do either of the following:
    • Click the Edit Image Settings button  in the image Property inspector.
    • Select Modify > Image > Optimize.
  2. Make your edits in the Image Optimization dialog box and click OK.

Sharpen an image

Sharpening increases the contrast of pixels around the edges of objects to increase the image’s definition or sharpness.

  1. Open the page containing the image you want to sharpen, select the image, and do either of the following:
    • Click the Sharpen button  in the image Property inspector.
    • Select Modify > Image > Sharpen.
  2. You can specify the degree of sharpening Dreamweaver applies to the image by dragging the slider control, or entering a value between 0 and 10 in the text box. As you adjust the sharpness of the image using the Sharpness dialog box, you can preview the change to the image.
  3. Click OK when you are satisfied with the image.
  4. Save your changes by selecting File > Save, or revert to the original image by selecting Edit > Undo Sharpen.

    Note:

    You can only undo the effect of the Sharpen command (and revert to the original image file) prior to saving the page containing the image. After you save the page, the changes made to the image are permanently saved.

Adjust the brightness and contrast of an image

Brightness/Contrast modifies the contrast or brightness of pixels in an image. This affects the highlights, shadows, and midtones of an image. You typically use Brightness/Contrast when correcting images that are too dark or too light.

  1. Open the page containing the image you want to adjust, select the image, and do either of the following:
    • Click the Brightness/Contrast  button in the image Property inspector.
    • Select Modify > Image > Brightness/Contrast.
  2. Drag the Brightness and Contrast sliders to adjust the settings. Values range from ‑100 to 100.
  3. Click OK.

Create a rollover image

You can insert rollover images in your page. A rollover is an image that, when viewed in a browser, changes when the pointer moves across it.

You must have two images to create the rollover: a primary image (the image displayed when the page first loads) and a secondary image (the image that appears when the pointer moves over the primary image). Both images in a rollover should be the same size; if the images are not the same size, Dreamweaver resizes the second image to match the properties of the first image.

Rollover images are automatically set to respond to the onMouseOver event. You can set an image to respond to a different event (for example, a mouse click) or change a rollover image.

  1. In the Document window, place the insertion point where you want the rollover to appear.
  2. Insert the rollover using one of these methods:
    • In the Common category of the Insert panel, click the Images button and select the Rollover Image icon. With the Rollover Image icon displayed in the Insert panel, you can drag the icon to the Document window.
    • Select Insert > Image Objects > Rollover Image.
  3. Set the options and click OK.

    Image Name

    The name of the rollover image.

    Original image

    The image you want to display when the page loads. Enter the path in the text box, or click Browse and select the image.

    Rollover Image

    The image you want to display when the pointer rolls over the original image. Enter the path or click Browse to select the image.

    Preload Rollover Image

    Preloads the images in the browser’s cache so no delay occurs when the user rolls the pointer over the image.

    Alternate Text

    (Optional) Text to describe the image for viewers using a text-only browser.

    When clicked, Go to URL

    The file that you want to open when a user clicks the rollover image. Enter the path or click Browse and select the file.

    Note:

    If you don’t set a link for the image, Dreamweaver inserts a null link (#) in the HTML source code to which the rollover behavior is attached. If you remove the null link, the rollover image will no longer work.

  4. Select File > Preview in Browser or press F12.

  5. In the browser, move the pointer over the original image to see the rollover image.

    Note:

    You cannot see the effect of a rollover image in Design view.

Use an external image editor

While in Dreamweaver, you can open a selected image in an external image editor; when you return to Dreamweaver after saving the edited image file, any changes you made to the image are visible in the Document window.

You can set up Fireworks as your primary external editor. You can also set which file types an editor opens; and you can select multiple image editors. For example, you can set preferences to start Fireworks when you want to edit a GIF, and to start a different image editor when you want to edit a JPG or JPEG.

Start the external image editor

  • Do one of the following:
    • Double-click the image you want to edit.
    • Right-click (Windows) or Control‑click (Macintosh) the image you want to edit, then select Edit With > Browse and select an editor.
    • Select the image you want to edit, and click Edit in the Property inspector.
    • Double-click the image file in the Files panel to start the primary image editor. If you haven’t specified an image editor, Dreamweaver starts the default editor for the file type.

    Note:

    When you open an image from the Files panel, the Fireworks integration features are not in effect; Fireworks does not open the original PNG file. To use the Fireworks integration features, open images from within the Document window.

    If you don’t see an updated image after returning to the Dreamweaver window, select the image and then click the Refresh button in the Property inspector.

Set an external image editor for an existing file type

You can select an image editor for opening and editing graphic files.

  1. Open the File Types/Editors Preferences dialog box by doing one of the following:
    • Select Edit > Preferences (Windows) or Dreamweaver > Preferences (Macintosh), and select File Types/Editors in the Category list on the left.
    • Select Edit > Edit with External Editor and select File Types/Editors.
  2. In the Extensions list, select the file extension you want to set an external editor for.
  3. Click the Add (+) button above the Editors list.
  4. In the Select External Editor dialog box, browse to the application you want to start as an editor for this file type.

  5. In the Preferences dialog box, click Make Primary if you want this editor to be the primary editor for this file type.

  6. If you want to set up an additional editor for this file type, repeat steps 3 and 4.

    Dreamweaver automatically uses the primary editor when you edit this image type. You can select the other listed editors from the context menu for the image in the Document window.

Add a new file type to the Extensions list

  1. Open the File Types/Editors Preferences dialog box by doing one of the following:

    • Select Edit > Preferences (Windows) or Dreamweaver > Preferences (Macintosh), and select File Types/Editors in the Category list on the left.
    • Select Edit > Edit with External Editor and select File Types/Editors.
  2. In the File Types/Editors Preferences dialog box, click the Add (+) button above the Extensions list.

    A text box appears in the Extensions list.

  3. Type the file extension of the file type you want to start an editor for.
  4. To select an external editor for the file type, click the Add (+) button above the Editors list.
  5. In the dialog box that appears, select the application you want to use to edit this image type.
  6. Click Make Primary if you want this editor to be the primary editor for the image type.

Change an existing editor preference

  1. Open the File Types/Editors Preferences dialog box by doing one of the following:

    • Select Edit > Preferences (Windows) or Dreamweaver > Preferences (Macintosh), and select File Types/Editors in the Category list on the left.
    • Select Edit > Edit with External Editor and select File Types/Editors.
  2. In the File Types/Editors preferences dialog box, in the Extensions list select the file type you are changing to view the existing editor(s).

  3. In the Editors list, select the editor you want to want to affect, then do one of the following:
    • Click the Add (+) or Delete (–) buttons above the Editors list to add or remove an editor.
    • Click the Make Primary button, to change which editor starts by default for editing.

Apply behaviors to images

You can apply any available behavior to an image or image hotspot. When you apply a behavior to a hotspot, Dreamweaver inserts the HTML source code into the area tag. Three behaviors apply specifically to images: Preload Images, Swap Image, and Swap Image Restore.

Preload Images

Loads images that do not appear on the page right away (such as those that will be swapped in with behaviors, AP elements, or JavaScript) into the browser cache. This prevents delays caused by downloading when it is time for the images to appear.

Swap Image

Swaps one image for another by changing the SRC attribute of the img tag. Use this action to create button rollovers and other image effects (including swapping more than one image at a time).

Swap Image Restore

Restores the last set of swapped images to their previous source files. This action is automatically added whenever you attach the Swap Image action to an object by default; you should never need to select it manually.

You can also use behaviors to create more sophisticated navigation systems, such as jump menus.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy