Astro Contrast Enhancer - A Deep Dive

ACE Learning Center • Development Deep Dive

The image-science story behind Texture, Clarity, Dehaze, and protected local editing.

Astro Contrast Enhancer began as a way to keep a familiar late-stage finishing pass inside PixInsight. The final script looks simple from the outside, but the path to those three controls ran through underpowered Texture, Clarity plateaus, a failed scale model, and a much better question: where is enhancement justified?

PixInsight 1.9.4 Texture Clarity Dehaze Loupe A/B Local Pass Viewer

Why ACE Exists

PixInsight has excellent contrast tools. ACE is meant to feel different.

After doing the serious work in PixInsight, I often found myself leaving the application for one final pass in Photoshop: a little Texture, a little Clarity, a little Dehaze, sometimes applied locally and judged by eye.

PixInsight already contains many wonderful tools for managing contrast, structure, masks, and multiscale detail. ACE is not saying those tools are lacking. It is offering a different kind of finishing environment: direct, visual, interactive, and built around the specific feel of Texture, Clarity, and Dehaze.

Other tools may use similar names, but ACE's algorithms and workflow are unique to this script. The goal is to give PixInsight users a new late-stage contrast language, not just another path to the same result.

The Workspace

ACE was built around live judgment, not blind processing.

The interface brings the preview, three core controls, protection switches, comparison tools, local editing, and full-resolution apply into one focused PixInsight workspace.

Astro Contrast Enhancer interface screenshot in PixInsight
The ACE interface combines real-time preview, Texture, Clarity, Dehaze, local editing, protection controls, before/after comparison, loupe inspection, and full-resolution application.

The First Assumption

One model, three scales.

The early version of ACE started from a clean idea: separate the image into three broad scale ranges and let each control operate on one of them. Texture would work on the smallest structures. Clarity would work on mid-scale contrast. Dehaze would work on large-scale veil and broad separation.

Spatial Scale Separation

232px
Texture
3
Clarity
12
Dehaze
120

This was the first mental model: three sliders, three characteristic radii, three kinds of contrast work. It was useful as a starting point because it made Texture, Clarity, and Dehaze easy to reason about. But it also hid the real problem.

The model was clean. The images were not.

Astronomical images are not organized into tidy scale compartments. A star core, small galaxy, nebular ridge, diffraction pattern, dust lane, color transition, noise cluster, and compression artifact can all occupy overlapping spatial frequencies. If a tool only knows the size of a structure, it does not really know what that structure is.

What Failed

Scale alone was not enough.

The early model could produce interesting before-and-after comparisons, but the weaknesses became obvious during close inspection and repeated use.

It treated scale as meaning.

Fine-scale variation can be real dust texture, but it can also be noise. Mid-scale contrast can be a true nebular fold, but it can also become an unnatural flat shelf. Broad glow can be haze, but it can also be real signal.

Texture was underpowered.

The early Texture model was not just too cautious around noise; it also failed to deliver enough visible fine-scale improvement where the signal could support it. It needed more real effect without becoming ordinary sharpening.

Clarity created tonal plateaus instead of openness.

The main Clarity failure was not halos. The bigger problem was that some regions became saturated with detail, forming unnatural plateaus: areas with a processed, flattened intensity that did not feel visually open or dimensional.

Dehaze could confuse veil with real signal.

In astrophotography, broad low-contrast brightness may be the subject. A Dehaze tool that simply subtracts large-scale brightness can make an image look cleaner while erasing the glow that gives it depth.

The Pivot

Texture, Clarity, and Dehaze became three different image problems.

The breakthrough was not a more aggressive algorithm. It was a better division of responsibility. The three controls stopped being treated as three radii of one operation and became three separate visual questions.

Texture

Where can fine structure become visibly stronger without turning noise into invented detail?

Clarity

Where can mid-scale separation open the image, add depth, and avoid unnatural plateaus?

Dehaze

Where is broad veil suppressing depth, and where is broad glow actually part of the subject?

Examples

The difference should be visible, not merely described.

The most useful way to understand Texture, Clarity, and Dehaze is to compare the same image before and after each treatment. Each pair below is meant to highlight the visual character of one ACE adjustment: fine structure, tonal depth, broad veil reduction, or the combined effect.

The examples should not be read as recipes. Settings that work well for one target may be inappropriate for another. They are included to show what each control is trying to accomplish and to provide a starting point for your own experimentation.

Before ACE Texture exampleBefore
After ACE Texture exampleAfter

Texture

Look for fine structure becoming more visible without turning the background into brittle speckle.

Before ACE Clarity exampleBefore
After ACE Clarity exampleAfter

Clarity

Look for the image opening up: better separation among arms, dust, cores, and surrounding structure without harsh tonal plateaus.

Before ACE Dehaze exampleBefore
After ACE Dehaze exampleAfter

Dehaze

Look for reduced veiling, clearer broad-scale separation, and stronger apparent color without hollowing the background.

Before combined ACE exampleBefore
After combined ACE exampleAfter

Combined ACE

Look for balanced improvement in fine structure, depth, and broad openness rather than one uniformly stronger effect.

Fine Structure

Texture had to become stronger without becoming sharpening.

Texture is aimed at small-scale surface structure: filaments, dust boundaries, folds, and delicate detail. The early version was underpowered, but simply pushing it harder would have turned it into ordinary sharpening or noise amplification.

The final Texture approach is meant to make real fine structure visibly stronger while remaining skeptical of smooth sky, weak background variation, and fragile stellar detail.

