Hi,
Yes, Geometry > IntegerResample is what you are looking for. The default parameters (downsample/average) perform a 2x2 binning.
Here are only Average, Median, Maximum or Minimum as operation, but not Add (Sum).
Average and add (sum) are equivalent in terms of SNR increment. The advantage of average is that you can't get out-of-range pixel values.
If you really want to perform a 'pure' 2x2 binning by summing 4-pixel blocks, this is very easy with PixelMath:
- In the 'Symbols' field type the following:
x2, y2
This allows PixelMath to use x2 and y2 as variable names instead of as image identifiers.
- Click the Edit button to the right of the RGB/K expression field and write this PixelMath expression:
x2 = 2*x();
y2 = 2*y();
pixel( $T, x2, y2 ) + pixel( $T, x2+1, y2 ) + pixel( $T, x2, y2+1 ) + pixel( $T, x2+1, y2+1 )
The expression above computes the sum of each contiguous block of 2x2 pixels in the source image.
- Uncheck the 'Rescale result' PixelMath option.
- Open the Destination section and select the following:
* Create new image: checked
* Image id: the identifier you want; for example: binned2x2
* Image width and Image height: the dimensions of your original image halved. If your image is 4096x4096, you should enter 2048 and 2048 here.
* Color space: same as target
* Sample format: 32-bit floating point (recommended)
Execute this PixelMath instance on your unbinned image and you'll get a binned result as a new image window. As I've said above, the result is the same as if you used IntegerResample in average downsampling mode in SNR terms, but the range of values is different. With a pure binning procedure, if a 2x2 block in your original image sums up more than one, the resulting binned pixel will be saturated.