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.
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 information on extracting images from your PSD compositions, see Extract images from PSD files.
Place the insertion point where you want the image to appear in the Document window and do one of the following:
- In the HTML category of the Insert panel, click the Images icon. Double-click or drag the icon to the document window (or to the Code view window if you are working in code).
- 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.
- 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.
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.
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.
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.
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.)
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.
Specifies the source file for the image. Click the folder icon to browse to the source file, or type the path.
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.
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.
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.
new loads the linked file into a new 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.
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.
You can also edit image attributes in Live View using the Quick Property Inspector.
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.
Dreamweaver provides basic image-editing features that let you modify images without having to use an external image-editing application such as 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.
You can resample, crop, optimize, and sharpen images in Dreamweaver. You can also adjust their brightness and contrast.
You do not need to have Photoshop or other image-editing applications installed on your computer to use the Dreamweaver image-editing features.
Select a preset, specify a file format, and specify the level of quality. As you move the slider across the quality levels, you can see the file size of the image in the dialog box. Click OK once done.
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.
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.
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.
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.
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.
Preview the image and ensure that it meets your expectations. If not, select Edit > Undo Crop to revert to the original image.
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.
Sharpening increases the contrast of pixels around the edges of objects to increase the image’s definition or sharpness.
Save your changes by selecting File > Save, or revert to the original image by selecting Edit > Undo Sharpen.
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.
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.
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.
The image you want to display when the page loads. Enter the path in the text box, or click Browse and select the 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.
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.
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.
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.
- Right-click (Windows) or Control‑click (Macintosh) the image you want to edit, then select Edit With > Browse and select an editor.
- 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.
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.
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.