PixInsight script: crops all your integrated masters to the one rectangle covered by every sub-frame of every channel.
Version française : README.fr.md
Masters integrated in full composition (Astro Pixel Processor, for example) have a border where
only part of the sub-frames contribute: dithering, pointing drift between nights, a rotated
session. That border is noisier and differs from one filter to the next. CommonCrop finds it from
the masters alone and gives you L_crop, R_crop, ... all the same size and fully integrated.
- Per channel: the non-zero area of the master is the union of the sub-frames. Its excess over the size of one sub-frame is the spread; removing it on each side leaves the area covered by every sub-frame.
- All channels: intersection of those areas, plus a safety margin (10 px by default).
- Output check: noise at each crop edge compared with the noise further in. Around 1.00 the edge is clean; above 1.10, increase the margin.
- Visual check: after Compute, a
CommonCroppreview shows the exact crop frame on every master. Zoom into the corners to see for yourself that the frame sits inside the fully integrated area, before anything is cropped. - Field loss per filter: share of the field lost to the spread, ranked worst first. A quick score of your acquisition, filter by filter.
- Apply: creates
<filter>_cropwith an automatic STF; inputs are renamed<filter>_master. By default, the pixels of the masters are not modified. Option Crop in place: crops the masters themselves instead (one undoable history step per master).
- PixInsight 1.9.5 or later through the update repository (1.9.4: manual installation, see below).
- Masters of the same target, all integrated on the same reference frame in full composition (same dimensions, zero where nothing was covered).
- The size of one sub-frame: read from the FITS header for QHY600, ASI6200, ASI2600 and QHY268, otherwise enter it once in the settings.
- Not for WBPP masters. WBPP registers every sub-frame on the reference frame, so its masters have the size of one frame and no zero border: their partial coverage cannot be seen from the master. CommonCrop says so in its report; use the WBPP Autocrop option for those masters.
- Resources > Updates > Manage Repositories, add
https://jps-34.github.io/CommonCrop/ - Check for Updates, restart PixInsight. The repository and the script are signed with my
Certified PixInsight Developer identity,
jps-34, which PixInsight recognises from 1.9.5 on. If PixInsight reports an unknown code signing identity, install the PixInsight update first (Check for Updates, restart), then check for updates again. - Script > JPS > CommonCrop (Script > Utilities up to 1.1.1).
Or download scripts/CommonCrop.js and run it with Script > Execute Script File. On PixInsight
1.9.5 and later, keep CommonCrop.xsgn next to it so that its signature is checked; on 1.9.4,
download the .js file alone (that version does not know the jps-34 identity and would refuse the
signed script).
- Open files... or Sort open views: masters are placed in their slot from the
FILTERkeyword (or the file name). Unknown filters go to AUX1/AUX2. - Compute: report and output check.
- Check the
CommonCroppreviews on the masters, corners especially. Adjust the margin and compute again if needed. - Apply.
Interface in English or French (Langue / Language menu). Hover over any setting for help.
Copyright (c) 2026 Jacques Pouyaud. Released under the GNU General Public License, version 3 or later (GPL-3.0-or-later): you may use, study, share and modify it; any distributed work that includes this code must be released under the same licence, with its source code. Versions up to 1.1.0 were released under the MIT License, which still applies to copies of those versions.
Credit request. If you reuse the method or the code of CommonCrop, in a script, an application or a tutorial, please credit it by name with a link to this repository. This is a request, not a licence condition; when the code itself is reused, the GPL already requires keeping the copyright notice.
Bug reports and suggestions welcome as GitHub issues.
Code written by Claude (Anthropic), under the direction of Jacques Pouyaud.