Digital manipulation of images is becoming more commonplace. A user may load an image file containing an original image and modify the image. The user may save the modified image in a different file than the file containing the original image. A modified image file is defined as an image file containing original image data that has been changed, reduced, augmented, or otherwise manipulated. The user may display, copy, move, rename, send or print the modified image. Some programs allow a user to load the original image file and the modified image file, and then display or print the images side-by-side. This allows a user to show a copy of the image before and after the modification. Unfortunately, these programs don't save the two images into a single image file; they keep the two images in the two original files, the original image file and the modified image file.
At some future date, the user may wish to access the original or source image of the modified image. Finding the original source image for a modified image may be difficult. The name of the original image file may not be related to the name of the modified image file. The original and modified image files may not be in the same sub-directory, or on the same memory device. Some programs may link the two files using a history of editing commands or storing information in the metadata of the modified image file. Unfortunately, these links can be broken if one or both of the files are moved, renamed or otherwise changed.
At steps 102 and 104, the image files may be selected using any number of user interface methods, for example a text box, a drag-and-drop metaphor, a clickable version of the image, or the like. The order in which the image files are selected is unimportant; the original or source image may be selected first or last.
In one example embodiment of the invention, the selection of the files may be automated. As an example, an editing program may save a modified image file using a naming schema that indicates the relationship between the original file and the modified file. Once one of the images files is selected, the other related image files can be found and selected automatically using the naming schema. The automated selection process may use other information that identifies the related files, for example meta-data. A user may select the automatic selection method using any user interface device, for example a tool labeled “combine all related images”.
Image files are created in a number of different formats, including, for example, Portable Document Format (PDF), Tagged Image File Format (TIFF or TIF), a binary image format (BIN), Windows Bitmap (BMP), Joint Photographic Experts Group (JPEG or JPG), or the like. Each type of image file may have a number of different data fields and may use a different order for storing the data, but most image file types have a number of common fields. Typically, each type of image file contains at least the width and height of the image, the image data type (for example, 24-bit color or 8-bit grayscale), the resolution of the image and the image data. The image data may be stored as one or more rows of pixels, where each pixel is a 24-bit value that represents the colors of that pixel (for example, the red, green and blue values of the pixel). In another implementation, the image data may be stored as color planes, with the red data for all of the pixels stored in a first plane, the green pixel data stored in a second plane, and the blue pixel data stored in a third plane.
At step 106, the image orientation is selected. In one example embodiment of the invention, the orientation between the two images defaults to a predefined orientation, such as side-by-side (See
Once the orientation between the two images has been determined, the image data is loaded into memory from the two image files, and the images are shown on the display screen. In another example embodiment of the invention, the orientation between the images may be adjusted after the images are displayed, such as by way of a drag-and-drop metaphor.
Memory is defined as the memory allocated or controlled by the program or tool that is implementing an embodiment of the current invention. In one example embodiment, the image data loaded into memory from the two image files is held in memory using an internal data format. In one implementation, the internal data format may be optimized to facilitate display or manipulation of the image. In another example embodiment of the current invention, the image data is held in memory using a standard image format, such as JPEG or any other format described herein.
Many image file formats require the stored image to be rectangular or square in shape. Some image file types may allow non-rectangular shapes to be stored. The file formats that allow non-rectangular shapes are typically more complex than other image file formats. In one example embodiment of the invention, the image shape for the combined image may be required to have a rectangular or square shape. In another example embodiment of the invention, the combined image may be allowed to be non-rectangular in shape.
When combining two images of different sizes, one or both of the images may be modified to create a final image having a rectangular shape. An image can be resized by resealing, padding, cropping or the like. In one example embodiment of the invention, if one image is a different size than the other image, one of the images may be resealed such that the heights or widths of the two images are the same. Resizing images is well-known in the arts.
Once the two images are the same size, either through resealing, padding or cropping, the images can be combined into a single square or rectangular image. The complexity of combining the two images into a single image may depend on how the two images are currently stored in memory. If both images are already stored in memory using a common format, for example an internal format, creating a single image may be as simple as calculating a new height and width for the total image and then combining the image data into a common memory location. To combine the image data into a common location the top row of the first image is read from its current location and written to the new location, the top row of the second image is read from its current location and written to the new location immediately after the first row from the first image. This is continued until all the rows from both images have been written into the new location. This assumes that the image data is stored in memory by rows. Other orders for combining the image data would be used for other data formats.
If the two images are currently stored in memory with different formats, combining the images may first require translating the two images into a common format. This translation may involve realigning image data from three color planes into equivalent pixel data, translating color data into grayscale data, or the like. Once both images are in a common data format, the images can be combined into a single image. When combining unequally sized images into a single non-rectangular image, the smaller image may be centered with respect to the larger image, or aligned with an edge of the larger image.
When saving the combined image at step 110, an image type needs to be selected. In one example embodiment of the invention, if the original image and the modified image have the same file type, the combined image may automatically be saved using the common image file type. If the two images are stored using different file types, the user may be prompted to select a file type for the combined file, or a default file type may be used, for example the file type of the modified image. In another example embodiment of the invention, the user may choose the file type for the combined image file.
The allowable image shape of the combined image may be determined by the type of image file used to store the combined image. In one example embodiment of the invention, the file type for the combined image may be determined before the two images are combined. In another example embodiment of the invention, the file types available for storing the combined image may be restricted depending on the shape of the combined image. For example, when the combined image is square or rectangular in shape, all the file types will be available and when the combined image is not square or rectangular, only those file types that can store a non-rectangular image will be available.
Steps 108 and 110 may be combined into a single operation. In this case, the individual image data from the two images may be combined as the data is stored onto the memory device as a single image file. A memory device is any non-volatile device that can hold data and includes, for example, magnetic disk storage, optical disk storage (such as DVDs), memory sticks, molecular storage, and the like.
In another example embodiment of the invention, multiple modified images may be combined with an original image and saved into a single image file. Some users may make multiple changes to an image and save a copy of the image after each step in the modification process. A composite image with the fully modified image (214) in the center and the progressively modified images arranged around the edge of the fully modified image may be desired (See
When combining multiple images into a single image, all the images do not need to be the same size to create a combined image having a rectangular or square shape. One image, for example the fully modified image 218, may be larger with smaller images wrapped around the perimeter of the larger image (see
In one example embodiment of the invention, a standalone software program may be used to combine the original image file and the modified image file into a single image file. In another example embodiment of the invention, combining the original image file and the modified image file into a single image file may be done as one of many optional functions or tools of a larger software or firmware program, such as an image editing software program. A user may activate the combinational function using a user interface device, for example an icon or a menu item. The software or firmware used to implement this invention may run on any type of computer, microprocessor, or processor system, for example inside a digital camera.