Blend Modes - Photoshop Effects in CSS

What You'll Learn

  • Blend background layers with background-blend-mode
  • Blend elements with underlying content using mix-blend-mode
  • Master all 16 blend modes (multiply, screen, overlay, difference, etc.)
  • Create duotone images and color tints without image editing
  • Build always-visible text with difference mode
  • Mix colors realistically using multiply and screen
  • Add texture overlays with overlay and soft-light
  • Control blend scope with isolation: isolate
  • Choose the right blend mode for common design effects

Introduction to CSS Blend Modes

Blend modes control how layers mix their colors, enabling Photoshop-like effects directly in CSS. CSS provides two blend mode properties: background-blend-mode (blends background layers within an element) and mix-blend-mode (blends an element with content behind it).

These effects were previously only possible in image editing software. Now you can create duotone images, texture overlays, color mixing effects, and more—all with CSS, dynamically and without extra image files.

background-blend-mode - Blending Backgrounds

The background-blend-mode property controls how multiple background layers (gradients, images, colors) blend together within a single element.

/* Blend two gradients */ .element { background-image: linear-gradient(135deg, #667eea, #764ba2), linear-gradient(45deg, #f093fb, #f5576c); background-blend-mode: multiply; } /* Create duotone effect */ .duotone { background-image: linear-gradient(#667eea, #764ba2), /* Color overlay */ url('photo.jpg'); /* Original image */ background-blend-mode: multiply; } /* Texture overlay on gradient */ .textured { background-image: url('noise.png'), linear-gradient(135deg, #fa709a, #fee140); background-blend-mode: soft-light; } /* Multiple layers with different blend modes */ .complex { background-image: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent), radial-gradient(circle at 70% 70%, rgba(255,255,255,0.2), transparent), linear-gradient(135deg, #667eea, #764ba2); background-blend-mode: screen, screen; }

mix-blend-mode - Blending Elements

The mix-blend-mode property controls how an entire element blends with the content behind it (not just its own backgrounds). Perfect for overlays, text effects, and creative compositions.

/* Always-visible text (inverts background colors) */ .text { color: white; mix-blend-mode: difference; /* Text always contrasts with any background */ } /* Texture overlay on hero section */ .hero::before { content: ''; position: absolute; inset: 0; background: url('pattern.svg') repeat; mix-blend-mode: overlay; } /* Realistic color mixing */ .circle { mix-blend-mode: multiply; /* Like mixing paint */ } /* Luminous glow effect */ .glow { background: radial-gradient(circle, #fee140, transparent); mix-blend-mode: screen; /* Like projecting light */ }

All 16 Blend Modes Explained

CSS supports 16 blend modes, each creating different visual effects. They fall into five categories based on how they manipulate colors.

Darkening Modes

/* multiply - Darkens like mixing ink/paint */ background-blend-mode: multiply; /* White becomes transparent, black stays black */ /* Use for: Shadows, duotone effects, color mixing */ /* darken - Keeps darkest colors from each layer */ background-blend-mode: darken; /* Compares RGB values, keeps darkest */ /* color-burn - Darkens with increased contrast */ background-blend-mode: color-burn; /* Intense darkening, very contrasty */

Lightening Modes

/* screen - Lightens like projecting light */ background-blend-mode: screen; /* Black becomes transparent, white stays white */ /* Use for: Glow effects, light spots, brightening */ /* lighten - Keeps lightest colors from each layer */ background-blend-mode: lighten; /* Compares RGB values, keeps lightest */ /* color-dodge - Lightens with decreased contrast */ background-blend-mode: color-dodge; /* Intense brightening, washed out look */

Contrast Modes

/* overlay - Combines multiply and screen */ background-blend-mode: overlay; /* Multiplies dark pixels, screens light pixels */ /* Use for: Texture overlays, color tints */ /* soft-light - Gentle overlay effect */ background-blend-mode: soft-light; /* Subtle contrast changes */ /* Use for: Subtle textures, gentle adjustments */ /* hard-light - Intense overlay effect */ background-blend-mode: hard-light; /* Strong contrast changes */ /* Use for: Dramatic effects */

Comparative Modes

/* difference - Subtracts colors (inverts) */ background-blend-mode: difference; /* Identical colors become black */ /* Use for: Always-visible text, psychedelic effects */ /* exclusion - Softer difference effect */ background-blend-mode: exclusion; /* Similar to difference but less contrast */

Component Modes

/* hue - Transfers hue only */ background-blend-mode: hue; /* Keeps saturation and luminosity from bottom layer */ /* saturation - Transfers saturation only */ background-blend-mode: saturation; /* Keeps hue and luminosity from bottom layer */ /* color - Transfers hue and saturation */ background-blend-mode: color; /* Keeps luminosity from bottom layer */ /* Use for: Colorizing grayscale images */ /* luminosity - Transfers brightness only */ background-blend-mode: luminosity; /* Keeps hue and saturation from bottom layer */

Duotone Images - Spotify Style

Create trendy duotone effects by blending a gradient over an image. Popular on platforms like Spotify and Instagram.

/* Classic duotone */ .duotone { background-image: linear-gradient(#667eea, #764ba2), /* Color gradient */ url('photo.jpg'); /* Original photo */ background-size: cover; background-position: center; background-blend-mode: multiply; } /* Vibrant duotone with screen */ .duotone-bright { background-image: linear-gradient(#fee140, #fa709a), url('photo.jpg'); background-blend-mode: screen; } /* Colorful tint overlay */ .color-tint { background-image: linear-gradient(rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6)), url('photo.jpg'); background-blend-mode: overlay; } /* Grayscale to color */ .colorize { background-image: linear-gradient(to right, #667eea, #764ba2), url('grayscale-photo.jpg'); background-blend-mode: color; /* Adds color while preserving brightness */ }

Color Mixing - RGB Circles

Demonstrate realistic color mixing using blend modes. multiply simulates paint mixing (subtractive), while screen simulates light mixing (additive).

/* Subtractive color mixing (like paint) */ .circle-red, .circle-green, .circle-blue { mix-blend-mode: multiply; } /* On white background: RGB → CMY */ /* Red + Green = Yellow */ /* Red + Blue = Magenta */ /* Green + Blue = Cyan */ /* All three = Black */ /* Additive color mixing (like light) */ .light-red, .light-green, .light-blue { mix-blend-mode: screen; } /* On black background: RGB → RGB */ /* Red + Green = Yellow */ /* Red + Blue = Magenta */ /* Green + Blue = Cyan */ /* All three = White */

Texture Overlays - Subtle Depth

Add texture, noise, or patterns over backgrounds for visual depth without overwhelming the design.

/* Subtle noise texture */ .textured { position: relative; background: linear-gradient(135deg, #667eea, #764ba2); } .textured::before { content: ''; position: absolute; inset: 0; background: url('noise.png') repeat; mix-blend-mode: soft-light; opacity: 0.3; } /* Diagonal stripe pattern */ .striped::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient( 45deg, transparent, transparent 20px, rgba(255,255,255,0.1) 20px, rgba(255,255,255,0.1) 40px ); mix-blend-mode: overlay; } /* Dot pattern overlay */ .dotted::before { content: ''; position: absolute; inset: 0; background: url('dots.svg') repeat; background-size: 100px 100px; mix-blend-mode: overlay; }

Isolation - Controlling Blend Scope

The isolation property creates a new stacking context, preventing blend modes from affecting elements outside a container.

/* Without isolation */ .container { background: #667eea; } .overlay { mix-blend-mode: multiply; /* Blends with container AND everything behind it */ } /* With isolation */ .container { background: #667eea; isolation: isolate; /* Creates new stacking context */ } .overlay { mix-blend-mode: multiply; /* Only blends with elements inside container */ } /* Practical example */ .card { position: relative; background: white; isolation: isolate; /* Blend modes inside don't affect page background */ } .card-overlay { mix-blend-mode: multiply; /* Only affects card content, not page behind card */ }

background-blend-mode vs mix-blend-mode

Understanding when to use each property is crucial for achieving the desired effect.

/* background-blend-mode */ /* Blends background layers WITHIN the same element */ .element { background-image: url('texture.png'), url('photo.jpg'); background-blend-mode: overlay; /* Texture blends with photo, both are backgrounds */ } /* mix-blend-mode */ /* Blends ENTIRE ELEMENT with content behind it */ .overlay { background: url('texture.png'); mix-blend-mode: overlay; /* Element (including its background) blends with page behind */ } /* Practical comparison */ /* Use background-blend-mode for: */ .duotone { background-image: linear-gradient(...), url(...); background-blend-mode: multiply; /* Gradient and image are both backgrounds of same element */ } /* Use mix-blend-mode for: */ .text-overlay { color: white; mix-blend-mode: difference; /* Text element blends with background behind it */ } .pattern-overlay::before { content: ''; background: url('pattern.svg'); mix-blend-mode: overlay; /* Pseudo-element blends with parent's background */ }

Key Takeaways

  • background-blend-mode: Blends background layers within one element
  • mix-blend-mode: Blends entire element with content behind it
  • multiply: Darkens (paint mixing) - use for duotones, shadows, CMY color mixing
  • screen: Lightens (light mixing) - use for glows, highlights, RGB color mixing
  • overlay: Combines multiply/screen - use for texture overlays, color tints
  • soft-light: Gentle contrast - use for subtle textures and adjustments
  • difference: Inverts colors - use for always-visible text
  • color: Transfers hue/saturation - use for colorizing grayscale images
  • isolation: isolate: Limits blend mode scope to container
  • All 16 modes are GPU-accelerated and work in modern browsers without prefixes
  • Duotone images: blend gradient over photo with multiply
  • Texture overlays: use overlay or soft-light with reduced opacity
  • Always-visible text: use difference mode with white or black text