PixInsight Connector

v2.5.5
io.github.mxcoppell/pixinsight-connector Checked 3 hours ago Published 4 days ago

Operate PixInsight from any MCP agent.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

align_files

Register image files onto a reference image file with StarAlignment, file to file (no views are opened). Targets run in batches of at most batch_size (20 at most), one StarAlignment execution per batch. Registered files (<name><output_postfix>.xisf) go to output_dir, which must lie inside <workspace>/output (a relative path is resolved there) or the state folder. matrix_only: StarAlignment in OutputMatrix mode, reporting the registration per target without keeping any image file; its output directory is a temporary folder under <workspace>/agentic/scratch/align_files that is deleted afterwards…

ParameterTypeDescription
reference_file *stringAbsolute path of the reference image file
target_files *arrayAbsolute paths of the files to register
batch_sizeintegerTargets per StarAlignment execution, 1 to 20 (default 20)
distortion_correctionbooleanStarAlignment distortion correction; omitted, PixInsight's default
interpolationstringStarAlignment pixel interpolation; omitted, PixInsight's default
matrix_onlybooleanCompute the registration only; keep no image files (default false)
output_dirstringFolder for registered files: relative to <workspace>/output, or absolute inside <workspace>/output or the state folder. Not used with matrix_only
output_postfixstringSuffix of registered file names (default "_r")
overwritebooleanOverwrite existing registered files (default false)

verify_astrometry

Measure how well an open image's astrometric solution reproduces the sky, with the engine of PixInsight's AstrometricSolutionVerifier script (PixInsight 1.9.5 or later), run without its dialog: no deviation map, graphs, files or new windows, and the image is not modified. Every detected star is PSF-fitted, placed on the sky with the image's solution and compared with its Gaia DR3 star at the observation time. The result (JSON) gives the star counts (detected, PSF-fitted, matched, rejected by sigma clipping), the catalogue and its limit magnitude, the deviations (median, sigma, rms, 90th and 99…

ParameterTypeDescription
view_id *stringView ID to verify
auto_magnitudebooleanChoose the catalogue limit magnitude automatically (script default true)
grid_cellsintegerNumber of grid cells along the largest image dimension, 1 to 255 (script default 8)
magnitudenumberCatalogue limit magnitude used when auto_magnitude is false (script default 16)
matching_tolerancenumberMaximum distance in pixels between a detected star and its catalogue position for a match (script default 3)
rejection_sigmanumberSigma-clipping factor on the deviations; matched stars beyond median + factor x sigma are left out of the retained statistics and the grid, 0 disables (script default 5)

run_plate_solve

Plate solve an open image with ImageSolver against the local Gaia DR3/SP database (offline). Adds the astrometric solution needed by run_spfc, run_mgc and run_spcc. Needs an approximate position (ra_deg, dec_deg; within a fraction of the field is enough) and scale (pixel_scale in arcsec/px, or focal_length_mm + pixel_size_um) unless the image keywords already carry RA, DEC and FOCALLEN/XPIXSZ. If the seeded solve fails, it is retried with the scale seed multiplied by 0.5, 2, 1/3 and 3 in turn (scale_search false tries the seed only). The result gives the solved scale from the solution, the exp…

ParameterTypeDescription
view_id *stringView ID to plate solve
dec_degnumberApproximate center Dec in degrees
focal_length_mmnumberFocal length in mm (use with pixel_size_um instead of pixel_scale)
observation_jdnumberJulian date of the observation (only if no DATE-OBS/DATE keyword)
pixel_scalenumberApproximate pixel scale in arcsec/pixel
pixel_size_umnumberPixel size in microns
ra_degnumberApproximate center RA in degrees
recursive_splinesbooleanImageSolver's "Recursive surface splines" distortion option (ImageSolver 6.5.0, PixInsight 1.9.5): models distortion with all matched stars as local surface splines over a quadtree. Omitted, the optio…
scale_searchbooleanRetry with wider scale seeds when the seeded solve fails (default true)

copy_astrometric_solution

Copy the astrometric solution (WCS) and observation keywords from a source image file to a target view. Source and target must have the same dimensions; the target's pixels are unchanged.

ParameterTypeDescription
source_file *stringAbsolute path to the source image file that carries the WCS
target_id *stringTarget view ID to receive the WCS

catalog_stars

List catalogue stars over a plate-solved view from PixInsight's local Gaia database: one Gaia search centred on the image, with a radius reaching its corners (plus margin_fraction), down to mag_limit. Per star: image x, y, RA, Dec, G, BP-RP where the catalogue has them, whether it falls inside the frame, and for in-frame stars the peak luminance in a 5x5 box (with saturated = peak >= saturation_level when that is given). data_release omitted: releases are asked get-info in the order DR3/SP, DR3, EDR3, DR2 and the earliest of them that reports valid is searched; a failed search is reported, not…

ParameterTypeDescription
mag_limit *numberFaintest G magnitude listed
view_id *stringPlate-solved view
data_releasestringGaia data release to search; omitted, the earliest valid one in the order DR3/SP, DR3, EDR3, DR2
margin_fractionnumberExtra search radius as a fraction of the centre-to-corner radius (default 0.05)
merge_pxnumberDistance in pixels within which a Gaia star is replaced by a supplement star (default 3)
saturation_levelnumberPeak luminance at or above which an in-frame star is flagged saturated; omitted, no flag
supplementarrayStars to add: [{ra, dec, mag, name}] in degrees and catalogue-band magnitude

combine_channels

Combine 3 mono views into a single RGB color image using ChannelCombination. All 3 views must have identical dimensions. Returns the view ID of the combined image.

ParameterTypeDescription
b_view_id *stringBlue channel view ID
g_view_id *stringGreen channel view ID
output_id *stringDesired output view ID (the combined image is renamed to this)
r_view_id *stringRed channel view ID

align_to_reference

Align a target image to a reference image using StarAlignment. The target is replaced in place with the aligned version.

ParameterTypeDescription
reference_id *stringReference view ID (not modified)
target_id *stringTarget view ID (replaced with the aligned version)

run_per_channel_abe

Run AutomaticBackgroundExtractor (ABE) separately on the R, G and B channels of a color view, then recombine them into the view with ChannelCombination. ChannelExtraction writes the channels to the temporary views __pca_R, __pca_G and __pca_B; ABE subtracts its model from each in place and discards the model; the temporary views and any other view the call opened are closed afterwards. An ABE parameter that is not given is left at PixInsight's default, as run_abe does.

ParameterTypeDescription
view_id *stringRGB color view ID (modified in place)
poly_degreeintegerABE polynomial degree for every channel (AutomaticBackgroundExtractor polyDegree); omitted = PixInsight default
tolerancenumberABE sample rejection tolerance for every channel (AutomaticBackgroundExtractor tolerance); omitted = PixInsight default

lrgb_combine

Replace the lightness of an RGB view with a grayscale L view using LRGBCombination, in place on the RGB view. Only the L channel is enabled, so the RGB view keeps its own color channels. lightness and saturation are LRGBCombination's transfer-function midtones balances mL and mc (0.5 leaves that component unchanged). When linear_fit_reject_high is given, the call also runs LinearFit on the L view (modified in place, ahead of the combination) against a temporary luminance image 0.2126 R + 0.7152 G + 0.0722 B of the RGB view; when it is omitted, no LinearFit runs. Chrominance noise reduction and…

