Topics Covered in This Photoshop Tutorial:
Comparing GIF & PNG formats, implementing transparency for modern web design
Exercise Preview

Exercise Overview
While photographs and complex imagery with thousands of colors perform best as JPEGs, graphics with limited color palettes—particularly logos, icons, and illustrations with areas of flat, solid color—achieve superior compression and crisp rendering when saved as GIF or PNG files. Understanding when and how to apply these formats will dramatically improve your web graphics' performance and visual quality.
Pre-Optimization Preparation
Verify Image Settings
Ensure your image is in RGB mode at 72 ppi for optimal web display and processing.
Trim Empty Pixels
Use Image > Trim to automatically remove empty pixels and reduce file size before optimization.
Access Save for Web
Navigate to File > Export > Save for Web (Legacy) to begin the optimization process.
Saving As GIF
From the Photoshop Class folder, open the file corporate-logo.psd.
Although this image is already in RGB mode at 72 ppi, we need to eliminate unnecessary transparent pixels to optimize file size. Rather than manually cropping with the Crop tool
, Photoshop offers an automated solution. Navigate to Image > Trim and configure the following settings:
Click OK, and Photoshop will automatically detect and remove all unnecessary transparent space with pixel-perfect precision.
Navigate to File > Export > Save for Web (Legacy) to access Photoshop's comprehensive web optimization interface.
In the export settings panel on the right, locate the format dropdown menu below Preset and select GIF.
The GIF format achieves compression by intelligently reducing the total color palette of an image. While GIFs support up to 256 colors, most graphics require significantly fewer colors to maintain visual fidelity, resulting in smaller file sizes and faster load times—crucial factors for modern web performance.
In the Colors field on the right panel, specify 16 colors. This aggressive color reduction typically provides excellent results for simple logos while maintaining crisp edges and solid color areas.
From the color reduction algorithm dropdown menu to the left of Colors, select the Perceptual palette option.
Adaptive, Selective, and Perceptual algorithms analyze your specific image content to determine the optimal color palette, making them superior to generic preset palettes. The Perceptual algorithm prioritizes colors that the human eye perceives as most important, often producing the best visual results at the smallest file sizes. In professional practice, test all three options and compare both visual quality and file size before making your final selection.
The Dither option employs scattered pixel patterns to simulate intermediate colors, creating smoother gradients in images with limited palettes. Since our logo contains primarily solid colors without complex gradients, locate the dropdown menu immediately below Perceptual and select No Dither to maintain clean, sharp edges.
From the Matte dropdown menu, select the background color of your target website (in this example, white works well for most modern web designs).
Understanding GIF transparency limitations is crucial for professional web graphics. Unlike modern PNG format, GIF supports only binary transparency—pixels are either completely transparent or completely opaque. Any partially transparent pixels from your original design must be converted to fully opaque pixels. The Matte color serves as the background blend color for these edge pixels, allowing anti-aliased edges to seamlessly integrate with your webpage background. Choosing an inappropriate matte color will create visible halos around your graphics.
Ensure the Transparency checkbox remains checked to preserve your logo's transparent background.
Select the Zoom tool
from the toolbar on the left side of the Save for Web dialog.Click on the preview image to examine the edge treatment closely. Notice how the previously translucent anti-aliased pixels around the logo edges have been seamlessly blended with your chosen Matte color, creating clean, opaque edge pixels that will integrate smoothly with your web design.
GIF Color Limitation
Color Palette Options
| Feature | Palette Type | Characteristics |
|---|---|---|
| Adaptive | Based on actual image colors | Analyzes source image |
| Selective | Based on actual image colors | Prioritizes common colors |
| Perceptual | Based on actual image colors | Optimized for human perception |
| Preset Palettes | Fixed color sets | Not recommended for most cases |
Comparing GIF to PNG-8
While GIF and PNG-8 employ similar indexed-color compression methods, PNG represents the more modern standard with several technical advantages. PNG files frequently achieve smaller file sizes than equivalent GIFs, though results vary by image content. Since both formats share identical optimization settings, we can perform a direct comparison to determine the optimal choice for this specific graphic.
Note the current GIF file size displayed in the preview area for comparison purposes.
In the export settings panel on the right, locate the format dropdown menu below the Preset section and change from GIF to PNG-8.
Observe the file size reduction in the PNG version. In professional practice, PNG-8 files with identical settings typically achieve 5–25% smaller file sizes compared to GIF equivalents. However, for certain content types—particularly simple text graphics—GIF occasionally produces smaller files. The professional approach involves testing both formats and selecting whichever delivers superior compression for your specific image content.
Click Save and export the file as yourname-logo.png to your Photoshop Class folder.
For comprehensive technical details about color palette optimization strategies and detailed comparisons of GIF, PNG, and JPEG formats—including modern WebP considerations for contemporary web development—consult the Web File Formats reference section at the back of this workbook.
PNG vs GIF Performance
GIF vs PNG-8 Feature Comparison
| Feature | GIF | PNG-8 |
|---|---|---|
| Compression Method | LZW compression | Deflate compression |
| Age/Support | Older format | Newer format |
| File Size | Larger (typically) | Smaller (5-25% reduction) |
| Text Graphics | Sometimes smaller | Usually larger |
| Color Palette | Up to 256 colors | Up to 256 colors |