Raster graphics are made up of bitmaps composed of pixels that each store color information, while vector graphics are made up of vectors defined by start and end points. Common raster formats include JPEG for photographs, TIFF for desktop publishing, and GIF for animations, while vector formats include AI for logos, PSD for image manipulation, and FLA for animations. Images can be optimized for web by reducing size, bit depth, resolution, and compressing.