ParameterTypeDescription
l_id *stringGrayscale luminance view ID with the same dimensions as rgb_id
lightness *numberMidtones balance of the lightness transfer function (LRGBCombination mL), 0 to 1
rgb_id *stringRGB color view ID (modified in place)
saturation *numberMidtones balance of the saturation transfer function (LRGBCombination mc), 0 to 1
linear_fit_reject_highnumberLinearFit rejectHigh for the fit of L to the RGB luminance; omitted = no LinearFit

compare_images

Compare two open views of the same width, height and channel count, pixel by pixel, over the whole image or a rectangle. Per channel: maximum, mean and 99th-percentile absolute difference, and the fraction of samples outside [0, 1] in each view. "identical" is true when every absolute difference is 0. The 99th percentile is taken over at most 2,000,000 evenly spaced samples (p99Samples says how many); maximum and mean use every sample. Neither view is changed.

ParameterTypeDescription
reference_id *stringSecond view (B), compared against A
view_id *stringFirst view (A)
rectarrayOptional region [x0, y0, x1, y1] in pixels, x1/y1 exclusive

multi_scale_enhance

Masked three-scale LocalHistogramEqualization on a view, in one call, with an optional HDRMultiscaleTransform pass. The mask is the image lightness (CIE L* for colour, the image itself for mono) mapped as max((L - mask_clip_low) / (1 - mask_clip_low), 0), raised to the power 1/mask_gamma and blurred with a Gaussian of sigma mask_blur (0 = no blur). LHE then runs at the large, mid and fine radius in that order through the mask; the large and mid scales use lhe_slope_limit, the fine scale lhe_fine_slope_limit; other LHE parameters are PixInsight's defaults. Giving hdrmt_layers adds an HDRMultisc…

ParameterTypeDescription
lhe_fine_amount *numberFine-scale LHE amount, 0 to 1
lhe_fine_radius *numberFine-scale LHE kernel radius in pixels
lhe_fine_slope_limit *numberLHE contrast slope limit of the fine scale
lhe_large_amount *numberLarge-scale LHE amount, 0 to 1
lhe_large_radius *numberLarge-scale LHE kernel radius in pixels
lhe_mid_amount *numberMid-scale LHE amount, 0 to 1
lhe_mid_radius *numberMid-scale LHE kernel radius in pixels
lhe_slope_limit *numberLHE contrast slope limit of the large and mid scales
mask_blur *numberGaussian blur sigma of the mask in pixels (0 = no blur)
mask_clip_low *numberLightness mapped to 0 in the mask; values above it are rescaled to 0-1
mask_gamma *numberMask gamma: the rescaled mask is raised to the power 1/mask_gamma (1 = unchanged)
view_id *stringView ID to enhance (modified in place)
hdrmt_invertedbooleanHDRMT inverted iterations (needs hdrmt_layers; omitted = PixInsight default)
hdrmt_iterationsintegerHDRMT number of iterations (needs hdrmt_layers; omitted = PixInsight default)
hdrmt_layersintegerHDRMultiscaleTransform number of layers. Giving it runs the HDRMT pass; omitted, no HDRMT runs
hdrmt_median_transformbooleanHDRMT median transform instead of the wavelet transform (needs hdrmt_layers; omitted = PixInsight default)
hdrmt_to_lightnessbooleanHDRMT toLightness: on a colour image, apply the transform to the lightness only (needs hdrmt_layers; omitted = PixInsight default)

shell_detail_enhance

