The Blur Gallery, Lens Correction, and the rest of the Filter menu - #68
Merged
Conversation
Fourteen filters, 115 to 129, and with them Photoshop's Filter menu has nothing left out. **Blur Gallery** (5): Field Blur, Iris Blur, Tilt-Shift, Path Blur, Spin Blur. All five are one blur applied through a mask each computes for itself, so they share a graded blur of three fixed levels rather than a per-pixel radius -- a true variable radius costs the largest radius everywhere, and these are lens effects, not measurements. In Photoshop their pins live on the canvas; a filter here is handed pixels and numbers, so a pin is a pair of position sliders. **Blur** (2): Shape Blur, whose kernel is a generated silhouette rather than a disc, which is what a shaped aperture does to an out-of-focus highlight; and Smart Blur, which averages only the neighbours within its threshold and therefore flattens skin and sky while leaving every edge exactly where it was. Its Edge Only and Overlay modes are the same computation read the other way round: what it *rejected* is the edge. **Video** (2): De-Interlace and NTSC Colors, both unchanged since Photoshop 2.5 and both four lines of arithmetic. **Render** (3): Flame, Picture Frame and Tree, which Adobe ships as scripts. Tree is the recursive branching rule under every species preset; Flame is a temperature field rising, narrowing and cooling; Picture Frame is five generated mouldings lit from the upper left. Photoshop's Flame follows a path it is given, and a filter never sees the document's paths, so this one rises from the bottom of the selection. **Lens Correction** and **Adaptive Wide Angle**, at the top of the menu where Photoshop keeps them. Lens Correction is barrel and pincushion, keystone, rotation, scale, vignette, and chromatic aberration -- which needs the red and blue channels resampled at slightly different magnifications, so it cannot go through the ordinary whole-pixel warp. Adaptive Wide Angle is a change of projection: map each pixel back to the angle it came from under equidistant, rectilinear or equisolid, then re-project it. Photoshop reads the lens from EXIF and looks it up in a profile database; there is no database here, so the sliders are the profile, and Lens Correction opens as a no-op rather than guessing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourteen filters — 115 → 129 — and with them Photoshop's Filter menu has nothing left out.
The interesting bits
One blur, five masks. The Blur Gallery filters are all the same operation — an ordinary blur applied through a mask each one computes for itself — so they share a graded blur of three fixed levels rather than a per-pixel radius. A true variable radius costs the largest radius everywhere and these are lens effects, not measurements; what matters is that the falloff is smooth and the sharp part is genuinely untouched. Three levels rather than one because blending a sharp copy against a single heavily blurred one leaves the middle of a falloff looking like a double exposure.
In Photoshop the pins live on the canvas. A filter here is handed pixels and numbers, so a pin is a pair of position sliders — which is how these filters worked everywhere before the canvas UI arrived.
Smart Blur's three modes are one computation. It averages only the neighbours inside its threshold, so an edge never averages across itself. How much of the neighbourhood it rejected is exactly how much of an edge the pixel is on — which is what Edge Only and Overlay Edge draw.
Chromatic aberration cannot use the ordinary warp. It is a difference in magnification between wavelengths, so undoing it means resampling red and blue about the centre at slightly different scales;
remap_channelsdoes that, and alpha follows green.Adaptive Wide Angle is a change of projection, not a polynomial: map each output pixel back to the angle it is asking about, find where an equidistant, rectilinear or equisolid lens actually put that angle, and sample there. Photoshop gets the field of view from a profile database; here it comes from focal length and crop factor, which is the same arithmetic every FOV calculator does.
Tree is the rule under all of Adobe's species presets — a trunk that splits, shorter and thinner each generation, with leaves clustered on whatever is left at the tips. Flame is a temperature field rising, narrowing, wandering and cooling from white through yellow to red; Photoshop's follows a path you drew, and since a filter never sees the document's paths, this one rises from the bottom of the selection.
Lens Correction opens as a no-op and is on the test's expected-no-op list for it: with no lens profile to prefill from, guessing would be worse than leaving it alone, which is what Photoshop does without a profile too. It also skips the resample entirely when every slider is at zero — running an image through the identity map is not free, it costs a premultiply round trip that flattens the colour under transparent pixels.
Checked
🤖 Generated with Claude Code