File Collapse

While Picture Window is designed to enable non-destructive editing of images, you may just want to do something simple like open an image make a change and save the result with the same name as the starting image. This is an example of destructive editing since once you replace the original file, all the steps used to create it are lost. For this reason, the normal File Save commands do not let you save an image with the same name as an open file. So, to replace an image file with a modified image of the same name you have two equally inconvenient options:

1) Rename the original file and save the modified version with the original name and then delete the renamed file.

2) Save the modified file with a different name and then delete the original file and rename the modified version.

If you are determined to save the modified image and overwrite the original file with the same name, use the File Collapse command instead of File Save. Conceptually, what this command does is:

1) Delete the original image and any associated script file it may have.

2) Save a copy of the current image with the same name as the original image, effectively replacing the original image with the current image. No script file is saved (even if the Include Script box is checked). If the top-level image of the current branch is not a File Open, then there is no original pathname so Picture Window asks you for a pathname to save the current image.

3) Close the entire branch that starts with the original image

4) Reopen the modified image as a new top-level image

The end result is to collapse the branch starting with the original image into a single modified image which replaces the original image at the top of the branch.

Two important side-effects of Collapse you need to keep in mind:

1) When you close the branch that starts with the original image, all images that depend of the original image are also closed. Depending on the image tree, that may include images below the current image in the same branch or images in other branches. Before doing anything, the Collapse command issues a warning if any images not in a direct line between the original image and the modified image will be closed so you can cancel if this was unintended.

2) The record of all the editing operations you applied to the original image is destroyed, and any script file associated with the original image is deleted. The script file is deleted since it would no longer be valid because the original file to which all the operations are applied is overwritten by the modified file. If you want to save a record of the operations, use one of the regular File Save commands instead, and save the modified image with a different name from the original.

 

Tips

To check beforehand which images will be closed by this command, click on the original image with dependency color coding turned on. This highlights all images that depend on the original image with a dark green caption background in the image browser.

 

Example:

In this example, a sequence of three images starting with the original file AZALEA1.tif is collapsed into a single image that contains the results of applying two transformations to the original image (Auto Range and Levels and Color). The image produced by the current transformation at the time Collapse was selected (Levels and Color) replaces the original file.

 

Before Collapse                             After Collapse