Protected high-pass detail enhancement at two scales, in place. For each scale, detail = image - Gaussian blur of sigma <scale>_sigma (locally zero-mean), and result = image + <scale>_amount x detail x protection, where protection = exp(-protect_softness x max(0, L - protect_knee) / max(1 - protect_knee, 0.01)) and L is Rec.709 luminance, so the boost attenuates above protect_knee. A scale with amount 0 is skipped. Output is truncated to [0, 1]. It does not hold the peak fixed: the added detail can raise the image maximum (the result reports the image maximum before and after, from full image…

ParameterTypeDescription
large_amount *numberLarge-scale detail multiplier (0 skips the scale)
large_sigma *numberGaussian sigma of the large-scale blur, in pixels
medium_amount *numberMedium-scale detail multiplier (0 skips the scale)
medium_sigma *numberGaussian sigma of the medium-scale blur, in pixels
protect_knee *numberLuminance above which the boost attenuates
protect_softness *numberAttenuation rate above protect_knee (>= 0; higher = steeper)
view_id *stringView to enhance (modified in place)
auto_zonebooleanWith no mask_id: build the adaptive shell zone mask and enhance through it. If it cannot be built the call fails and the view is not modified
mask_idstringMask view to enhance through (optional)

inspect_environment

Report what this PixInsight installation has, by asking PixInsight. gaia: Gaia get-info for DR2, EDR3, DR3 and DR3/SP (valid, database files, magnitude range, mean spectra) and a 0.1-degree search on the lowest valid release. mars: one MultiscaleGradientCorrection run per MARS file (from PixInsight settings, or mars_files) on a temporary synthetic plate-solved image; per file: readable, missing or corrupt, and how many MARS reference images cover the probe position. xterminators: BlurXTerminator, NoiseXTerminator and StarXTerminator run once each on a temporary 64x64 image; reports version, ML…

ParameterTypeDescription
dec_degnumberProbe position declination, degrees [-90, 90]. Given with ra_deg.
mars_filesarrayAbsolute .xmars paths to test instead of the configured ones
ra_degnumberProbe position right ascension, degrees [0, 360). Given with dec_deg.
sectionsarraySections to run (default: all)

run_pjsr

Run a PJSR (JavaScript, V8 engine) snippet inside PixInsight and return its console output. Last resort for things the other tools do not cover. Call processEvents() before each long process (BXT, NXT, SXT) so Pause/Abort works. No ES6 module syntax; the snippet is eval-ed as a script, so #include does not work and a top-level return is a syntax error; `include` prepends files instead. Code that does not parse is refused with its line number before anything reaches PixInsight.

ParameterTypeDescription
code *stringPJSR code. The value of the last expression is returned.
asyncbooleanRun as a job: the call returns a job id at once and the code runs in PixInsight in the background. job_status reports on the job and returns its result; cancel_job stops it. While a job runs, other ca…
includearrayAbsolute paths of PJSR source files whose contents run before `code`, in this order, in the same scope, so functions they define can be called from `code`.

run_pixelmath

Run an arbitrary PixelMath expression in place on a view. The result is truncated to [0,1]; the reply gives, per channel, the fraction of samples that were below 0 or above 1 before truncation, and their min and max. RULES: (1) NO pow() — use exp(exponent*ln(base)). (2) Channel access is $T[0] for R, $T[1] for G, $T[2] for B — NOT $T.R or $T.B. (3) For other images use viewId[0], viewId[1], viewId[2].

ParameterTypeDescription
expression *stringPixelMath expression using $T for current pixel value
view_id *stringView ID to process
single_expressionbooleanApply the same expression to all channels (default true)
symbolsstringSymbol declarations (comma-separated)

pixelmath_new_image

Run PixelMath to create a NEW image from expressions that reference other open views by id. Color "rgb" takes red/green/blue expressions; color "gray" takes a single expression. The new image is truncated to [0,1]; the reply gives, per channel, the fraction of samples that were below 0 or above 1 before truncation. When size_from has an astrometric solution it is copied onto the new image (same geometry), unless copy_astrometric_solution is false. View ids used inside expressions must be simple identifiers (rename_view renames a view). No pow() — use exp(exponent*ln(base)) or the ^ operator.

ParameterTypeDescription
color *string
output_id *stringId for the new image
size_from *stringA view whose width and height the new image copies
bluestringBlue channel expression (color "rgb")
copy_astrometric_solutionbooleanCopy size_from's astrometric solution onto the new image when it has one
expressionstringSingle expression for color "gray"
greenstringGreen channel expression (color "rgb")
redstringRed channel expression (color "rgb")
symbolsstringPixelMath symbols; constants only, e.g. "k=0.3". Symbols cannot hold images: write image expressions inline.

run_process

Instantiate any PixInsight process by its PJSR constructor name, assign JSON-valued parameters onto the instance, and execute it on a view (when view_id is given) or globally (when it is omitted). Generic fallback for processes with no dedicated tool. A params key that is not a parameter of the installed process is refused by name, since PixInsight would otherwise ignore it. A process that has the noGUIMessages property (Crop, DynamicCrop, Resample, IntegerResample, Rotation, FastRotation, ChannelMatch and others) runs with it set to true unless params sets it, so its confirmations and warning…

ParameterTypeDescription
name *stringPJSR process constructor name, e.g. "SCNR".
paramsobjectProperty name to JSON-valued setting, assigned on the process instance before it runs.
view_idstringView to run the process on. Omit to run the process globally instead.

run_pjsr_file

Run a PJSR (JavaScript, V8 engine) source file from disk inside PixInsight and return its console output. Same execution model as run_pjsr, with the code read from a file instead of passed inline. No ES6 module syntax; the file content is eval-ed, so #include does not work. Code that does not parse is refused with its line number before anything reaches PixInsight.

ParameterTypeDescription
path *stringAbsolute path to the PJSR source file.
asyncbooleanRun as a job: the call returns a job id at once and the code runs in PixInsight in the background. job_status reports on the job and returns its result; cancel_job stops it. While a job runs, other ca…

ensure_dir

Create a folder, with any missing parents, inside the workspace's output folder or state folder. A relative path is resolved under <workspace>/output; an absolute one must lie inside <workspace>/output or the state folder (<workspace>/agentic by default), and a path anywhere else is refused. An existing folder is left as it is. Returns the absolute path.

ParameterTypeDescription
path *stringFolder path: relative to <workspace>/output, or absolute inside <workspace>/output or the state folder

open_image

Open an XISF/FITS image file in PixInsight. Returns the view ID assigned by PixInsight. Automatically closes any crop_mask windows that come with XISF files.

ParameterTypeDescription
file_path *stringAbsolute path to the image file

close_image

Close an image window to free memory.

ParameterTypeDescription
view_id *stringView ID to close

list_open_images

List all currently open images in PixInsight with their dimensions and color status.

rename_view

Rename an image view to a different view ID. Long XISF names can cause some PixInsight processes to fail.

ParameterTypeDescription
new_id *stringNew view ID (no spaces)
old_id *stringCurrent view ID

clone_image

Clone an image to a backup view, which can be restored from later with restore_from_clone. The clone keeps the image's FITS keywords, astrometric solution and view properties.

ParameterTypeDescription
clone_id *stringName for the clone
source_id *stringSource view ID

restore_from_clone

Restore an image from a backup clone, replacing all changes since the clone was made.

ParameterTypeDescription
clone_id *stringClone view ID to restore from
target_id *stringTarget view ID to overwrite

crop_image

Crop pixels off the edges of an image, in place. Amounts are pixels to remove from each side. All four amounts 0 (or omitted) runs nothing and leaves the image, and its astrometric solution, unchanged. Crop runs with noGUIMessages, so PixInsight writes its warnings to the Process Console instead of opening a confirmation dialog. A crop deletes the image's astrometric solution (PixInsight behaviour); the result says when one was removed.

ParameterTypeDescription
view_id *stringView ID to crop
bottomnumberPixels to remove from the bottom edge
leftnumberPixels to remove from the left edge
rightnumberPixels to remove from the right edge
topnumberPixels to remove from the top edge

get_image_dimensions

Get dimensions, channel count, and color status for one or more views. Every channel must have identical dimensions before ChannelCombination.

ParameterTypeDescription
view_ids *arrayView IDs to check

get_image_stats

Get image statistics: median, MAD, min, max, per-channel medians, and per channel the fraction of samples at exactly 0 and at exactly 1 (clampFractions).

ParameterTypeDescription
view_id *stringPixInsight view ID

export_image

Write an image to a file in the workspace's output or state folder. A relative file_path is resolved under <workspace>/output; an absolute one must lie inside <workspace>/output or the state folder (<workspace>/agentic by default), and a path anywhere else is refused. Format comes from the extension: .tif/.tiff, .png, .jpg/.jpeg, .xisf, .fits. TIFF and PNG default to 16-bit, JPEG to 8-bit; use 32 for float. The file keeps the image's FITS keywords, astrometric solution and view properties (formats that cannot store them drop them). The working image is not changed. Missing parent folders are c…

ParameterTypeDescription
file_path *stringOutput file path: relative to <workspace>/output, or absolute inside <workspace>/output or the state folder
view_id *stringView ID to export
bitsnumberSample depth for tif/png/xisf/fits (default 16 for tif/png, 32 otherwise)

list_processes

List every PixInsight process available on this installation, by its PJSR constructor name (e.g. "SCNR", "PixelMath"). Read-only; classifies by prototype chain and never instantiates a process to build the list.

describe_process

Describe one PixInsight process by its PJSR constructor name: whether it can run on a view and/or globally, its current parameter values and their types, and any named numeric constants it exposes for those parameters.

ParameterTypeDescription
name *stringPJSR process constructor name, e.g. "SCNR".

create_luminance_mask

Create a luminance mask from a color view: Y = 0.2126R + 0.7152G + 0.0722B, then an optional blur and shadow clip.

ParameterTypeDescription
mask_id *stringName for the mask
source_id *stringSource color view ID
blurnumberBlur sigma applied to the mask (default 5)
clip_lownumberShadow clip threshold, below which the mask is 0 (default 0.10)
gammanumberGamma curve applied to the mask (default 1.0)

apply_mask

Apply a mask to a target view. The mask protects areas where it is black (0) and allows processing where it is white (1). Use inverted=true to flip this.

ParameterTypeDescription
mask_id *stringMask view ID
target_id *stringTarget view ID
invertedbooleanInvert the mask (default false)

remove_mask

Remove the current mask from a view.

ParameterTypeDescription
target_id *stringTarget view ID

close_mask

Close and delete a mask window to free memory.

ParameterTypeDescription
mask_id *stringMask view ID to close

create_zone_masks

Create core, shell and halo masks from three fixed luminance thresholds. Luminance is the Rec.709 luma of a color view, the samples of a gray one: core = above core_clip, shell = shell_clip to core_clip, halo = halo_clip to shell_clip, each ramped linearly from 0 to 1 across its band and Gaussian-blurred with sigma 8, 12 and 20. Creates views mask_core, mask_shell and mask_halo, replacing views of those names. Requires halo_clip < shell_clip < core_clip < 1.

ParameterTypeDescription
core_clip *numberLuminance above which a pixel is in the core mask (0-1)
halo_clip *numberLuminance above which a pixel, up to shell_clip, is in the halo mask (0-1)
shell_clip *numberLuminance above which a pixel, up to core_clip, is in the shell mask (0-1)
view_id *stringSource view the masks are computed from

create_adaptive_zone_masks

Create three masks from percentiles of the image's own luminance. Subject pixels are those brighter than the background median + 5 MAD, sampled inside a circle of radius 0.35 * min(width, height) around their brightness-weighted centroid. Core = above the subject percentile 85 + 10 * core_bias; shell = a triangular ramp between the 25th percentile and the core level, peaking at their midpoint; outer = subject level up to the 25th percentile. Each is feathered over 20 px outside the circle and Gaussian-blurred with sigma 5, 10 and 20. Creates views azone_core, azone_shell and azone_outer, repla…

ParameterTypeDescription
view_id *stringSource view the masks are computed from
core_biasnumberPosition of the core threshold on its 0-1 scale: 0 = percentile 85, 1 = percentile 95 (default 0.5, the middle of the scale)

measure_uniformity

Measure background uniformity via 4-corner median stddev. Lower score means more uniform.

ParameterTypeDescription
view_id *stringPixInsight view ID
sample_sizeintegerCorner sample size in pixels (default 200)

measure_stars

Measure the stars of a view by pixel sampling. Candidates are local maxima of luminance found by a 16 px grid scan above median + 5 x MAD, refined within 5x5, de-duplicated within 20 px (at most 100 kept); the 30 brightest are measured. FWHM of a star = 2 x the mean radius, over the four axis directions (up to 10 px), where luminance drops below half its peak, located to a fraction of a pixel by linear interpolation between the samples either side; colour diversity of a star = max - min of its peak RGB divided by the largest channel. Returns JSON: median_fwhm_px, color_diversity (median), star…

ParameterTypeDescription
view_id *stringView to measure

measure_star_layer

Measure a star layer (a mostly black view holding stars). Over every 4th pixel whose largest channel is above 0.005 (nonzero_pixel_count), reports the fraction whose largest channel is above each of the given levels, the interquartile range of their HSV saturation (color_diversity), and the median (max - min) / max of the 20 brightest by R+G+B (bright_star_chroma). Also the largest channel value (max) and the image median (the mean of the channel medians for colour). Returns JSON: max, median, fraction_above {level: fraction}, color_diversity, bright_star_chroma, nonzero_pixel_count.

ParameterTypeDescription
levels *arrayPixel levels; for each, the fraction of star pixels whose largest channel is above it is reported
view_id *stringStar layer view to measure

measure_ringing

Measure concentric oscillation around the brightest region. The centre is the middle of the brightest 64 px block (mean luminance); the radial luminance profile is averaged over 36 angles for radii 1..150 px (held inside the image). Along the profile, derivatives within ±0.001 carry no sign; at each sign change the summed |derivative| of the run it ends is its amplitude, and it is counted when that amplitude is above min_amplitude. Returns JSON: oscillations, max_amplitude (of the counted ones), center [x, y], profile_sample (the profile at radii 1..30). luminance is 0.2126R + 0.7152G + 0.072…

ParameterTypeDescription
min_amplitude *numberAmplitude (summed |derivative| of a run) above which a sign change is counted as an oscillation
view_id *stringView to measure

measure_sharpness

Measure sharpness as the mean Sobel gradient energy (gx² + gy²) of luminance over every 4th pixel of a region. The region is roi_x/roi_y/roi_w/roi_h when all four are given (it must lie inside the image), else the central half of the image in each dimension. Returns JSON: sharpness, samples, roi {x, y, w, h}. luminance is 0.2126R + 0.7152G + 0.0722B.

ParameterTypeDescription
view_id *stringView to measure
roi_hnumberRegion height in pixels
roi_wnumberRegion width in pixels
roi_xnumberRegion left edge in pixels (all four ROI values together, or none: the central half)
roi_ynumberRegion top edge in pixels

measure_core_clipping

Measure how much of the brightest region is above a level. Around the brightest 64 px block (mean luminance), counts pixels with any channel above level in a 128 px box (every 2nd pixel) and a 32 px box (every pixel), both centred on that block and held inside the image. Returns JSON: fraction_above_wide, fraction_above_inner, peak (largest luminance in the wide box), core_center [x, y], wide_box, inner_box. luminance is 0.2126R + 0.7152G + 0.0722B.

ParameterTypeDescription
level *numberPixel level; a pixel with any channel above it is counted
view_id *stringView to measure

measure_clipped_blocks

Count image blocks with pixels above a level. Tiles the image in block_size px blocks and samples every 3rd pixel; a sample counts when its luminance or any channel is above level, and a block counts when more than block_fraction of its samples do. Returns JSON: blocks_over, total_blocks, locations (up to 10 counted blocks in descending fraction order: x, y, fraction). luminance is 0.2126R + 0.7152G + 0.0722B.

ParameterTypeDescription
block_fraction *numberFraction of a block's samples (0-1) that must be above level for the block to count
level *numberPixel level; a sample whose luminance or any channel is above it counts
view_id *stringView to measure
block_sizeintegerBlock edge in pixels (default 50)

measure_highlight_texture

Measure the texture of the bright subject zone. Subject pixels have luminance above median + 5 x (median |luminance - median| on a 32 px grid). The ROI is a circle around the luminance-weighted centroid of compact subject pixels (8 px grid, at least 2 of 4 neighbours 3 px away also subject), radius = their 90th-percentile distance held to [50 px, 0.45 x min(width, height)]. The shell zone is the P20..P92 band of the subject pixels in the ROI (every 4th pixel). local_stddev = median luminance stddev of 16 px blocks in the ROI whose samples are at least 40% shell; tonal_span = P90 - P10 of the s…

ParameterTypeDescription
view_id *stringView to measure
reference_idstringOptional second view measured over the same ROI, for the retention ratios

measure_saturation

Measure HSV saturation, (max - min) / max, of subject pixels of a colour view: every 8th pixel whose luminance is above the luminance of the channel medians + 5 x (median |luminance - that| on a 32 px grid). Returns JSON: median, p90, p99, max, subject_pixel_count. A mono view is an error. luminance is 0.2126R + 0.7152G + 0.0722B.

ParameterTypeDescription
view_id *stringColour view to measure

measure_tonal_presence

Measure subject and background tones. Every 8th pixel is subject when its luminance is above the background (luminance of the channel medians) + 5 x (median |luminance - background| on a 32 px grid) and at least 2 of its 4 neighbours 3 px away are too; every other sample is background. separation = subject median / background median; core_brightness = mean of the brightest 5% of subject samples; core_to_disk = core_brightness / subject median; faint_structure_visibility = (subject P10 - background P90) / background P90; subject_fraction = subject samples / all samples; roi_mode is compound_roi…

ParameterTypeDescription
view_id *stringView to measure

measure_bright_chroma

Measure chroma, (max - min) / max, of the bright pixels of a colour view: every 8th pixel whose mean of R, G and B is above brightness_threshold. Returns JSON: median_chroma, mean_chroma, p25_chroma, p75_chroma, bright_pixel_count. A mono view is an error.

ParameterTypeDescription
brightness_threshold *numberMean of R, G and B above which a pixel is measured
view_id *stringColour view to measure

measure_subject_detail

Measure subject brightness, detail and contrast. The image is split into 32 px blocks; a block is subject when its luminance median is above median + 8 x 1.4826 x MAD. subject_brightness = median of subject block medians; background_median = median of the other block medians; contrast_ratio = subject_brightness / background_median (0 when that is at most 0.001); detail_score = mean Sobel energy of luminance over every 4th pixel of up to 50 subject blocks; subject_count = subject blocks; subject_threshold = median + 3 x 1.4826 x MAD. Returns JSON: subject_brightness, detail_score, contrast_rati…

ParameterTypeDescription
view_id *stringView to measure

ha_inject_red

Add Ha to the red channel of an RGB view in place, where Ha exceeds R by a given fraction. Where Ha > R * (1 + brightness_limit), R becomes R + strength * (Ha - R); elsewhere R, and G and B everywhere, are unchanged. With max_output and rolloff, R above max_output becomes max_output + (R - max_output) * rolloff. Runs as 64-bit PixelMath truncated to [0,1]; reports the new R maximum and the image median and max.

ParameterTypeDescription
brightness_limit *numberHa is added only where Ha > R * (1 + brightness_limit)
ha_id *stringHa view (mono, same dimensions)
strength *numberFraction of the Ha excess over R added to R
target_id *stringTarget RGB view, modified in place
max_outputnumberOptional: R level above which the soft clamp compresses; given together with rolloff. Omitted = no clamp
rolloffnumberFraction of the excess above max_output that is kept; given together with max_output

ha_inject_luminance

Raise the luminance of an RGB view in place where Ha exceeds it, keeping colour ratios. With Y the Rec.709 luminance, each channel is multiplied by (Y + strength * max(Ha - Y, 0)) / Y. Runs as 64-bit PixelMath truncated to [0,1].

ParameterTypeDescription
ha_id *stringHa view (mono, same dimensions)
strength *numberFraction of the Ha excess over the luminance that is added
target_id *stringTarget RGB view, modified in place

extract_pseudo_oiii

Create a mono view from the B channel of an RGB view minus its scaled R channel. OIII = max(0, B - continuum_factor * R); any view of that name is replaced. Reports the new view's median and max.

ParameterTypeDescription
continuum_factor *numberMultiplier on R subtracted from B
rgb_id *stringSource RGB view
output_idstringName of the view to create; omitted = OIII_pseudo

continuum_subtract_ha

Subtract the scaled R channel of an RGB view from an Ha view, in place. Ha = max(0, Ha - continuum_factor * R). Runs as 64-bit PixelMath truncated to [0,1]; reports the new median and max.

ParameterTypeDescription
continuum_factor *numberMultiplier on R subtracted from Ha
ha_id *stringHa view (mono), modified in place
rgb_id *stringRGB view whose R channel is subtracted (same dimensions)

dynamic_narrowband_blend

Add Ha and OIII (mono views) to an RGB view in place, through a temporary luminance mask. R += ha_strength * Ha; B += oiii_strength * OIII; G += f * ha_strength * g_ha_fraction * Ha + (1 - f) * g_strength * OIII, with f = (OIII*Ha)^(1-OIII*Ha). Each channel above max_output becomes max_output + (x - max_output) * rolloff. The mask is the Rec.709 luminance of the target, Gaussian-blurred with sigma mask_blur, then 0 below mask_clip and (x - mask_clip) / (1 - mask_clip) above it; it is removed afterwards. Runs as 64-bit PixelMath truncated to [0,1]; reports the median and the R and B maxima.

ParameterTypeDescription
g_ha_fraction *numberFraction of ha_strength applied to Ha in the G term
g_strength *numberMultiplier on OIII in the G term
ha_id *stringHa view (mono, same dimensions)
ha_strength *numberMultiplier on Ha added to R
mask_blur *numberGaussian sigma (pixels) of the luminance mask blur
mask_clip *numberMask level below which the blend does not apply; 0 = no clip
max_output *numberPer-channel level above which the soft clamp compresses
oiii_id *stringOIII view (mono, same dimensions)
oiii_strength *numberMultiplier on OIII added to B
rolloff *numberFraction of the excess above max_output that is kept
target_id *stringTarget RGB view, modified in place

create_synthetic_luminance

Create a mono view from a weighted sum of Ha and OIII. It is ha_weight * Ha + oiii_weight * OIII, replacing any view of that name; with max_value the result is min(…, max_value); it is then truncated to [0,1]. Reports the new view's median and max.

ParameterTypeDescription
ha_id *stringHa view (mono)
ha_weight *numberMultiplier on Ha
oiii_id *stringOIII view (mono, same dimensions)
oiii_weight *numberMultiplier on OIII
max_valuenumberOptional: upper cap on the result. Omitted = truncation to [0,1] only
output_idstringName of the view to create; omitted = SYNTH_L

save_preview

Save a JPEG preview of a view and return the file path. Optionally a crop region, a downsample factor, and an STF (display stretch) baked into the pixels: the STF of a view (stf_from) or a linked one given as stf_m and stf_c0. Without an STF the JPEG holds the view's pixel values as they are. The view itself is not changed.

ParameterTypeDescription
label *stringShort label for this preview (e.g. "after_stretch", "final")
view_id *stringPixInsight view ID
croparrayRegion [x0, y0, x1, y1] of the view in pixels (x1, y1 exclusive); the whole view when omitted
downsamplenumberDivide width and height by this factor (>= 1). Omitted: the preview is scaled down to at most 2048 px on its longer side
stf_c0numberShadows clipping point of the linked STF given with stf_m (0 <= c0 < 1)
stf_fromstringBake this view's STF (its display stretch) into the JPEG; the view may be view_id itself. Several previews given the same stf_from are stretched identically
stf_mnumberBake a linked STF with this midtones balance (0 < m < 1) into the JPEG; needs stf_c0

save_and_show_preview

Alias for save_preview. Save a JPEG preview of a view and return the file path.

ParameterTypeDescription
label *stringShort label for this preview (e.g. "after_stretch", "final")
view_id *stringPixInsight view ID
croparrayRegion [x0, y0, x1, y1] of the view in pixels (x1, y1 exclusive); the whole view when omitted
downsamplenumberDivide width and height by this factor (>= 1). Omitted: the preview is scaled down to at most 2048 px on its longer side
stf_c0numberShadows clipping point of the linked STF given with stf_m (0 <= c0 < 1)
stf_fromstringBake this view's STF (its display stretch) into the JPEG; the view may be view_id itself. Several previews given the same stf_from are stretched identically
stf_mnumberBake a linked STF with this midtones balance (0 < m < 1) into the JPEG; needs stf_c0

run_scnr

Run SCNR (Subtractive Chromatic Noise Reduction) to remove a green colour cast from a view.

ParameterTypeDescription
view_id *stringPixInsight view identifier.
amountnumberGreen removal amount, 0 to 1.
protectionstringProtection method.

run_gradient_correction

Run GradientCorrection on a view to remove a background gradient.

ParameterTypeDescription
view_id *stringPixInsight view identifier.

run_background_neutralization

Run BackgroundNeutralization to equalize the background level across channels.

ParameterTypeDescription
view_id *stringPixInsight view identifier.

run_nxt

Run NoiseXTerminator to reduce noise on a view.

ParameterTypeDescription
denoise *numberDenoise strength, 0 to 1.
view_id *stringPixInsight view identifier.
detailnumberDetail preservation, 0 to 1.
ml_versionnumberNeural network model version (the process's ml_version parameter). Omitted, the process keeps its own setting.

linear_fit

Run LinearFit to scale a linear image to match a reference view. The reference is not modified.

ParameterTypeDescription
reference_id *stringReference view ID.
view_id *stringPixInsight view identifier.
reject_highnumberHigh rejection threshold.
reject_lownumberLow rejection threshold.

run_lhe

Run LocalHistogramEqualization (contrast-limited local histogram equalization) on a view. Omitted parameters keep PixInsight's defaults.

ParameterTypeDescription
view_id *stringPixInsight view identifier.
amountnumberBlend of the equalized result with the original, 0 to 1.
circular_kernelbooleanCircular kernel (true) or square kernel (false).
histogram_resolutionstringHistogram resolution: 8, 10 or 12 bits.
radiusnumberKernel radius in pixels.
slope_limitnumberContrast slope limit.

run_bxt

Run BlurXTerminator on a view. correct_only applies PSF correction without sharpening; otherwise sharpen_nonstellar and sharpen_stellar (the process's sharpen_stars parameter) control sharpening strength. ml_version is the process's neural network model version; omitted, the process keeps its own setting.

ParameterTypeDescription
view_id *stringView ID to process
adjust_star_halosnumberStar halo adjustment, -1 to 1 (default 0.0)
correct_onlybooleanCorrect-only mode: PSF correction with no sharpening
ml_versionnumberNeural network model version (the process's ml_version parameter)
sharpen_nonstellarnumberNon-stellar sharpening, 0 to 1 (default 0.50)
sharpen_stellarnumberStellar sharpening, 0 to 1 (default 0.50)

run_sxt

Run StarXTerminator to separate stars from a view, replacing it in place with the starless result and producing a separate stars view. is_linear selects the unscreen mode: off for linear (pre-stretch) data, on for non-linear (stretched) data.

ParameterTypeDescription
is_linear *booleanWhether the image is linear (pre-stretch)
view_id *stringView ID to extract stars from (modified in place to become starless)
ml_versionnumberNeural network model version (the process's ml_version parameter). Omitted, the process keeps its own setting.
overlapnumberTile overlap (default 0.5). The former default 0.10 left a faint rectangular tile grid (cells of about 470 px) in linear starless images; 0.5 did not.

run_abe

Run AutomaticBackgroundExtractor (ABE) on a view, replacing it in place with the corrected result.

ParameterTypeDescription
view_id *stringView ID to process
poly_degreeintegerPolynomial degree, 1 to 6 (default 4)
tolerancenumberSample rejection tolerance (default 1.0)

run_hdrmt

Run HDRMultiscaleTransform on a view. Inverted mode enhances detail; normal mode compresses dynamic range.

ParameterTypeDescription
layers *integerNumber of decomposition layers, 4 to 8 (default 6)
view_id *stringView ID to process
invertedbooleanInverted mode (enhances detail instead of compressing)
iterationsintegerNumber of iterations (default 1)
preserve_huebooleanPreserve hue for color images (default true)
to_lightnessbooleanApply to lightness only for color images (default true)

run_curves

Apply a CurvesTransformation to a view. Provide control points as [[x,y], ...] for the desired channel: "RGB" (all), "L" (lightness), "S" (saturation), "R", "G", "B". On a grayscale view CurvesTransformation applies only the RGB curve, so any other channel is refused there.

ParameterTypeDescription
channel *stringChannel to apply the curve to
points *arrayControl points [[x,y], ...] from (0,0) to (1,1). Include endpoints.
view_id *stringView ID to process

find_filters

Search PixInsight's built-in filter and camera QE database by name (case-insensitive substring). A grouped name also matches each name it stands for ("Sony IMX411/455/461/533/571" matches "IMX533"); results are ordered exact name, then substring, then grouped-name matches. Use it to pick exact names for run_spfc or run_spcc. Sensor QE curves have channel Q.

ParameterTypeDescription
channelstringOptional: R, G, B, L, PAN (multiband OSC) or Q (sensor QE)
querystringe.g. "Astronomik", "Ha", "IMX533", "Chroma"

run_spfc

Run SpectrophotometricFluxCalibration: writes the flux metadata that run_mgc requires. The image must be plate-solved and linear. Needs the camera QE curve (default "Ideal QE curve"; pass qe_name for the real sensor, see find_filters) and the filter curve. MONO image: pass filter (L, R, G, B, Ha, OIII, SII) and optionally filter_name (a measured curve from the database; otherwise a flat passband from wavelength_nm/bandwidth_nm is used). COLOR image: omit filter and pass red_filter_name, green_filter_name, blue_filter_name (otherwise flat R/G/B passbands).

ParameterTypeDescription
view_id *stringView ID to calibrate
bandwidth_nmnumberMono: filter bandwidth in nm, if filter_name is not given
blue_filter_namestringColor: measured B filter curve name from find_filters
filterstringMono only. One of L, R, G, B, Ha, OIII, SII
filter_namestringMono: measured filter curve name from find_filters
green_filter_namestringColor: measured G filter curve name from find_filters
qe_namestringCamera QE curve name (default "Ideal QE curve")
red_filter_namestringColor: measured R filter curve name from find_filters
wavelength_nmnumberMono: filter center wavelength in nm, if filter_name is not given

run_spcc

Run SpectrophotometricColorCalibration (SPCC). Requires the image to have an astrometric solution (run_plate_solve adds one) and to be linear (not stretched). Narrowband mode (narrowband_mode true) calibrates each channel as a narrow band: give the real filter centre and width per channel (red_/green_/blue_wavelength_nm and _bandwidth_nm; PixInsight's defaults are 656.3 / 500.7 / 500.7 nm and 3 nm for every band, wrong for a 5 nm H-alpha filter). The white reference matters for star colour: use a solar-type reference such as "G2V Star"; the default "Average Spiral Galaxy" makes a galaxy neutra…

ParameterTypeDescription
view_id *stringView ID to calibrate (must be linear, must have a WCS/astrometric solution)
blue_bandwidth_nmnumberNarrowband mode: bandwidth of the blue channel's filter in nm (PixInsight default 3)
blue_filter_namestringMeasured B filter curve name, as listed by find_filters
blue_wavelength_nmnumberNarrowband mode: centre wavelength of the blue channel's filter in nm (default 500.7)
green_bandwidth_nmnumberNarrowband mode: bandwidth of the green channel's filter in nm (PixInsight default 3)
green_filter_namestringMeasured G filter curve name, as listed by find_filters
green_wavelength_nmnumberNarrowband mode: centre wavelength of the green channel's filter in nm (default 500.7)
narrowband_modebooleanEnable narrowband mode (default false)
qe_namestringCamera QE curve name (find_filters channel Q)
red_bandwidth_nmnumberNarrowband mode: bandwidth of the red channel's filter in nm (PixInsight default 3)
red_filter_namestringMeasured R filter curve name, as listed by find_filters. Set all three filters and qe_name together for a full calibration.
red_wavelength_nmnumberNarrowband mode: centre wavelength of the red channel's filter in nm (default 656.3)
white_referencestringWhite reference name from PixInsight's database, e.g. "Average Spiral Galaxy", "G2V Star"
white_reference_namestringSame as white_reference

run_mgc

Run MultiscaleGradientCorrection using the MARS reference database. The image must be plate-solved and linear; a mono image also needs the flux metadata run_spfc writes. For a mono image pass filter (L, R, G, B, Ha, OIII, SII); a mono image without filter is refused, since MGC would then fit its model against a MARS band that is not the image's. For a color image leave it out (R, G, B bands are used). MARS files default to the ones configured in PixInsight.

ParameterTypeDescription
view_id *stringView ID to process
filterstringMono only. One of L, R, G, B, Ha, OIII, SII
gradient_scalenumberGradient scale in pixels (default 1024)
mars_filesarrayAbsolute .xmars paths (default: from PixInsight settings)
model_smoothnessnumberModel smoothness (default 1)
show_modelbooleanAlso create the gradient model window
structure_separationnumberStructure separation (default 3)

reproject_to_reference

Resample a plate-solved image onto the pixel grid of another plate-solved image, using the two astrometric solutions (PixInsight's astrometric reprojection): the result has the reference's size and solution and comes from a single interpolation of the source. Use it to bring a master from another telescope or session onto a reference grid; both views need a solution (run_plate_solve). The source is not changed; the result is a new 32-bit float view (output_id, default <view_id>_reprojected). It reports the size, the time and whether the result is empty (the two fields do not overlap). Registra…

ParameterTypeDescription
reference_id *stringView whose size and astrometric solution the result takes (needs an astrometric solution)
view_id *stringSource view to reproject (needs an astrometric solution)
clampnumberClamping threshold of the Lanczos and bicubic interpolations, 0 to 1 (default 0.3)
interpolationstringPixel interpolation (default Lanczos3)
output_idstringView ID of the result (default <view_id>_reprojected)

resample_image

Change an image's pixel dimensions. mode "integer": IntegerResample by a whole factor (factor 2 bins 2x2 into one pixel with the given downsampling combination; enlarge: true multiplies the size instead). mode "scale": Resample by a relative factor (0.5 halves each side). mode "to_reference": Resample to exactly the width and height of reference_id. Runs in place, or on a copy named output_id that carries the keywords, astrometric solution and view properties. FITS keywords are kept. PixInsight removes the astrometric solution in these processes; the result states whether a solution was presen…

ParameterTypeDescription
mode *stringinteger (IntegerResample), scale (Resample by a factor) or to_reference (Resample to reference_id's size)
view_id *stringView to resample
downsamplingstringinteger mode: how binned pixels combine (default Average)
enlargebooleaninteger mode: multiply the size by factor instead of dividing it (default false)
factornumberinteger: whole bin/zoom factor >= 2. scale: relative size factor > 0
interpolationstringscale / to_reference: Resample interpolation; omitted, PixInsight's default
output_idstringResample a copy with this view id instead of the view itself
reference_idstringto_reference: the view whose width and height the result takes

pixinsight_info

Report the resolved PixInsight installation paths for this platform and the connector version. Read-only. For live process status, use the doctor command.

star_protected_blend

Blend a stars-only image into a starless one in place, as a screen blend that turns colour-preserving in bright star cores. The mode follows, per pixel, the star layer's own luminance SL (the mean of its three channels). Below core_threshold_low: per-channel screen blend 1 - (1 - target) * (1 - stars * k). Above core_threshold_high: luminance-only screen blend, the target's colour scaled by the new over the old luminance and capped at max_value. Between them the two blend linearly. k = strength * prot, where prot falls linearly from 1 at core_threshold_low to min_strength_fraction at core_thre…

ParameterTypeDescription
core_threshold_high *numberStar luminance SL at and above which the pure colour-preserving blend applies and protection is min_strength_fraction; greater than core_threshold_low
core_threshold_low *numberStar luminance SL at and below which the pure screen blend applies and protection is 1
max_value *numberUpper cap on each channel of the colour-preserving blend, and of the colour restoration when pre_star_id is given
min_strength_fraction *numberProtection factor reached at core_threshold_high (strength is multiplied by it)
stars_id *stringStars-only RGB view
strength *numberMultiplier k on the star layer in the screen blend, before protection
target_id *stringStarless RGB view, modified in place
pre_star_idstringOptional: RGB view whose colour ratios are restored in bright areas after the blend; empty or absent = no restoration

restore_star_color

Restore the colour ratios of a reference view in the bright areas of a target, in place, keeping the target's luminance. Per channel: restored = min(reference[c] * Lt / max(Lr, 0.001), max_value), where Lt and Lr are the target's and the reference's channel means; it is weighted in linearly from 0 at reference luminance restore_start to 1 at restore_end. Runs as 64-bit PixelMath truncated to [0,1]; reports the target's median and max before and after.

ParameterTypeDescription
max_value *numberUpper cap on each restored channel
pre_star_id *stringReference RGB view whose colour ratios are restored (open, same dimensions)
restore_end *numberReference luminance at and above which the restored colour fully replaces the target; greater than restore_start
restore_start *numberReference luminance at and below which the target is unchanged
target_id *stringRGB view to modify in place

robust_median_stretch

Stretch a linear view in place so its median lands on target_median. Per pass: from the median M and the unnormalized median absolute deviation D of the image (range clipping off, alpha excluded), sigma = 1.4826·D and the black point c0 = max(0, M − black_point_sigma·sigma); samples are rescaled to u = clamp((x − c0)/(1 − c0), 0, 1), and the midtones transfer function MTF(m, u) = (m − 1)·u / ((2m − 1)·u − m) is applied with the balance m solved so that MTF(m, u(M)) = target_median exactly. linked true takes one set of statistics over all channels jointly; false takes them per c…

ParameterTypeDescription
black_point_sigma *numberDistance of the black point below the median, in units of 1.4826·MAD (>= 0)
target_median *numberMedian of the output, strictly between 0 and 1
view_id *stringView to stretch (modified in place)
highlight_kneenumberOutput level above which values are compressed, strictly between 0 and 1. Given together with highlight_midtones; omitted = no highlight compression.
highlight_midtonesnumberMTF balance applied to the segment above highlight_knee, strictly between 0.5 and 1. Given together with highlight_knee.
linkedbooleanColour images only, required for them: true = joint statistics over all channels and one transform for all; false = statistics and transform per channel. Ignored for a grayscale image.
passesintegerNumber of times the whole procedure runs, each on the previous output (>= 1; omitted = 1)

stretch_stars

Stretch a linear star image in place with a pedestal subtraction and a repeated midtones transfer function. When the image median is above 1e-5 it is subtracted as a pedestal and the rest rescaled, max(0, (x − median)/(1 − median)); then the midtones transfer function MTF(m, x) = (1 − m)·x / ((1 − 2m)·x + m) is applied `iterations` times with m = midtone. Results are truncated to [0,1]. The result reports the pedestal, the final median and maximum, and high_fraction: among pixels sampled every 16 pixels whose value (the channel maximum) exceeds 0.005 before the stretch, the fraction…

ParameterTypeDescription
iterations *integerNumber of times the MTF is applied (>= 1)
midtone *numberMTF midtones balance m, strictly between 0 and 1 (m < 0.5 brightens)
view_id *stringStar image view ID

auto_stretch

Stretch a view in place with PixInsight's auto-stretch (the ScreenTransferFunction Auto Stretch computation), applied as a HistogramTransformation. Per channel, sigma = 1.4826 × MAD (the median absolute deviation from the median). A channel whose median is below 0.5 gets shadows clipping c0 = median + shadows_clipping × sigma, clamped to [0,1] (0 when sigma is 0), and midtones balance m = MTF(target_bg, median − c0), where MTF(m, x) = (m − 1)·x / ((2m − 1)·x − m); a channel whose median is above 0.5 is treated as inverted: highlights clipping c1 = median − shadows_clipping × sig…

ParameterTypeDescription
view_id *stringView ID to stretch
linkedbooleanColour images: true computes one transform for R, G and B; false computes one per channel. Ignored for mono images
shadows_clippingnumberClipping point relative to the median, in units of sigma = 1.4826 × MAD
target_bgnumberTarget background level, strictly between 0 and 1

set_stf

Set the ScreenTransferFunction (display stretch) of a view without changing its pixels, and return it as rows [m, c0, c1, r0, r1] for R, G, B (K for mono) and luminance. Either copy the STF of from_view_id, or compute PixInsight's auto-stretch exactly as auto_stretch does (per channel sigma = 1.4826 × MAD; c0 = median + shadows_clipping × sigma; m = MTF(target_bg, median − c0); linked: one set of values for R, G and B from the mean clipping point and mean median). An STF is stored with the view and saved in XISF files.

ParameterTypeDescription
view_id *stringView whose STF is set
from_view_idstringCopy this view's STF instead of computing one; target_bg, shadows_clipping and linked are then not allowed
linkedbooleanColour images: true computes one set of values for R, G and B; false one per channel. Ignored for mono images
shadows_clippingnumberClipping point relative to the median, in units of sigma = 1.4826 × MAD
target_bgnumberTarget background level, strictly between 0 and 1

continuous_clamp

Compress bright values in place above a knee that varies per pixel. A luminance image (Rec.709 weights for colour) is blurred with a Gaussian of sigma blur_sigma and divided by its maximum, giving L in [0,1]; the knee is min_clamp + (max_clamp − min_clamp)·(1 − L), so it equals min_clamp where L = 1 and max_clamp where L = 0. mode soft: a value above the knee becomes knee + headroom·(1 − exp(−rate·(value − knee)/headroom)); mode hard: min(value, knee). The same expression is applied to every channel and the result is truncated to [0,1].

ParameterTypeDescription
max_clamp *numberKnee where the blurred luminance is 0
min_clamp *numberKnee where the blurred luminance is at its maximum
mode *stringsoft: exponential compression above the knee; hard: values above the knee are set to the knee
view_id *stringTarget view to clamp (modified in place)
blur_sigmanumberGaussian blur sigma of the luminance mask, in pixels; omitted = max(60, round(image width / 100))
headroomnumberSoft mode, required there: the most the output can exceed the knee
ratenumberSoft mode, required there: steepness of the exponential compression

run_wbpp

Start WeightedBatchPreprocessing (WBPP) headless in a separate PixInsight instance (PixInsight -n --automation-mode --force-exit) over input_dirs, writing into output_dir, and return a run id at once; wbpp_status reports the run. output_dir must lie inside <workspace>/output (a relative path is resolved there) or the state folder. Only the WBPP parameters given are passed; WBPP's own settings apply to the rest. Interactive local normalization and frame selection are turned off so nothing waits for a click. optimize_darks and drizzle_scale are applied to every light group by a generated pipelin…

ParameterTypeDescription
input_dirs *arrayFolders WBPP scans recursively for lights, darks, flats and bias (WBPP dir=)
output_dir *stringWBPP output folder: relative to <workspace>/output, or absolute inside <workspace>/output or the state folder
autocropbooleanWBPP autocrop
distortion_correctionbooleanWBPP distortionCorrection
drizzle_scalenumberEnable drizzle on every light group at this scale
extra_paramsobjectFurther WBPP automation parameters, {name: value}
frame_selectionarrayFrame selection filters [{metric, value, compare}], compare less or greater (non-interactive)
generate_rejection_mapsbooleanWBPP generateRejectionMaps
image_registrationbooleanWBPP imageRegistration
integratebooleanWBPP integrate
keywordsarrayGrouping keywords [{name, mode}], mode pre (calibration groups), post (integration groups) or prepost
local_normalizationbooleanWBPP localNormalization (run non-interactively)
optimize_darksbooleanSet dark optimization on every light group
plate_solvebooleanWBPP platesolve
referencestringAutomatic registration reference: one for all (auto) or one per value of reference_keyword
reference_imagestringRegistration reference image file (WBPP referenceImage, manual reference)
reference_keywordstringKeyword for reference auto_by_keyword
rejectionstringPixel rejection for lights (WBPP rejection_4)
weightsstringSubframe weighting method, or none

wbpp_status

Report a run_wbpp run: running, finished (with the PixInsight exit code) or ended without an exit record; the master files in <output_dir>/master; the number of .xisf files in each subfolder of <output_dir>/registered and <output_dir>/calibrated; the WBPP log files in <output_dir>/logs; and the last lines of the instance's console output. run_id omitted: the latest run.

ParameterTypeDescription
run_idstringRun id from run_wbpp (default: the latest run)
tail_linesintegerConsole-output lines to include (default 30)

scan_workspace

Scan the working folder (recursively, any subfolder name) for XISF/FITS files and report each one's FILTER header value, geometry, exposure, whether it has an astrometric solution (WCS keywords CTYPE/CRVAL with a CD, CDELT or PC matrix, or PixInsight's AstrometricSolution properties, written as AstrometricSolution:* by PixInsight 1.9.5 and later and as PCL:AstrometricSolution:* by earlier versions), and its INSTRUME, TELESCOP, FOCALLEN, XPIXSZ, YPIXSZ and XBINNING keywords verbatim (null when absent). The connector's own state and output folders are not scanned. Read-only.

workspace_info

Report the workspace folder, the state directories under it (scratch, bridge, logs) and the output folder. Also reports where the folder came from (set_workspace, PIXINSIGHT_CONNECTOR_WORKSPACE or the launch folder) and, when it cannot be used, why. Read-only.

set_workspace

Set the workspace folder this session's files go under (scratch files, the bridge, call logs). `path` must name an existing, writable folder, absolute or starting with ~/, other than the filesystem root or the home directory itself. Returns the new workspace_info.

ParameterTypeDescription
path *stringThe folder: an absolute path, or one starting with ~/.

resume_bridge

Allow PixInsight commands again after the user pressed Pause/Abort. Call ONLY when the user explicitly tells you to continue.

list_packs

List the runtime tool packs discovered at server startup, with load status, tool counts, why any pack was skipped, and which core tools packs replaced. Read-only.

job_status

Report on a job started by run_pjsr or run_pjsr_file with `async`: its state (queued, running, ending = stopped in PixInsight with its result not yet collected, done, failed, cancelled, stopped), elapsed time, seconds since the running script last called processEvents(), its latest mcpProgress() text, and, once it has ended, its result or error and PixInsight console errors. Without job_id: the running job, else the most recent one. Read-only; it does not use PixInsight, so it answers while a job runs.

ParameterTypeDescription
job_idstringThe id run_pjsr returned. Omit for the running or most recent job.

cancel_job

Stop a job started by run_pjsr or run_pjsr_file with `async`. A job PixInsight has not started yet is removed and never runs. A running job is stopped at its next processEvents() call, where an error with MCP_CANCELLED ends the script; a native process call (a single long process, a file save) cannot be interrupted, so the stop takes effect after it returns, and what the script already changed stays changed. Without job_id: the running job. job_status reports the outcome.

ParameterTypeDescription
job_idstringThe id run_pjsr returned. Omit for the running job.