Texture also exposed a practical preview problem: at fit-to-window, 100%, and sometimes even 200%, the fine-scale effect can be difficult to judge. That is why ACE added the loupe and A/B comparison inside the loupe.

ACE detail loupe shown over the preview for fine-scale A/B inspection
The loupe is summoned with Shift and is especially useful for Texture, where the effect may be too fine to judge at fit-to-window, 100%, or even 200%.

Perceived Depth

Clarity should open the image, creating a greater sense of depth and space.

Clarity is aimed at the scale where many astronomical subjects begin to feel dimensional. It helps separate nebular folds, galaxy arms, dust structures, and larger internal transitions.

The critical Clarity problem was visual openness. Early versions could saturate regions with detail until they formed unnatural plateaus: areas that were locally busy but no longer felt layered, spacious, or dimensional.

The final Clarity behavior is meant to create depth and separation while preserving smooth transitions. Halos are always worth watching for in contrast work, but plateaus and lack of openness were the real development problem ACE had to solve.

Broad Veiling

Dehaze should clear the view without stealing real glow.

Dehaze is aimed at broad veiling: the impression that a translucent layer sits over the image and reduces depth, contrast, and color presence.

ACE Dehaze has to be careful because broad glow is not automatically a defect. In astrophotography, broad low-contrast signal may be the subject.

The goal is not to make the background darker for its own sake. The goal is to improve separation and depth without damaging faint extended signal.

Protection Systems

Protection is central, but it is still under user control.

ACE's protection systems were not just added to make the tools safer. They became part of what the tools are. Each control needs to know where not to work as much as where to work.

Star Protection

Keeps stellar profiles from being overworked while surrounding nebula, dust, or galaxy structure receives the intended treatment.

Background Protection

Helps keep quiet regions quiet instead of treating every weak variation as detail to enhance.

Highlight Restraint

Reduces crunchy cores, clipped-looking transitions, and posterized bright structure.

The protections can be disabled. If you intentionally want to sharpen stars with Texture, ACE will let you do it. Just tread carefully.

Design Philosophy

Why the controls are allowed to go too far.

ACE includes safeguards intended to reduce common contrast artifacts, but it deliberately does not confine Texture, Clarity, or Dehaze to a narrow range of approved settings. That is intentional.

Simple versions of these tools can produce attractive results at moderate settings, then break down quickly when pushed. Highlights can clip, shadows can collapse, color can become exaggerated, and detailed regions can begin to look processed instead of open. ACE is designed to resist those failure modes, but resistance is not the same as a hard limit.

1

Too Little

The effect is present, but the visual improvement remains uncertain or incomplete.

2

Too Much

Push far enough that the image clearly reveals where the treatment begins to break down.

3

Back to Balance

Return toward the point where the improvement remains useful without calling attention to the processing.

Protected Local Editing

Apply the effect where the image needs it, then revise individual passes.

Local editing is one of the most important parts of ACE because it matches how astronomical images actually behave. Not every region needs the same treatment.

ACE lasso selection with protected grid
The lasso identifies the editable region while the protected-grid overlay shows what will remain outside the local treatment.
ACE local selection with feathering visible
Feathering blends the local adjustment into the surrounding image rather than creating a hard-edged edit.

A dusty nebula edge may benefit from Texture. A galaxy core may need less. A faint outer region may benefit from careful Dehaze. A star-rich background may need protection more than enhancement.

ACE also supports multiple local passes. The pass viewer lets you inspect what has been applied, selectively remove one pass, and try a different approach without discarding the rest of the work.

Target Texture

Use a local pass on dusty structure without roughening the whole background.

Revise Clarity

Remove a pass that feels too strong and try another approach without discarding the rest.

Layer Dehaze

Clear a washed region selectively while preserving broad signal elsewhere.

Preview, Loupe, and A/B

ACE depends on comparison.

The goal was near real-time response, because these are visual finishing decisions. Moving a slider, checking the result, toggling before/after, and returning to a more restrained setting is the heart of the workflow.

That took weeks of optimization. Texture, Clarity, and Dehaze are compute-intensive algorithms running inside PixInsight's JavaScript environment. Sometimes there is still a pause before the preview updates, but the aim is to keep waits reasonable enough that visual exploration remains practical.

A/B comparison is central: buttons, command keys, full-preview comparison, and loupe comparison all exist because ACE is meant to be judged visually, repeatedly, and at the right scale. Use the Before/After button or Command-C for the full preview; hold Shift to bring up the loupe, then use Before/After or Command-C again to inspect the magnified region.

Practical Workflow

A conservative way to use ACE.

Start with Dehaze only if the image has broad veil.The goal is to restore separation and depth, not to make the background aggressively dark.
Add Clarity where the image needs to open up.Watch for dimensionality and separation, and avoid saturated detail plateaus.
Use Texture at the right inspection scale.Use the loupe and A/B comparison when the full preview is too small to show the fine-scale effect clearly.
Use local editing when the whole image does not need the same treatment.Apply the effect where it belongs, then use the pass viewer if a specific pass needs revision.
Compare before and after often.Use the buttons and command keys. Stop when the image is clearer, not when the effect is maximized.

What the Failed Model Taught

ACE became better because the first model failed.

The failed three-scale model was not wasted work. It taught the most important lesson in ACE development: scale alone is not enough.

A tool can know that a structure is small, medium, or broad and still not know whether that structure should be enhanced. ACE became useful when it shifted from scale-based enhancement toward conditional enhancement, real visual openness, and repeated A/B inspection.