Astro Contrast Enhancer!
Multi-scale contrast enhancement for stretched astrophotography images.
Explore fine structure, midtone depth, and broad tonal separation through interactive Texture, Clarity, Dehaze, protected local editing, and real-time visual feedback inside PixInsight.
The Story Behind ACE
Astro Contrast Enhancer began with a repeated interruption in my own image-processing workflow.
Like many PixInsight users, my image-processing workflow evolved over time. PixInsight remained at the heart of that workflow, but I often found myself making one final stop before declaring an image finished. More often than not, that stop was Photoshop.
It was not because PixInsight lacked excellent contrast tools—it certainly does not. Rather, I had become accustomed to Photoshop's Texture, Clarity, and Dehaze controls as an intuitive way to make the final refinements that gave an image a little more structure, depth, and visual presence.
After repeating that workflow for years, I began wondering what those capabilities might look like if they were designed specifically for astrophotography and integrated directly into PixInsight.
That question eventually became Astro Contrast Enhancer.
ACE is not intended to replace PixInsight's established processing tools. Instead, it complements them by providing an interactive environment for late-stage contrast refinement after an image has been stretched.
I originally wrote Astro Contrast Enhancer because it solved a problem in my own workflow. After using it extensively on my own images, I decided to share it freely in the hope that other astrophotographers may find it useful as well. Patrick Cosgrove
Why Do Some Images Feel Three-Dimensional?
The answer involves more than brightness. It depends on how our visual system interprets relationships within the image.
When we look at an astrophotography image, we are not simply seeing brightness and color. Our visual system is constantly interpreting subtle differences as texture, depth, transparency, and shape.
Those relationships help us recognize folds within a nebula, layered dust surrounding a galaxy, separation within a spiral arm, or delicate emission structures extending across a larger cloud.
They can create the impression that we are looking into space rather than simply looking at a flat photograph.
Much of the information needed to create that impression is already present in the image data. The challenge is making those structures easier to perceive without pushing the image toward harshness, artificiality, or an obviously overprocessed appearance.
That is where thoughtful contrast enhancement can make a meaningful difference.
Image Data
Texture
Fine changes help reveal surface structure, edges, filaments, and small-scale detail.
Depth
Mid-scale light and dark relationships help structures appear layered, rounded, and dimensional.
Transparency
Broad tonal separation helps reduce the impression of veil and improves large-scale visual openness.
Image may feel flatter
Image may feel more dimensional
Why Three Different Approaches to Contrast?
Texture, Clarity, and Dehaze may all make structure easier to see—but that does not mean they are doing the same thing at different strengths.
Like Astro Color Mixer, ACE was inspired by tools I had come to rely on in Adobe Camera Raw and Photoshop. My goal was not to reproduce those tools exactly. It was to capture the qualities I found useful while allowing my astrophotography workflow to remain inside PixInsight.
My first assumption seemed reasonable. I thought Texture, Clarity, and Dehaze were probably variations of a similar tone-and-contrast operation applied at three spatial scales: fine, medium, and broad. If that were true, three versions of the same basic mechanism should produce comparable results.
They did not. Changing the scale certainly changed the image, but the results never behaved like the tools that inspired the project. The controls felt like variations of the same adjustment rather than three distinct photographic tools.
That question changed the direction of ACE. Instead of continuing to refine one contrast mechanism, I began considering what was needed visually at each scale. That led to experimentation with very different ways of modeling and modifying the image.
Texture became focused on revealing fine structure without creating the hard, brittle appearance of aggressive sharpening. Clarity evolved into careful tone shaping intended to open the image and strengthen the perception of depth. Dehaze adopted a veiling model in which improved contrast and color emerge naturally as the apparent veil is reduced.
From One Scaled Mechanism to Three Image Models
Three Tools with Three Different Jobs
The names may be familiar, but each ACE control is built around a distinct visual objective.
Texture
Clarity
Dehaze
Why ACE Still Exposes Spatial Scale
Although the three algorithms solve different problems, each still operates within a useful range of spatial detail. ACE exposes those boundaries through its Spatial Scale Separation controls, allowing the response of each algorithm to be tuned for different images and personal processing preferences.
So what does each approach actually do to the image? We will begin with the finest of the three: Texture.
Texture: Revealing Fine Structure
Texture is designed for the smallest visible structures in the image—the filaments, edges, folds, and surface variations that help an object feel detailed rather than smooth.
Fine detail in an astrophotography image is often subtle. A filament may differ only slightly from the nebulosity around it. A dust lane may be visible, yet lack enough local separation to stand clearly against the surrounding structure.
The first instinct may be to apply sharpening. Sharpening can be effective, but it usually works by increasing contrast around edges. Pushed too far, it can create bright and dark outlines, brittle detail, emphasized noise, and unnatural-looking stars.
ACE Texture takes a different approach. Its purpose is to make fine structural variation easier to see while avoiding the hard-edged appearance that can result from aggressive sharpening.
Conceptually, Texture is the most straightforward of the three ACE approaches: identify fine structure, strengthen its local visibility, and preserve the larger tonal relationships around it. Achieving that cleanly is computationally demanding, but the visual goal is simple.
Fine variations are contained in the image, but remain difficult to separate visually from their surroundings.
The same underlying structures become easier to recognize without requiring the entire image to become more contrasty.
Traditional Sharpening
Common sharpening methods emphasize transitions around edges. This can increase apparent detail, but may also produce halos, hard boundaries, exaggerated noise, or an etched appearance when pushed too far.
ACE Texture
Texture is intended to strengthen fine structural variation while maintaining a more natural relationship between the enhanced detail and the surrounding image.
Bounding the Fine-Structure Range
Texture has a characteristic fine-scale operating range, but that range is not fixed. ACE exposes the Texture scale so it can be adjusted for differences in image resolution, object size, sampling, and personal preference. The default setting is a starting point—not a rule.
Clarity: Opening Tonal Depth
Clarity is not simply a medium-scale version of Texture. Its purpose is to reshape tonal relationships so an image can feel more open, layered, and dimensional.
An image can contain excellent detail and still lack a strong sense of depth. Spiral arms may be visible, dust lanes may be well resolved, and nebular folds may be present—but the tonal relationships between those structures may remain too compressed to create a convincing sense of layering.
It is tempting to describe Clarity as medium-scale local contrast. That description is not entirely wrong, but it misses the most important part of what the control is intended to accomplish.
ACE Clarity is better understood as careful tone shaping. It adjusts how local light and dark regions relate to one another so structures can feel more separated, rounded, and open without simply making every transition stronger.
The goal is not merely “more contrast.” The goal is for the image to feel deeper while preserving smooth tonal movement and avoiding the flat plateaus, hard transitions, and artificial-looking separation that simpler local-contrast methods can create.
Structure is visible, but adjacent tonal regions remain too similar to produce a strong impression of layering.
Local relationships become easier to distinguish, giving the same structures a greater sense of depth and form.
Simple Local Contrast
A direct local-contrast operation can strengthen nearby light and dark regions, but may also create flattened tonal zones, harsh boundaries, halos, or an obviously processed appearance when pushed too far.
ACE Clarity
Clarity is intended to shape tonal relationships more selectively, opening the image and increasing perceived dimensionality while preserving smoother and more natural transitions.
Bounding the Tone-Shaping Range
Clarity generally works across broader structures than Texture, but its operating range remains adjustable. The scale control allows the tone-shaping response to be matched to differences in image resolution, sampling, subject size, and the kinds of structures the photographer wants to open. The 12-pixel default is a practical starting point, not a prescribed setting.
Dehaze: Reducing the Veil
Dehaze begins with a different model of the problem: that a broad veiling component is weakening separation, color, and large-scale visibility across the image.
In some images, the main problem is not fine detail or local depth. Instead, the entire field can appear softened by a broad veil that reduces separation between large structures and weakens the apparent purity of color.
That veil does not have to represent literal atmospheric haze. In astrophotography it may reflect broad background light, diffuse glow, scattered light, low-frequency tonal compression, or simply the visual impression that structures are being viewed through a translucent layer.
ACE Dehaze approaches the image using a veiling model. Rather than independently increasing contrast and saturation, it attempts to reduce the apparent veil that is suppressing visibility.
As that veil is reduced, separation becomes stronger and color often appears more pronounced. Those changes are consequences of the model, not separate contrast and color adjustments applied afterward.
Large structures and colors remain present, but broad veiling weakens their separation and visual clarity.
Broad structure, separation, and color become easier to perceive as the obscuring component is reduced.
Contrast Plus Saturation
Increasing broad contrast and color separately may create a superficially similar result, but it can also produce clipped highlights, crushed shadows, exaggerated color, and uneven tonal behavior.
ACE Dehaze
Dehaze treats reduced contrast and weakened color as linked consequences of a veiling component. As the apparent veil is reduced, both separation and color can strengthen together through the same underlying operation.
Bounding the Broad Veiling Range
Dehaze normally acts over the broadest spatial range of the three ACE algorithms. Exposing that scale allows the veiling model to be tuned for subjects ranging from relatively compact galaxies to extended nebulae and large background gradients. The 120-pixel default provides a useful starting point while leaving the photographer free to adjust the range for the image at hand.
Local Editing: Refining Only What Needs It
Global adjustments establish the overall look of an image. Local editing makes it possible to refine one region without forcing the rest of the image to accept the same compromise.
Astrophotography images rarely respond uniformly. A galaxy core may already have enough contrast while the outer arms still need help. Fine nebular structure may benefit from additional Texture, while the surrounding background should remain quiet. A broad Dehaze adjustment may improve faint dust, yet make stars or bright regions feel too aggressive.
A single global setting therefore often requires compromise. The setting that is ideal for one region may be too strong—or simply unnecessary—somewhere else.
ACE addresses this with a direct local-editing workflow. A region can be outlined with the lasso, softened with feathering, moved or inverted, and then adjusted independently using the same Texture, Clarity, and Dehaze controls available globally.
The objective is not to turn image processing into a complex mask construction exercise. It is to make targeted refinement feel immediate enough that the photographer can evaluate the result while still looking at the image as a whole.
Start Globally
Establish the overall Texture, Clarity, and Dehaze balance for the image.
Select the Region
Draw a freeform lasso around the area that needs separate treatment.
Shape and Protect
Feather the boundary and use star or background protection where appropriate.
Refine in Context
Adjust the selected area while judging it against the entire image in real time.
Freeform Lasso
The lasso is intended for practical image regions rather than geometric shapes. It can follow galaxy arms, nebular folds, dust structures, or any other irregular area that needs its own adjustment.
Feather and Invert
Feathering softens the transition between the selected and unselected areas. Invert makes it possible to protect the enclosed region and apply the adjustment everywhere else.
Star Protection
Stars often react more strongly than extended structures. Star protection reduces the effect on stellar profiles so contrast enhancement can be directed more toward the object itself.
Background Protection
Background protection helps keep quiet sky regions from being unnecessarily darkened or made more prominent while faint object structure is enhanced.
Global First, Local Second
In my own workflow, I usually begin with the global controls and then use local editing only where the image asks for it. This keeps the overall treatment coherent while allowing specific regions to receive more—or less—attention. It is an approach that has worked well for me, but ACE does not require a fixed order.
Why the Controls Are Allowed to Go Too Far
ACE includes safeguards intended to reduce common contrast artifacts, but it deliberately does not confine the controls to a narrow range of “approved” settings.
Simple implementations of Texture, Clarity, and Dehaze can produce attractive results at moderate settings, yet quickly break down when pushed. Halos appear, highlights clip, shadows collapse, and color can become exaggerated.
ACE includes internal safeguards intended to reduce many of those problems. They help the algorithms behave more gracefully, particularly around stars, bright structures, dark backgrounds, and strong color transitions.
Safeguards, however, are not the same as limits. I did not want ACE to decide in advance how far a photographer should be allowed to experiment. The controls intentionally extend beyond the range I would normally use because that wider range supports the way I evaluate an adjustment.
My own method is to bracket the result: begin with too little, push until the effect is clearly too much, and then move back toward the point where the image feels right. Seeing both sides of the useful range often makes the preferred setting easier to recognize.
Halos
Bright and dark rings can form around edges or stars when local contrast is increased too aggressively.
Clipped Highlights
Bright structures can lose tonal variation when enhancement pushes them too close to white.
Crushed Shadows
Dark regions can collapse into featureless black, especially when broad contrast is increased without protection.
Exaggerated Color
Strong contrast operations can make color look overstated even when saturation was not adjusted directly.
The effect is present, but the visual improvement remains uncertain or incomplete.
Push far enough that the image clearly reveals where the treatment begins to break down.
Return toward the point where the improvement remains useful without calling attention to the processing.
This is simply the approach that works well for me. The wider control range is there to support experimentation—not to imply that stronger settings are better.
Safeguards Without Guardrails
ACE attempts to reduce common failure modes while still leaving the final judgment with the photographer. The useful setting will vary with the image, the selected region, the processing stage, and personal taste. The software provides protection and feedback; it does not declare one result correct.
What Does ACE Actually Change?
The most useful way to understand Texture, Clarity, and Dehaze is to compare the same image before and after each treatment.
The comparisons below are intended to make the character of each control easier to recognize. Texture should reveal fine structure. Clarity should open tonal depth. Dehaze should reduce broad veiling. The combined example shows how the three approaches can complement one another without becoming one undifferentiated contrast 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 I was trying to accomplish and to provide a starting point for your own experimentation.
Texture — Fine Structure
Placeholder for a close crop of a detailed nebula or galaxy.
What to Examine
Look for increased visibility in filaments, folds, dust boundaries, and other fine structures. The strongest result should be improved definition without obvious edge halos, brittle detail, or amplified background noise.
Example Settings
Final object name, settings, and interpretation will be added when the image pair is selected.
Clarity — Tonal Depth
Placeholder for a galaxy or dusty nebula with layered structure.
What to Examine
Look for stronger separation among broad tonal layers: spiral arms from dust lanes, illuminated nebular folds from darker structures, or a core from its surrounding envelope. The image should feel more open rather than merely harsher.
Example Settings
Final object name, settings, and interpretation will be added when the image pair is selected.
Dehaze — Broad Veiling
Placeholder for an extended nebula, dusty field, or broad galaxy structure.
What to Examine
Look for reduced broad veiling, clearer separation among large structures, and stronger apparent color. The comparison should show that contrast and color improve together rather than appearing as two unrelated adjustments.
Example Settings
Final object name, settings, and interpretation will be added when the image pair is selected.
Combined Treatment — Working Together
Placeholder for a full-image example using all three controls.
What to Examine
Look for a balanced change in fine structure, tonal depth, and broad openness. The important question is not whether the processed image is simply stronger, but whether each part of the image becomes easier to understand without the treatment calling attention to itself.
Example Settings
Final object name, settings, and interpretation will be added when the image pair is selected.
Pixinsight Script:
This PixInsight Script has just gone into Beta!
Would you like to try it out? I am looking for people who could use it and provide feedback and bug reports so that the tool can be fine-tuned.
New Version:
v0.9.7.11-Beta released 6-21-26!
This version introduced “Compact” mode, which operates with a smaller footprint and supports smaller screens.
Note:
Astro Contrast Enhancer v0.9.7.7-beta requires PixInsight 1.9.4 or newer.
This release has been updated for PixInsight’s new V8 JavaScript runtime, which is required by the native Apple Silicon / ARM64 build of PixInsight 1.9.4. It has also been tested on the Windows release of PixInsight 1.9.4.
If you are using an older version of PixInsight, please update PixInsight before installing or running Astro Color Mixer from the repository.
To Try it Out:
In PixInsight, go to Resources->update->manage repositories.
Add the repository: https://cosgrovescosmos.github.io/astro-color-mixer-pixinsight/updates/
Do an Update.
Exit PixInsight, and the installation will be done.
You may be asked to add an “UNSIGNED Repository”. That's because this is a beta, and I have not yet applied to PixInsight for a developer ID. Go ahead and say "yes" so the script loads.
Look for it under Scripts→CosgrovesCosmos→Astro Color Mixer.
Installation note:
After installing from the PixInsight repository and restarting PixInsight, Astro Color Mixer should appear in the Script menu.
Expected location: Script → Cosgrove’s Cosmos → Astro Contrast Enhancer
If the files install but the script does not appear in the Script menu, PixInsight may not have refreshed its feature-script index. This has been seen occasionally with third-party scripts.
To fix it:
If it does not appear, use:
Script > Feature Scripts > Add
Then select:
[PixInsight]/src/scripts/CosgrovesCosmos
After that, run:
Script > Feature Scripts > Regenerate
Click OK/Done.
If the script still does not appear, please send the following to contact@cosgrovescosmos.com:
- PixInsight version
- operating system
- whether the repository update reported success
- whether the script files appear to be installed
- whether Feature Scripts → Regenerate finds the script
- screenshot of the Feature Scripts window if possible