The batch menu
Sections in this page
This page is up to date for GRIP version 12.3.12 but see the "What's new" page for more recent changes.
The batch menu is available from GRIP's small main window. That window may be brought to the front by pressing Ctrl-G in other windows.
The batch menu provides a way of applying the same processing to a sequence of images. GRIP sets no particular limit to the number of images which may be processed (though a limit may be imposed by the system's standard file selection dialogue). The images are not displayed in most of these processes (except for the slide show), to save time, but a progress message is shown while the processing takes place. If the processing results in new saved images they are always given modified names, so the original files are not overwritten.
GRIP only loads one image into memory at a time so there is no limitation on the sequence due to memory size. For some operations GRIP does create in memory a 32-bit-per-channel accumulator image with the same width and height as the images being processed. The accumulator needs twice the amount of memory as a normal 16-bit image (for the 21-megapixel images from my Canon camera the accumulator occupies 254 Mbytes).
The batch menu has grown very large so it has several sub-menus on it. Its main menu is like this:
- collects metadata from the selected image files and puts them together to save as an XML file. As much information is included in the XML as GRIP can possibly find in each image, so the XML file is quite large. You may wish to process the XML further (eg, with some XSLT), to make a more convenient version containing only what you need.
displays a series of images as a full-screen slide show. The following key-presses are active during the show.
- Left arrow reverses, to go backwards through the series of images.
- Right arrow goes forward.
- Up arrow speeds up by 2 (halving the interval).
- Down arrow slows down by 2.
- The space bar pauses and resumes the show. While paused, the left and right arrow keys can be used to step to the next or previous slide.
- Any other key ends the show and clears the window.
- sub-menu - leads to
- sub-menu - leads to
- sub-menu - leads to
- sub-menu - leads to
- . For every channel, for every pixel, add the values in every image and then divide by the number of images. One saved image file is created. Its name is that of the first averaged image, with _ave inserted before the type extension. An important use of averaging is when all the images are successive shots of the same scene, to reduce the effects of camera noise, especially for long exposures. The camera/lens setting and the exposure time should be the same for all of the images being averaged and in astrophotography the camera should be guided so that the subject has not moved due to the earth's rotation. There are other uses for image averaging however, including to produce unusual effects for artistic purposes, in which case camera settings, etc, need not be constant.
- is very similar to the previous option except that when all the images have been added the user is presented with a histogram of the accumulator and a curves dialogue, enabling the 32-bit-per-channel accumulator to be read out through a look-up curve into a 16-bit image for saving. In this way contrast can be modified or enhanced with a greater dynamic range than can be achieved in a 16-bit image.
- jrawio, from Tidal Wave. That can handle many types of RAW file but may not be up to date for the latest formats. In this process the file extension for each image changes to .tif so no other name change is needed. works if you have a suitable javax.imagio plug-in that can read your camera's RAW format files. GRIP is supplied with
- . A dialogue enables a sequence of processes to be built which can then be applied to a set of image files. Each file will be opened, have the sequence applied to it, and then saved with a name including "_seq" so the original file is not overwritten.
- here. displays the present page if you have installed files as described
This star-image combination process is often referred to in these pages as the "batch astro-process" and more details can be found here: click for further details.
takes a set of images assumed to be of stars on a dark background. It detects the stars in each image and analyses the patterns of the 24 brightest ones (the number 24 is modifiable). It determines where each of those stars is in each of the images and then distorts (warps) each image so that the stars are in the same position as in the middle image of the sequence. It adds the warped images together in a 32-bit-per-channel accumulator (32 bits ensures the added brightness levels do not hit a ceiling). At the end of the process the accumulator is saved in a file, in FITS format (32 bits per channel, integer).
- is a similar process but designed to keep a comet (or asteroid) stationary in the accumulated result, while the stars trail past it. This is done in a semi-automated way. On each frame, star segmentation is done and the image is displayed. Then there is a pause for the user to click with the mouse on (or near) the comet/asteroid. Closing the window proceeds to the next frame. Closing the window without clicking causes the frame to be skipped (eg, if the comet/asteroid was not visible enough to be segmented).
- is quite similar to the first option except that instead of accumulating the warped images they are each saved as a TIFF file (the orginal names modified to end with _warp.tif). The idea of this is to be able to analyse and measure stars in sets of photos taken over a long period, not a series taken in quick succession for noise reduction. More facilities will be added to GRIP for doing that analysis, the first of which is the "Measure star(s)" option below.
- is again quite similar to the first option but it is designed for making star trails in the presence of a significant background level. The trouble with combining a sequence of N images of trails is that each star moves while the background stays fixed. If there is any brightness at all in the background sky, it will be added up N times but the star trail sections only appear once in each position. The stars therefore become very faint compared to the sky. So this option finds the stars in each image and amplifies their pixels by the factor N before adding into the accumulator, while leaving the sky alone.
It is intended to extend this recent option to measure simultaneously all stars in each image, or perhaps the brightest n (where n is determined by the user).
. This first asks for confirmation that another option "Warp onto common basis" has already been used so that the images to be measured are all aligned. It then segments stars in the first image of the sequence and asks you to select a star by clicking on or near it. It then measures the integrated brightness of the star as accurately as possible (using the photometric circles as in the Blob Menu). It repeats the measurement on the same star in the rest of the images and saves the results as a CSV (comma-separated value) file for loading into a spreadsheet.
- AAVSO can now be loaded as star charts and then saved as .chart files in GRIP's (XML) format.
On the batch menu the present option enables .chart files to be merged. So by using this, AAVSO reference stars can be incorporated very easily into charts drawn from Hipparcos and Tycho data (either from local files or via AstroGrid). Note that if a magnitude for a given band has already been found when another chart refers to the same star, the magnitude is not changed by the second occurence. Therefore the reference chart must come first in the list to be merged.
Note also that this option is highly dependent on AAVSO not changing their HTML significantly.
. On the main GRIP file menu, saved HTML pages of reference stars from
- first asks for a width and height. The selected images are then scaled to fit within those dimensions and resaved. The width/height proportions of the original images are preserved (pixels remain square) so one of either the resulting width or height may be less than the selected limits. The new files have the actual resulting size appended to their name. Eg, the scaled version of file xyz.tif might be saved as xyz_400x300.tif. NB: This operation can make images larger as well as smaller, if the selected width and height are both larger than that of the original image. Linear interpolation between pixels smooths the resulting image in such cases. This is not a good way of enlarging images, the process is really intended for scaling down.
- enables cropping to the same rectangular area on a series of images. The cropping area is set interactively on the first image, by using the mouse to define two opposite corners of the rectangle. The resaved image file names have _crop added.
- mirror reverses images from left to right and resaves them with _flh in their names.
- mirror reverses images from top to bottom and resaves them with _flv in their names. Doing a horizontal flip and a vertical flip (in either order) is a way of turning images through exactly 180 degrees, without any pixel interpolation.
- asks for a scale factor then scales all selected images by that factor and resaves them with _scl in their names.
- Pixel interpolation is done. The size of the resulting image is generally larger than the original image. The frame expands so that nothing is clipped off. Resaved image files have _rot in their names. asks for an angle in degrees then rotates the images by that amount. Positive angles are measured anticlockwise.
- See full details. asks for the horizontal half-angle of the camera field of view and then maps plane photographs onto a sphere so that they may be merged accurately with other photos. Resaved image files have _ignm in their names. Doing this as a batch operation assumes that the camera/lens configuration is the same for all the images.
- See full details. asks for the horizontal half-angle of the camera field of view and then maps photographs from sphere to plane, typically after merging. Resaved image files have _gnm in their names. Doing this as a batch operation assumes that the camera/lens configuration is the same for all the images.
NB: There is a limit to the amount of distortion that GRIP can accurately correct. If you find the result is not accurate enough then first use inverse gnomonic projection (which depends on the focal length of the lens), followed by the warping grid as described here. Note that the projection may produce elongated black areas at the edges of the image. That is not a problem because the process creating the warping grid ignores elongated objects.
. Options on the geometry menu (of an image window) enable lens distortions to be calibrated and corrected automatically, using a "warping grid". A reference image is required, comprising a square array of dots photographed through the same optical arrangement (lens and focal distance) as that which is to be corrected. The dots may be small squares or circles but they must all be of the same colour and intensity on a uniform background. The easiest method is to print an array of black dots on white paper. GRIP even provides a suitable image: from the initial file menu select "New test grid of squares". Ensure that the image size is such that none of the black squares touches the edge. Save the image as a TIFF file so it can be printed accurately (by any other convenient software). Photograph the printed array through the lens you wish to correct, again ensuring that none of the dots touches the edge of the photograph. Then use the option on GRIP's geometry menu, "Make warping grid". That measures the centres of the dots, works out their average spacing and orientation, and for each dot calculates where it should lie on a perfectly regular grid having the same spacing and orientation and such that the dot nearest the centre of the image will not move. Finally you will be prompted to save the measurements in a file with the extension .warp. This is in fact a comma-separated value (CSV) text file so you can look at it with any text editor or spreadsheet. Each row in the file contains the x and y coordinates of the centre of each measured dot followed by the x and y of its corrected position. So the .warp file is the warping grid that can be applied to any subsequent image photographed through the same lens. The present option applies the warp to a set of images. It will ask you to select the .warp file so GRIP can load the grid measurements. It then calculates a set of polynomials that will warp the image (like a rubber sheet) to correct the distortion. Accurate interpolation is done between pixels to get a smooth result. (The warping is the same method that is used when combining multiple exposures in astrophotography but there GRIP is matching star patterns between frames.)
- reverses black and white (for each channel), producing a negative. This is a true negative, without the orange cast that a colour film negative has. Resaved image files have _inv in their names.
- finds, for each image, the minimum and maximum value occurring in each channel, then does a linear stretch so that the minimum becomes level 0 and the maximum becomes the maximum possible for the number of bits available (255 for an 8-bit channel, 65535 for a 16-bit one). There is first a question asked: are all channels to be scaled the same? If the answer to this is "no", the stretching is calculated completely independently for each channel. That means that colour balance will not generally be preserved. On the other hand if the answer is "yes" the scaling is based on the global minima and maxima, of all channels, so colour balance is kept. Resaved image files have _stretch in their names.
- . For every pixel in each image the value of each channel is replaced by 37.5% of the red value + 50% of the green + 22.5% of the blue. All three channels then have the same value, so the pixel is displayed as a shade of grey. The percentages used here are rather arbitrary. Programmers can easily change them in class ImProcess. Resaved image files have _mono in their names.
- does what it says, for any images which have more than 8 bits per channel. The resulting files have _8bit in their names.
- here. Resaved image files have _bkgr in their names. . Details of the processing applied to each image in this case are
- will show a dialogue for the first image in the batch sequence, to enable a saturation level to be set by means of a slider. Dragging the slider to the left decreases colour saturation in the image until, at the left end of the scale, it becomes monochrome. Sliding to the right increases saturation until at the right end of the scale the image only contains fully saturated colours. The setting is then applied automatically to the remaining images in the sequence. Saved result images have _sat in their file names.
- is sometimes a useful way of increasing contrast. Saved result images have _squ in their file names.
- first asks for another image to be selected and then subtracts this image from each of the others, pixel by pixel. Resaved image files have _sub in their names. An important use of this is for removing defective pixels. A dark image (an image taken with the camera lens completely covered) is subtracted. This can be useful for long exposures. The dark image is exposed for the same length of time as the real images. Defective pixels build up a value during this time, which they should not do if perfect. The astro-process (see above) can subtract dark frames automatically, so it is not necessary to do it as a separate batch process first.
- first asks for another image to be selected and then multiplies each of the images by this one, pixel by pixel. If M is the maximum level which can occur in each channel of the target image and N is the maximum level in any channel of the other image being multiplied, the result for each pixel is scaled from M * N to M. Resaved image files have _mpy in their names.
- here. first asks for another image to be selected and then divides each of the images by this one. Resaved image files have _div in their names. The astro-process (see above) can divide by flat fields automatically, so it is not necessary to do it as a separate batch process first. More about the use of flat fields and how to make them is given