RU

Introduction. The Secret Gradient Interpolation Method

Also available in Russian

Introduction

This article opens the series “Photoshop Algorithms Arcana”, aimed at uncovering the algorithms Photoshop uses to render gradients, effects, adjustment layers, and more.

Why? I’m building a tool that can render individual PSD/PSB layers and groups — with all effects intact — without requiring Photoshop. It turns out that information about Photoshop’s proprietary algorithms is incredibly scarce, and most existing approximations produce results that differ dramatically from what Photoshop actually renders.

I also hope that my findings will help improve open-source tools like Krita, GIMP, Photopea, and others, giving them a fresh perspective on the effects pipeline and enabling better support for Photoshop’s rendering behavior, especially when it comes to effects and gradients.

Disclaimer

All algorithms presented in this article are the result of black-box reverse engineering. This means every algorithm was reconstructed by attempting to reproduce images identical to those produced by Photoshop. I did not decompile Photoshop or any other tool — all I had were finished images that I rendered in Photoshop and then tried to replicate independently.

The algorithms described here may differ from what Adobe actually uses. They represent the closest approximation I could achieve — close enough that an average person would struggle to tell which result came from Photoshop and which from my algorithms.

With that out of the way, let’s move on to what started this investigation.

The Secret Interpolation Method

While working on parsing Photoshop’s format and algorithms, I stumbled upon something surprising — in the 2026 version, the default interpolation method is no longer Perceptual (which held that role since version 2022), but a certain Smooth.

Why “a certain”? Because it is described nowhere: not in the official documentation (which only mentions Perceptual, Classic, and Linear), not on forums, not in tutorials. The only way to learn about its existence is through a dropdown menu item. Yet it differs significantly from all other interpolation algorithms, though it’s closest to Perceptual.

Smooth lacks the Smoothness parameter, so one might assume it’s simply a special case of Perceptual with Smoothness set to 100%, 75%, or 50%.

But it turns out — no, it’s a distinct interpolation type. If you compare two gradients with identical color stops, one using Perceptual and the other using Smooth, no Smoothness value reproduces the Smooth result.

If you look close, you can see that Perceptual lets blue penetrate deeper into the midrange, while Smooth, true to its name, produces softer transitions.

To the human eye, they are nearly indistinguishable with uniform parameters and the midpoint in the center of the gradient. However, the closer the midpoint gets to the edges, the more noticeable the difference becomes.

Let’s look at some examples that make the difference obvious:

Red -> Blue, Midpoint: 5%
Smooth interpolation
Perceptual interpolation
Perceptual Smooth Difference between Perceptual and Smooth
Red -> Blue, Midpoint: 95%
Smooth interpolation
Perceptual interpolation
Perceptual Smooth Difference between Perceptual and Smooth
Red -> Green -> Blue, R -> G Midpoint: 15%, G -> B Midpoint: 85%
Smooth interpolation
Perceptual interpolation
Perceptual Smooth Difference between Perceptual and Smooth

What Diff Tells Us About the Algorithm

Enable Diff mode for the two-color gradients (Red → Blue) — the result is very revealing.

The starting color positions and the midpoint are identical (shown in black), but the intervals between them produce a noticeable difference.

And that difference takes an interesting shape: it peaks in intensity at the center of the start → midpoint and midpoint → end segments, then fades to zero at the boundaries. This suggests a smoothing per-segment S-curve.

However, switch Diff to the three-color gradient (Red → Green → Blue) — and the picture gets much more complex. The difference no longer fits a simple per-segment curve. Gradients with multiple color stops either use a different mechanism or an adapted one that needs to be investigated separately.

What’s Next

Understanding Smooth is the ultimate goal. But first, we need to understand Classic, Linear, and Perceptual — the three interpolation methods that will give us the foundation.

That’s exactly what we’ll tackle in the next articles: how Photoshop renders Classic, Linear, and Perceptual gradients.