Method and device for image manipulation

Abstract: An image processing system and a method for manipulating images in an image processing system where each image in the system is subdivided into a plurality of sub-images which are processed independently of one another. Control of each image and sub-image is maintained by means of a view state word or table so that only those portions of an image which are being actively processed require modification of their view state. The images stored in the system are maintained in a secondary store and only portions of the image are available for manipulation at any one time in a primary store. Manipulation of sub-images is determined by a modified Least Recently Used algorithm which minimises data swaps between the primary and secondary stores.

Description: The invention relates to improvements in image processing intended to provide for efficient processing of large digital images where the image storage requirements exceed the capacity of the memory of the processor on which the image data is being processed or in which the addressing capability of the processor is inadequate to handle the image data or both. The invention is useful for rotating, reflecting, inverting, scaling and copying of digital images. It is also useful for pattern filling and graphical annotating. The known image processing systems capable of performing useful processing of an image have traditionally required large amounts of memory. It has been generally accepted that to use a personal computer for such image processing would be impractical except for very specific applications. One attempt to use a personal computer for image processing was provided by the IBM* Personal Computer Image Processing System (PCIPS) which was announced May 7, 1985, as IBM Program Number 6466996. The authors of that program readily acknowledged that it could not do all things one would like to do with images. This restrictive use was necessary because, to use the program, it was necessary to load the entire image being processed into the primary storage of the computer. It was therefore not possible to work interactively between two images except by masking of one area over another. It was also not possible to process only a portion of the image without operating on the whole image to retain the image changes. Images have often been subdivided into sub-images for processing. Usually these sub-images were horizontal or vertical strips of single unit width, however, there have been a few attempts at developing sub-images having a larger second dimension. Some of these attempts are described in articles by Antonsson et al entitled "PICAP - A System Approach to Image Processing", IEEE Transactions on Computers, Vol C-31, No 10, October 1982, pp 997-1000, by Hashihara et al entitled "Image Rotation Method Under Virtual Image Management ", in IBM Technical Disclosure Bulletin, Vol 29, No 1, June 1986, pp 449-452, by Wada entitled " A Virtual memory System for Picture Processing", Computing Practices, Communications of the ACM, Vol 27, No 5, May 1984, pp. 444-454, and in US Patent Numbers 3,938,102, 3,995,253, 3,996,559 and 4,090,174 all assigned to International Business Machines Corporation. Although each of these articles and patents describes an image processing arrangement wherein the image may be processed in rectangular arrays, none provides the advantages of the present invention wherein a significant amount of image processing time is saved by not performing processing operations on portions of the image which may not be required. None of the prior art describes a system in which only portions of the image are processed. When an image processing operation such as, for example, image rotation, is initiated in the prior art, the entire image is rotated, whereas in accordance with the present invention, only the sub-images of the image containing portions of the image to be actually viewed in the rotated state will be rotated. Any sub-images containing only portions of the image which are not to be viewed in the rotated state will not be addressed in storage at all. It is the intention of the invention to provide a fast image processing system, ideally having minimal data storage requirements and in which data transfer operations are maintained at a minimal level and at a minimal cost. The invention is set out in claims 1 and 6. One embodiment of the invention disclosed hereinafter includes a microprocessor controlled system having a display device, a primary store for storing portions of images and a secondary or back-up store for storing complete images. In operation, desired images are stored by loading them into the primary store in pieces as sub-image portions. Each sub-image portion represents a predetermined rectangular portion of the image. The status of each sub-image portion is maintained in a status table. The sub-image portions are transferred to the secondary storage area to enable subsequently received portions to be stored in primary storage. When display of an image is required, the sub-image portions are accessed in accordance with a memory management algorithm. This algorithm is provided with the identity of the image to be accessed, the identity of the sub-image portions of the image to be viewed and the status of the image and each sub-image within the image. It should be noted that the status of the overall image may differ from the status of sub-image portions if the image has been subject to an earlier image processing operation. With the identity and status information, the algorithm is then used to access the required portions of the image. The actual sub-image portions are accessed and provided to the display device in accordance with their accessibility. For example, those sub-images which are located in the primary storage would be provided to the display device before the sub-image portions which must be retrieved from secondary storage. Many other factors influence the sequence of accessing of the sub-image portions as will become more evident from the description hereinafter. The present invention will be described further by way of example with reference to embodiments thereof as illustrated in the accompanying drawings in which: Figure 1 is a schematic representation of one form of virtual image system; Figure 2a is a schematic representation of an image to be stored and displayed; Figure 2b is a schematic representation of the manner in which the image shown in Figure 2a may be stored; Figure 3 is a system data flow diagram; Figures 4a and 4b are schematic diagrams which illustrate an example of the image handling characteristics; and Figures 5a and 5b are schematic representations of the steps of processing an image. The invention is part of an image processing system. As shown in Figure 1, the system consists of a processor with main memory, a disk, a display, a printer, and a scanner. Images are captured by the scanner, filed on the disk, presented on the display and printer, and processed in main memory. Main memory is normally subdivided into display memory, input/output buffers for the printer, scanner and disk, and blocks for images. The portion of main memory devoted to image blocks will be referred to as primary storage. The disk is used for long term storage of image files. It is also used as temporary working storage for image processing. During the course of image processing primary storage blocks are moved between main memory and disk. The portion of disk used for image blocks will be referred to as secondary storage. Images can be read into main memory from the scanner or disk. Images can be written from main memory to the printer or disk. Images can also be moved within main memory, for example, from a buffer to display memory. Since the size of an image is typically very large in comparison to the amount of available main memory, an efficient memory management scheme is needed in order to perform image processing functions. Functions such as scanning, printing and filing on disk require only sequential access of images. For example, images are scanned from left to right and top to bottom, that is, the image is divided in a sequence of horizontal scan lines. Each scan line is recorded from left to right. When a scan line is completed, the next scan line below it is started. The characteristic feature of sequential access is that each bit of information in the image is processed precisely once and in a definite order. On the other hand, functions such as viewing and editing require random access in order to be performed efficiently. For example, a display may only be capable of presenting a portion of an image at a given magnification. In order to view the complete image, the user must scroll it. This requires both left/right and up/down movement of the visible portion. Also, editing operations can result in any portion of the image content being modified. If the image could only be accessed sequentially, then operations that required access to a previously accessed scan line would cause the image to be rewound. That is, the image would have to be reaccessed from its start and processed to the scan line that the view or edit operation required. If the required scan line was near the top of the image, little overhead would be entailed. However, if the required scan line was near the bottom of the document, almost all of the document would have to be processed. On average, half the document would have to be processed for every view or edit operation. In order to reduce the amount of processing required for view and edit operations, a random access method must be used. The characteristic feature of random access is that portions of the image can be accessed independently. The present invention provides a random access method that permits a class of viewing and editing functions to be performed efficiently in a system that has limited main memory. The viewing functions for which the invention is particularly useful are magnification and reduction, shape change, colour inversion, and orientation change of an image. Magnification and reduction are necessary for two main reasons. Firstly, the resolutions of the scanner, printer and display may differ. Therefore, in order to view or print an image at actual size it may have to be magnified or reduced. Secondly, it may be useful to magnify or reduce the actual size of the image in a variety of applications, such as editing and page composition. For example, fine editing is done more easily on a magnified view of the image. Also, an image may have to be reduced in order to fit a predefined space on a page. Shape change is necessary since the aspect ratios of the scanner, printer and display may differ. The aspect ratio must be corrected in order to view the image in correct proportion. For example, if the aspect ratio is not corrected, circles will appear as ellipses. Colour inversion is required in order to correct for different photometric interpretations. For example, a scanner may interpret black as 1 and white as 0, while a display may have the opposite interpretation. Also, certain editing operations may be easier to perform if the colour of the image is inverted. This may be due to a combination of display hardware characteristics and human psychology. Orientation change is required in order to view images whose orientation differs from the display. For example, an image with landscape orientation must be scanned in a rotated orientation in order for the paper to fit in the scanner. In order for it to be viewed in normal orientation its orientation must be rotated. Also, images may be inadvertently scanned upside down. Changing their viewing orientation permits them to be viewed in normal orientation. The editing operations for which the invention is particularly useful include scaling, orientation change, colour inversion, pattern filling, copying, moving, merging, and graphical and textual annotation. Scaling permits the shape and size of an image to be changed. Orientation change permits the image to be rotated by multiples of ninety degrees and flipped over a vertical or horizontal axis. Colour inversion permits black and white to be interchanged. Pattern filling permits an area to be wallpapered with a repeating pattern. Copying, moving and merging permit a portion of one image to be extracted and combined with either the original image or a second image. In copying, a portion of an image is duplicated, while in moving, the source of the image is erased. In merging, two images are combined using a specified mixing rule. The supported mixing rules are replacement and the logical operations of conjunction, disjunction and exclusion. These permit special effects such as superimposition. Graphical annotation permits lines, curves, polygons, and closed shapes to be drawn on an image using a pen with a specified width and colour. Textual annotation permits text to be placed on the image. The random access method invented to efficiently perform the above viewing and editing operations is based on the concept of a virtual image. This concept is an extension of the concept of virtual memory that is used in mainframe computer systems such as the IBM System/370 Data Processing System. A virtual image is a data structure used to represent an image. It consists of a two-dimensional array of rectangular sub-images. The collection of sub-images fit together to form the complete image. Since the image will typically be larger than the amount of available main memory, the virtual image is stored in both primary and secondary storage. The sub-images occupy image blocks which may be in primary or secondary storage. The image block is the basic unit of storage and is analogous to the concept of memory page used in virtual memory systems. Image blocks are swapped between primary and secondary storage on a demand basis. The swapping process is managed by a set of heuristics which are designed to perform the supported viewing and editing operations in the most efficient manner possible. The heuristics are an extension of a least recently used (LRU) algorithm. A main technique used by the system is to partition each large image into a two-dimensional array of sub-images. In order to apply an operation to a large image, a set of partial operations is applied to its corresponding array of sub-images. The size of the sub-images is chosen so that individually they may fit into primary storage, although collectively they may not. The system moves the sub-images into and out of primary storage as required by the operation being performed. The system in which the advantages of the present invention are most useful is a system which includes, as a minimum, primary and secondary storage, a display device and a central processor. The system is provided with a virtual image manager for controlling accesses to memory. The publication "Introduction to Virtual Storage in System/370", SR2O-4260-1 published by International Business Machines Corporation describes how such a virtual storage system may be organised. The concepts described therein may be used to organise the memory to handle image information under control of a virtual image manager. The system is also provided with a primary storage manager and a secondary storage manager. The virtual image manager permits the image processing application program to define and process large digital images. The virtual image manager enables the large digital image to be represented as a set of component small images or sub-images which have mutually disjoint domains and which, together, equal the full domain of the large image. This arrangement enables image processing operations to be applied independently to each of the sub-images of the large image in any arbitrary order. This ability to process each sub-image independently of any other sub-image enables fast and efficient processing of images. The primary storage manager communicates with the virtual image manager and the secondary storage manager. The primary storage manager maintains a region of memory for storing a set of sub-images. The storage region must be large enough to store the minimum number of sub-images which must be simultaneously accessed in order to perform any of the supported operations. For example, in order to copy one large image to another, it is necessary to access two sub-images simultaneously. The primary storage manager also saves sub-images into secondary storage from primary storage and fetches sub-images from secondary storage to primary storage. The primary storage manager also retains the state information for each sub-image to indicate how recently the sub-image was accessed and whether it has been modified since it was last saved to secondary storage. In operation, when the virtual image manager receives a request to perform an operation on a large image, the virtual image manager generates a list of the sub-images of the large image that must be accessed. The list is provided to the primary storage manager which then determines the order in which the individual sub-images are to be accessed in accordance with a modified form of the least recently used (LRU) algorithm which will be more fully described hereinafter. As each sub-image is accessed, the required modification to the sub-image is performed and the sub-image identity is removed from the list of sub-images. The secondary storage manager is responsible for saving sub-images from primary storage and restoring them to primary storage as required. Preferably, the secondary storage manager maintains a region of memory which holds the sub-images in a substantially compressed form. This will be referred to hereinafter as the disk cache. The operations supported by the system have the property that they are independent of the order in which their corresponding partial operations are applied. If an operation is decomposed into n partial operations, there are n!=n(n-1)(n-2)...3·2·1 possible orders in which they can be applied. For each order, there is a certain range of processing times. This range of times depends on the state of the system, and on the memory management algorithm. The order of partial operations dictates the order in which sub-images are processed, which in turn may cause them to be moved into memory. However, if there is no free space in memory, another sub-image must first be moved out. This is determined by a memory management algorithm. If there is room for m sub-images in primary memory, then each time a sub-image is processed, there will in general be a choice of m possible sub-images to move out. Since this must be done n times to complete the operation, there is a total of nm distinct sequences of operations. Therefore, there is a total of N = nm·n! possible ways in which the operation can be executed. Each possible sequence has a definite processing time associated with it. Therefore, given an operation and the current state of the system, there will be a sequence of actions that minimises the execution time. However, since N will in general be a very large number, it is not practical to find the sequence that minimises the time. Instead, a set of heuristics is used. The heuristics are an extension of the Least Recently Used (LRU) algorithm. Although they do not guarantee the minimum time solution, they are a significant improvement over the unmodified LRU algorithm. In particular, thrashing is largely eliminated. Another main technique used by the system is to defer the application of certain operations until the results are actually needed. In particular, this approach is used for sixteen view state transformations of bilevel images. These transformations consist of geometric transformations induced by the eight symmetries of the square each with an optional black to white colour inversion. They form a mathematical group. This means that any view state can be reached from any other view state by applying a suitable transformation. Each sub-image is allowed to have an independent view state. When the view state of a large image is changed, its sub-images are unaffected until they are required by another operation. When they are moved into memory, the memory manager compares their view state to that of their large image. If they differ, an appropriate transformation is applied at that time, and their view state is updated. View state transformations are typically used when displaying images. For example, a document may have been scanned upside down. With the above approach, if such a document is rotated by 180° only those sub-images that are actually visible need to be transformed in order to refresh the display. Also, there is no global rearrangement of the sub-images. That is, each sub-image can be transformed locally and independently of the others. This approach differs from that commonly used in other systems where the large image is partitioned into horizontal strips, and there is no concept of view state of the large image. For example, suppose a square is divided into k horizontal strips, and it is rotated by 90°. Then each horizontal strip of the rotated square depends on all the strips of the unrotated square. This means that each strip must be accessed k times, so the amount of data movement is proportional to k². On the other hand, if the square is divided into k sub-images and each is rotated independently, the amount of data movement is proportional to k. For the purposes of understanding, the description is directed to bilevel images, although much of what follows could apply equally to gray and colour images. The set of integers is denoted Z = {....,-2,-1,0,1,2,....}. For a, b ε Z define the interval[a,b] = {x ε Z|a ≦ x ≦ b}. If A and B are sets, their cartesian product is denoted A x B = {(a,b) | a ε A, b ε B}. Let Z² = Z X Z ={ (x,y)|x,y ε Z} denote the integer plane. A rectangle is a subset of Z² that is equal to the product of two intervals. Let Rect denote the set of all rectangles. Rect = {[a,b] X [c,d]|a,b,c,d, ε Z}. Let Bit = {0,1}. An image is a function whose domain is a rectangle and whose codomain is Bit. Let Image denote the set of all images. Image = {f ε Map(R,Bit)|R ε Rect}, where Map(A,B) denotes the set of all functions from A to B and a function f ε Map(A,B) has domain A and codomain B. An image transformation is a function that maps images to images. Let ImgTrans denote the set of all image transformations. ImgTrans = Map(Image,Image). We are mainly concerned with two types of image transformations that we will refer to as local and view state transformations. Local transformations arise frequently in image editing operations. For example, graphical annotation and copying or merging with a given source image are local transformations. On the other hand, operations such as seed fill or spatial filtering are not local. View state transformations arise when the orientation or colour of an image is changed. A local transformation is an image transformation that preserves domains and has the property that the value of the transformed image at a point only depends on the values of the untransformed image and the transformation at that point. If L is a local transformation then for all p ε Z², there exists L p ε Map(Bit,Bit) such that for all f ε Image with p ε domain(f), (Lf) (p) = L p (f(p)). LocalTrans ≃ Map (Z²,Map(Bit,Bit)). We will refer to the four elements of Map(Bit,Bit) as follows: The support of a local transformation L is the set of all points where it differs from nop, support(L) = {p ε Z²|L p } ≠ nop}. Linear transformations of the integer plane that consist of scalings and translations define image transformations as follows. Let Q denote the set of rational numbers. For q ε Q let [q] denote the largest integer that does not exceed q. [q] = max n: (q≧n ε Z) For a,b,c,d, ε Q, a,c, > 0, define T ε Map(Z²,Z²) by T(x,y) = ([ax + b], [cy + d]). For X a subset of Z², define T⁻¹(X) = {p ε Z²|T(p) ε X}. T is a linear transformation that combines scaling and translation. Let LinearTrans denote the set of all such linear transformations. For T ε LinearTrans, f ε Image define scale (T) (f) ε Image by scale(T) (f) (p) = f(T(p)), p ε T⁻¹(domain(f)). Clipping by rectangles define image transformations as follows. For r ε Rect, f ε Image define clip (r) (f) ε Image by clip(r) (f) (p) = f(p), p ε r ∩ domain (f). An image can be merged into another image using a mixing function. This defines local image transformations as follows: For m ε Map(Bit X Bit,Bit), f,g, ε Image, define mix(m,f) (g) ε Image by The general copy function is composed of a combination of scaling, clipping, and mixing. For T ε LinearTrans, r ε Rect, m ε MixFunction, and f ε Image, the copy transformation is defined as follows. copy(m,r,T,f) = mix(m,clip(r)(scale(T)(f))). so that copy (m,r,T,f,) defines a local transformation. Let CopyFunction denote the set of all operations c ε Map(Image X Image, Image) that are of the form c(f,g) = copy(m,r,T,f) (g). There are sixteen view state transformations. They consist of arbitrary combinations of rotations by right angles, vertical and horizontal reflections and colour inversions. The basic view state transformations are Invert, Rotate, and Flip, and are defined as follows. Let g be an image with domain [a,b] X [c,d]. Define the geometric transformations rotate,flip ε Map(Z²,Z²) by, rotate(x,y) = (-y,x), flip(x,y) = (x,-y). Then the view state transformations are, Invert (g)(p) = not(g(p)),p ε [a,b] X [c,d], Rotate(g)(p)=g(rotate⁻¹(p)),p ε [-d,-c] X [a,b], Flip(g)(p)=g(flip⁻¹(p)),p ε [a,b] X [-d,-c]. The view state transformation Invert is also a local transformation, Invert p = not, for all p ε Z². Let I denote the identity transformation, for all f ε Image,I(f) = f. The basic view state transformations satisfy the following relations: Using the above relations, any combination of the basic view state transformation can be reduced to one of the following sixteen: ViewTrans = {Invert a · Rotate b · Flip c |0 ≦ a < 2,0 ≦ b < 4, 0 ≦ c < 2}. A view state transformation v can also be expressed in the form v(f) = m · f · g⁻¹,m = not a ,g= rotate b · flip c , for all f ε Image. We denote this by writing v ≃ (m,g). Virtual images will be described as an abstract data type. A data model and a set of operations defined in terms of it are described. The design consists of a representation of the data model and an implementation of the operations in terms of the representation. A virtual image is a restricted form of image. The data models are conceptually the same, but only a subset of image operations can be performed on virtual images. Restricting the set of operations makes it possible to design a data representation in which the operations can be implemented efficiently. The virtual image data type is modelled on the image data type. *:VirtualImage → Image f → f*. When a virtual image is allocated its initial value is set to be the empty image, that is, the image whose domain is the empty set. The main restriction on virtual image operations is that only the view state and local transformations can be used to update virtual images. The locality restriction is imposed so that when transformations and functions are computed, the data elements of the virtual image can be processed independently and in an arbitrary order. Any virtual image can be set to equal an image with a given domain and filled with zeroes. For r ε Rect, define zero r ε Image by zero r (p) = 0, for all p ε r. For v ε VirtualImage, define Clear(r,v): v → v′, v′* = zero r . Any view state transformation can be applied to a virtual image. For t ε ViewTrans, v ε VirtualImage, define ViewTransform(t,v): v → v′, v′* = t(v*). Any local transformation can be applied to a virtual image. For t ε LocalTrans, v ε VirtualImage, define LocalTransform(t,v): v → v′, v′* = t(v*). Part of a virtual image can be copied to another virtual image. For c ε CopyFunction, v ε VirtualImage, w ε Image, define ExternalCopy(c,v,w): w → w′, w′ = c(v*,w). Part of a virtual image can be copied to another virtual image. For c ┴ CopyFunction, v,w, ε Virtual Image, define InternalCopy (c,v,w): w → w′, w′* = c(v*,w*). In order to implement the preceding virtual image operations, each image is represented as an array of sub-images. Moreover, in order to make the most efficient use of available memory, it is necessary to consider the set of virtual images as a unit, rather than individually. It is assumed that there is a limited quantity of primary storage where operations can be performed on the sub-images, and an unlimited quantity of secondary storage where sub-images can be stored and fetched. During the course of an operation on one virtual image, the contents of primary and secondary storage will change, thus affecting the state of the variables that represent all virtual images. Let A and B be sets. Let Table(A,B) be the set of all functions with domain X a subset of A and codomain B. Table(A,B) = {Map (X,B)|X a subset of A}. Virtual images will be represented as entries in a virtual image α Table(Z,VirtualImage). The table α will be treated as a state variable that is accessed only by operations on the VirtualImage data type. A virtual image f = (d,v,e,t,s) ε VirtualImage consists of the following components: 1. A domain rectangle d ε Rect. 2. A view state v ε ViewTrans. 3. An elementary rectangle e ε Rect. 4. A primary storage table t ε Table(Z,PrimaryBlock). 5. A secondary storage table s ε Table(Z,SecondaryBlock). The domain rectangle defines the domain of the virtual image. The view state represents the cumulative affect of all view state transformations that have been applied to the virtual image. These transformations are not applied to its sub-images until they are accessed. The elementary rectangle defines how the virtual image is partitioned into sub-images. The primary and secondary storage tables contain the sub-images that are in primary and secondary storage respectively. This data structure is illustrated in Figure 2. As shown in Figure 2a the image is represented by a pel or pixel size which is 200 pixels wide by 150 pixels high. In this example, the image is subdivided into six sub-images, each of which is 100 pixels wide and 50 pixels high. The six sub-images are defined as ij = 00 through 12. In the representation shown in Figure 2b, sub-images 02 and 12 have been stored in primary storage and sub-images 00, 10, 01 and 11 are stored in secondary storage. In the normal operation of the processing system, a copy of sub-images 02 and 12 would also exist in secondary storage although the sub-images stored in secondary storage may differ from the corresponding sub-images stored in primary storage if any alteration has been performed on the image during processing. A table is associated with each image and sub-image. As indicated in Figure 2b, the table for the image and each sub-image shown illustrates a view state of I meaning that all image information is currently stored in the same view state. The table for sub-image 02 indicates an access value of a = 2 and a change value of u = 1. This indicates that sub-image 02 was accessed less recently than sub-image 12 and, therefore, would be restored to secondary storage before sub-image 12 if all other indicators were equal. As the change value u = 1 for both sub-images, it would be necessary to restore the sub-images to secondary storage if a copy already existed there since the sub-images have been altered. Let e = [x₁,x₂]X[y₁,y₂]. Its width is w = x₂-x₁+1 and its height is h = y₂ - y₁+1. The integer plane can be tiled by translating e by multiples of the displacement vector (w,h). For (i,j) ε Z, define e ij = [x₁ + iw,x₂ + iw] X [y₁ + jh,y₂ + jh]. These rectangles are mutually disjoint and cover the entire integer plane. For p ε Z, define block(e,p) = (i,j) if p ε e ij . A primary storage block b = (f,v,a,u) ε PrimaryBlock consists of the following components: 1. An image f ε Image. 2. A view state v ε ViewTrans. 3. An access count a ε Z. 4. An update flag u ε Bit. The image is a sub-image of a virtual image. The view state is the cumulative affect of all view state transformations that have been applied to the image. The access count of each primary storage block is used to determine how recently it has been accessed. The access count is either zero or positive. If it is zero, the block is the to be accessed and will not be swapped out to secondary storage. If it is positive, the block is the to be released, and may be swapped out. The greater the access count, the less recently the block has been accessed. Whenever a block is accessed, its access count is reset to zero, and the access counts of all released blocks are incremented by one. The update flag indicates whether the block has been modified. It is also used to control swapping. In practice, primary storage blocks are allocated in main memory. A secondary storage block b = (f,v) ε SecondaryBlock consists of the following components: 1. An image f ε Image. 2. A view state v ε ViewTrans. The image is a sub-image of a virtual image. The view state is the cumulative affect of all view state transformations that have been applied to the image. Although it is possible to allocate secondary storage blocks directly on disk, a more complex design is preferred. Since processing image information involves very large quantities of data, a two part secondary storage scheme is preferred. In order to store a primary storage block to secondary storage, it is first compressed and moved to a disk cache. When the disk cache gets full, the least recently used block is written to disk. In order to fetch a secondary storage block, it is first moved to the disk cache, if necessary, and then decompressed into primary storage. This works well for images such as scanned text that have a high compression ratio. It is not so advantageous when used on scanned photographic images because they have a much lower compression ratio. In this case, the use of compression reduces system performance. Let k ε domain (α) be the index of a virtual image and let α(k) = f =(d,v,e,t,s). Let the view state v ≃ (m,g). The domain of f is d which is partitioned into sub-images defined by the elementary rectangles g(e ij ). These sub-images are contained in the primary and secondary tables, but they each possess an independent view state. The domains of these images must agree with those defined by the elementary rectangle. For the primary storage table we have, for all (i,j) ε domain(t) with t(i,j) = (f ij , v ij , a ij , u ij ), domain(v -1 ij (f ij )) = g⁻¹(d)∩e ij . Similarly, for the secondary storage table we have, for all (i,j) ε domain(s) with s(i,j) = (f ij ,v ij ), domain(v -1 ij (f ij )) = g⁻¹(d)∩e ij . These constraints state that the domains of the sub-images line up with the elementary rectangles when all view state transformations are undone. We assume that the sub-images stored in primary and secondary storage are limited in size. Let MaxArea ε Z denote the maximum area of the sub-images. The areas of the elementary rectangles must not exceed this value. In a practical embodiment, a value of 131072 = 8 X 16384 may be used. This means that the sub-images occupy 16 kilobytes of storage. There is a limited quantity of primary storage available. Let MaxBlocks ε Z denote the maximum number of primary storage blocks available. In practice, this value is determined at run time and depends on the amount of memory allocated to the program. This value must be at least 2 in order to perform the InternalCopy operation, and at least 1 for the other operations. The primary storage blocks are shared between all virtual images. The total number of all primary storage blocks allocated to all virtual images must not exceed MaxBlocks. Image operations can only be applied to sub-images in primary storage. Since primary storage is limited, sub-images are swapped between primary and secondary storage on a demand basis. Therefore, system performance depends on the amount of available primary storage. In order to minimise swapping, a set of heuristics is used. These are derived from a LRU algorithm. A virtual image f = (d,v,e,t,s) with v ≃ (m,g) defines a derived image f* as follows: 1. domain(f*) = d. 2. for all p ε d with block(e,g⁻¹(p)) = (i,j), (a) if (i,j) ε domain (t) with t(i,j) = (f₁,v₁,a₁,u₁) then f*(p) = v(v₁⁻¹(f₁))(p), (b) else if (i,j) ε domain(s) with s(i,j) = (f₂,v₂) then f*(p) = v(v₂⁻¹(f₂))(p), (c) else f*(p) = m(0). This definition states that to compute the value of the image at a point, first determine within which sub-image it lies. If its sub-image is in primary storage, use the value it defines. If its sub-image is in secondary storage use its value. If its sub-image is neither in primary nor secondary storage use the value 0. Also, the values must be adjusted by a view state transformation to make the sub-image agree with the virtual image. To actually access the value, sub-images may have to be swapped between primary and secondary storage. It should be noted here that many different states of a virtual image variable map to the same image. First, each sub-image may be swapped between primary and secondary storage without changing the derived image. Second, each sub-image may be given an arbitrary view state without affecting the derived image. Using the above mapping, a newly declared virtual image may be set to the empty image and initialised to (⊘,I,⊘,⊘,⊘). The programming interface of the virtual image operations uses an index into the virtual image table α in order to identify a virtual image. α is part of the state data of the virtual image data type. It is treated as a global variable that can only be accessed by the virtual image operations. It is not explicitly passed as an argument to the operations but is affected by all of them. The value of α after the operation will be denoted α′. The data flow for these operations is illustrated in Figure 3. As shown in Figure 3, the portion of the image being processed must be available in primary storage. The fetch and store operations enable sub-images to be transferred between secondary storage and primary storage for processing. For r ε Rect, k ε domain(α), Clear(r,k): α → α′ : (α′ (k)* = zero r ). Let α(k) = (d,v,e,t,s). The operation Clear (r,k) is performed as follows: 1. Delete all primary storage blocks in t. 2. Delete all secondary storage blocks in s. 3. Set the virtual image table entry to (r,I,Element(r),⊘,⊘). α′(k) = (r,I, Element (r),⊘,⊘). Clearly, the domain of the derived image is r. Also, since the view state is I and there are no sub-images in primary or secondary storage, the value of the derived image is 0 throughout its domain. Note that the operation of setting the primary and secondary storage tables to be empty frees the storage occupied by the blocks they contained. In the above description we have introduced the Element function. This function computes an appropriate elementary rectangle for a given domain. We assume this function is given. Different choices for this function will lead to different system performance characteristics. Its selection should be based on the expected statistical distribution of image operations. In practice, we use a function appropriate for viewing unrotated images on a display screen whose width is greater than its height. The elementary rectangle is chosen so that its width is 2 to 3 times greater than its height and its area is close to MaxArea. The actual width is selected to minimise wasted space when covering the domain. For w ε ViewTrans, k ε domain(α) ViewTransform(w,f) is ViewTransform (w,k): α → α′, α′ (k)* = w( α(k)*). Let w ≃ (m,g), and α(k) = (d,v,e,t,s,). The operation ViewTransform (w,k) is performed as follows: 1. Set the virtual image table entry to α′(k) = (g(d), w·v,e,t,s). Only the domain and view state of the transformed virtual image are modified. There is no immediate effect on primary or secondary storage. The actual view state transformation is only applied to the sub-images in primary storage when they are accessed. In this case, a suitable view state transformation is applied to the sub-image to make its view state agree with that of the virtual image. For L ε LocalTrans, and k ε domain(α) LocalTransform (L,k): α → α′, α′(k)* = L (α (k)*). Let α(k) = f = (d,v,e,t,s) and v ≃ (m,g). The operation LocalTransform (L,k) is performed as follows: 1. Compute set S of all sub-images of f that are affected by L. S = {(i,j)|domain(f)∩support (L)∩g(e ij ) ≠ ⊘}. 2. While the S is non-empty: (a) Find the sub-image (i,j) ε S that can be fetched at least cost. (b) Fetch it into primary storage. Let t(i,j) = (f ij , v ij , a ij , u ij ). Note that the fetch operation results in the view state of the sub-image agreeing with that of the virtual image. v ij = v. (c) Access it for writing. i. Set its update flag to 1. u ij → 1. ii. Set its access count to 0. a ij → 0. iii. Increment the access counts of all released primary storage blocks. for all k′ ε domain(α),α(k′) = (d′,v′, e′, t′, s′), for all (i′, j′) ε domain(t′), t′(i′,j′) = (f″,v″ ,a″ ,u″), if a″ > 0 then a″ → a″ + 1. (d) Apply L to it. f ij → L(f ij ). Since L is local it can be applied independently to each sub-image of the virtual image. (e) Release it. i. Set its access count to 1. a ij → 1. (f) Delete it from the set S. S → S - {(i,j)}. To find the sub-image in S with the least fetch cost, use the following criteria: 1. Sub-images in primary storage that have their update flag set are least costly to access. This rule saves processing in the case that a primary storage block has to be swapped to secondary storage as a side effect of accessing another image. If updated blocks are accessed first, those that have not been updated can be swapped out more cheaply since there is no need to refresh their copies in secondary storage. 2. Sub-images in primary storage that have their update flag clear are selected as being the next least costly. 3. Sub-images that are not in primary storage, but are in secondary storage are considered the next least costly. 4. Sub-images that are neither in primary nor secondary storage are considered the most expensive to fetch. To fetch a sub-image into primary storage, the following operations are undertaken. 1. If the sub-image is not in primary storage: (a) If the number of allocated primary storage blocks is equal to MaxBlocks: i. Find the primary storage block with the least expensive store cost. ii. Store it in secondary storage. (b) Allocate a primary storage block for the sub-image. Let t(i,j) = (f₁,v₁,a₁,u₁). (c) Set the access count to 1. a₁ → 1. (d) Set the update flag to 0. u₁ → 0. (e) If the sub-image is in secondary storage: i. Then copy the sub-image and view state from secondary storage to primary storage. Let s(i,j) = (f₂,v₂). f₁ → f₂, v₁ → v₂. ii. Otherwise create a blank sub-image in the same view state as the virtual image. Let r = g⁻¹(d)∩e ij . f₁ → v(zero r ), v₁ → v. If the view state of the sub-image differs from the virtual image v₁ ≠ v: (a) Transform the sub-image to agree with the virtual image. f₁ → v(v₁⁻¹(f₁)) = (v · v₁ ⁻¹)(f₁). (b) Update the view state. v₁ → v. To store a primary storage block, t(i,j) = (f₁,v₁,a₁,u₁), in secondary storage, do the following: 1. If the update flag has been set,u₁ = 1, or the sub-image in secondary storage, s(i,j) = (f₂,v₂), has a different view state, v₁ ≠ v₂, (a) Then allocate the secondary storage block if it does not already exist and copy the view state and sub-image to secondary storage. f₂ → f₁, v₂ → v₁. 2. Delete the block from primary storage. To find the least costly primary storage block to store, the blocks may be sorted according to the following criteria: 1. The primary criterion is whether the block contains a sub-image in set S. Sub-images not in S are less costly to swap out than those in S. It is more expensive to swap out a sub-image in S because we know that we will eventually have to swap it in again in order to complete the operation. 2. The second criterion is whether the block has been updated. It is more expensive to swap out an updated block because we will have to update secondary storage. If the block has not been updated, there is no need to update secondary storage. However, this rule would lead to updated blocks accumulating in primary storage. To prevent this a value MaxCount ε Z is chosen. If the access count exceeds this value, the block should be stored in preference to blocks that have not been updated. For example, the user may edit a region then view its neighbourhood. Initially, the edited blocks will be retained in primary storage. Eventually their access counts will exceed MaxCount and they will be stored to secondary storage, leaving more primary storage blocks available for viewing neighbouring sub-images. If MaxBlocks is small, then this criterion should be over-ridden by setting MaxCount to zero. 3. The third criterion is the access count. It is more expensive to swap out a block with a low access count because we are more likely to access it again in the future. This is the basis of the LRU algorithm. This is actually the least significant factor. For example, a user may be editing a small area of an image. The sub-images that are affected by the editing operations should be kept in primary storage in preference to those that are not affected. Since multiple editing operations are likely to affect the small localised set of sub-images, this heuristic improves performance. Note that blocks with an access count of 0 are not eligible to be swapped out since they are in use. For c ε CopyFunction, k ε domain(α), and f ε Image ExternalCopy(c,k,f): α → α′, f → f′, f′ = c(α(k)*,f). The External Copy operation is similar to the local transform operation. The main difference is that the set R is computed as the set of all sub-images that must be accessed to update the destination image. Also, the sub-images are accessed for reading so their update flags are not set. Let α(k) = (d,v,e,t,s,), v ≃ (m,g) and c(h,f) = copy(n,r,T,h,f). The operation ExternalCopy(c,k,f) is performed as follows: 1. Compute the region W of f that is updated by the operation. W = domain(f)∩r∩T⁻¹(d). 2. Compute the set R of all sub-images of α(k) that are required to update f. R = {(i,j)|W∩T⁻¹(g(e ij )) ≠ ⊘}. 3. While R is non-empty: (a) Find the sub-image (i,j) ε R with the least fetch cost. (b) Fetch it into primary storage. Let t(i,j) = (f ij ,v ij ,a ij ,u ij ). Note that the fetch operation results in the view state of the sub-image agreeing with that of the virtual image. v ij = v. (c) Access it for reading. i. Set its access count to 0. a ij → 0. ii. Increment the access counts of all released primary storage blocks. for all k′ ε domain(α),α(k′) = (d′,v′,e′,t′,s′), for all (i′,j′)ε domain(t′),t′(i′,j′) = (f″,v″,a″,u″), if a″ > 0 then a″ → a" + 1. (d) Copy from the sub-image. f → c(f ij ,f). Since the value of the updated destination image at each point only depends on a single point in the source image, the copy operation can be computed by independently accessing sub-images of the source virtual image and copying their values to the destination image. (e) Release it. i. Set its access count to 1. a ij → 1. (f) Delete it from R. R → R - {(i,j)}. For c ε CopyFunction, and k,1 ε domain(α) with k ≠ 1, InternalCopy(c,k,1):α → α′ α′ (1)* = c(α,(k)*,α(1)*). The Internal Copy operation is a combination of the local transformation and the External Copy operations. This is because the operation of copying a given source image onto a destination image is a local transformation of the destination image. The most efficient way to perform this operation is to access each affected sub-image of the destination virtual image only once. Otherwise, if the sub-images of the source virtual image were accessed only once, each would in general partially update several destination sub-images. This would cause secondary storage to be updated more than necessary in the case that the partially updated sub-images had to be stored in order to access additional source sub-images. Most of the details of this operation are the same as above and will not be repeated here. The only different feature is that the criteria for computing the sub-image with the least store cost includes both S and R. Sub-images in S are less costly to store than those in R because they will not be accessed until all sub-images in R have been. 1. Compute the set S of all sub-images of the destination virtual image that will be updated. 2. While S is non-empty: (a) Compute the sub-image in S with the least fetch cost. (b) Compute the set R of all sub-images in the source virtual image that are required to update the selected destination sub-image. (c) Fetch the selected destination sub-image. (d) Access it for writing. (e) While R is non-empty: i. Compute the sub-image in R with the least fetch cost. ii. Fetch it. iii. Access it for reading. iv. Partially update the accessed destination sub-image by copying the accessed source sub-image to it. v. Release the source sub-image. vi. Delete it from R. (f) Release the accessed destination sub-image. (g) Delete it from S. To more readily understand the principles of the present invention, a few examples are described hereinafter. As shown in Figure 4a, an image of a tree is shown schematically on an image field which is subdivided into twenty-five rectangular sub-images 00 to 44. The figure illustrates how the image would be displayed if the entire image was to be projected on a display screen. Each portion of the image is identified by sub-image 00, 01, 02, ... 43, 44. When the image is initially scanned it is loaded into the primary store 110 and transferred to the secondary store 120 in sub-image segments as primary store 110 is filled. In the illustrated example, the primary storage 110 is shown as capable of holding two sub-images. The remaining sub-images are stored in the secondary storage 120 which must be sufficiently large to hold all the image information. This can be achieved at less memory cost by compressing the image information. A satisfactory approach for compressing image data in storage is provided in the CCITT Group 3 Facsimile Machine standard available from that organisation. Any suitable data compression technique could be used, and such techniques are well known to those skilled in the art and will not be further described herein as they are not part of the present invention. However, if the compression approach described in the CCITT Group 3 standard is used, then the compression of image information can vary widely from one sub-image to another depending upon how much the display information varies over the sub-image area. For example, areas 12, 33 and 44, etc., would require very little compressed storage space because the sub-image is unchanged over the entire sub-image area whereas, sub-images 11, 13 and 32, etc., may require substantially more storage space in their compressed state because of variations within each sub-image. In the example, sub-images 00 and 10 are situated in primary storage and the remainder stored in secondary storage. If, for example, one desired to view a portion of the image, say the portion in the area within sub-images 10, 11, 20 and 21, the most efficient or least costly method of accessing those sub-images would be followed. First, an access list would be generated. In this example, the access list equals {10, 11, 20, 21}. The primary storage 110 is then examined to determine whether any of the required sub-images are available. The sub-image 10 is stored in the primary storage 110. Sub-image 10 is then copied to the display screen and deleted from the access list. As no other sub-images on the access list are available in primary storage 110, they must be retrieved from secondary storage 120. However, as primary storage 110 is full, space must be made available by transferring a sub-image from primary storage 110 to secondary storage. In this simple example, sub-image 00 would be transferred to secondary storage as it has not been accessed and is not on the access list. Of course, if sub-image 00 was previously stored and retrieved from secondary storage and has not been changed since it was retrieved, it would not be necessary to perform the store operation as sub-image 00 would still be in the secondary store. In that case, a new sub-image could be written over sub-image 00 in the primary store. As each of sub-images 11, 20 and 21 must be retrieved from secondary store and there are no other indications as to which is more useful or easier to access, they may simply be accessed in sequence. However, each time one is accessed, one of the sub-images in the primary store 110 must be returned to the secondary store 120. In the present example, sub-image 11 would replace sub-image 00 in the primary store 110. Next, sub-image 10 would be returned to secondary storage 120 and replaced in primary storage 110 by sub-image 20. Sub-images 11 and 20 would be furnished to a display generator (not shown). Sub-image 11 would be returned to secondary storage 120 and replaced in primary storage 120 by sub-image 21 which would also be provided to the display generator. In this manner, the four sub-images 10, 11, 20 and 21 are accessed and displayed. The displayed sub-images can then be altered at the display. Of course, to maintain control of the images, it is necessary to provide a status table for each image and sub-image. The image status table identifies the orientation and colour state of the image by bit indicators. Each sub-image table maintains a record of its individual orientation and colour. Whenever a sub-image is to be provided to the display generator for display, a comparison is made between the main image orientation and colour states and the sub-image orientation and colour states. If the comparison fails, the sub-image orientation and/or colour states are changed to conform to those of the main image. In this way, the orientation and/or colour state of each sub-image is only changed if it is required for display when its states do not conform with the main image. With this control arrangement, individual sub-images of a main image may be in several different states in primary and secondary storage but would be displayed in the correct state when required. An example of a main image and a sub-image status table is shown in Figure 2. For example, if one wished to rotate part of image shown within the sub-image set {10, 11, 20, 21, 30, 31} it would not be necessary to rotate other sub-images. In our example, the sub-images 20 and 21 were retained in primary storage after the previous access operation. As both of these sub-images are on our access list for the rotate function, these will be accessed and rotated first. The sub-image tables are updated. After both have been so accessed, another sub-image is sought. As all remaining sub-images are in the same states initially, each of the remaining sub-images would be accessed in any order. For sake of simplicity, assume they are accessed in the order 10, 11, 30 and 31. When the access and rotate operation is complete, the primary storage 110 will retain sub-images 30 and 31 and the sub-image tables will indicate that sub-images 10, 11, 20, 21, 30 and 31 are stored in the rotated state. The remaining sub-images are stored in the original state, and the main image register indicates that the image is in a rotated state. Other functions such as reflecting, inverting, scaling and copying of the image would be processed in a like manner. In order to illustrate the improved operation of my virtual image system, and to compare it with a general purpose virtual memory system, a further simple example will be described in detail. The example will consist of reading an image into memory and then graphically annotating it first, with a circle drawn about its centre and second, with a rectangle also drawn about its centre. The simple image example is shown in Figs. 5a and 5b. As illustrated in Figs. 5a and 5b, the image is subdivided into four sub-image areas and for purposes of illustration two modifications are to be performed to the image area. First circle a is to be drawn in the image field and then rectangle b. For illustrative purposes, let us assume that the primary storage area can store three sub-images and that the image is divided into a two by two array of sub-image blocks. Also assume that the sub-images labelled 2, 3 and 4 in Figs. 5a and 5b were originally retained in primary storage and sub-image 1 was stored in secondary storage during an earlier image read operation. Since primary storage is only capable of holding three sub-image blocks, its state may be represented by a list of three sub-image blocks. The order of block numbers in the list will be from least to most recently used. In the present example, if the sub-images are read from left to right and top to bottom, the original image read operation results in primary storage being in the state (2, 3, 4). Sub-image 1 is in secondary store. Now, let us consider graphically annotating the image with circle a and rectangle b. To do this requires that all four sub-image blocks be modified. First, we will describe how this would be achieved with a general virtual memory system using a least recently used (LRU) algorithm and then describe how the system is improved by using my modified algorithm. In a general virtual memory system, the difference between primary and secondary storage is transparent to the operation being performed. During the course of the operation data is swapped between primary and secondary storage on a demand basis. The LRU algorithm is used to decide which memory page or in the present instance, sub-image block, should be swapped out to secondary storage in order to make room for the demanded page or sub-image block. If we assume the circle a is drawn in a counter-clockwise direction starting at angle zero, the sub-image blocks will be accessed in the order 2, 1, 3, 4. If a normal LRU operation were to be performed, the following steps would be necessary to add the circle a and rectangle b to the image area: Step 1 a) store portion of a in sub-image 2 which is in primary store; b) update access status of 2 to most recently accessed, primary storage is now in access order (3, 4, 2); Step 2 a) swap out sub-image 3 and swap in sub-image 1 into primary store so that sub-image 1 can be updated next; b) store portion of a in sub-image 1; c) update access status of 1 to most recently accessed and 2 to next most recently accessed and 4 to least most recently accessed (4, 2, 1); Step 3 a) swap out sub-image 4 and swap in sub-image 3 so that sub-image 3 can be updated next; b) store portion of a in sub-image 3; c) update access status of 3 to most recently accessed, 1 to next most recently accessed and 2 to least recently accessed (2, 1, 3); Step 4 a) swap out sub-image 2 and swap in sub-image 4 so that sub-image 4 can be updated; b) store portion of a in sub-image 4; c) update access status of 4 to most recently accessed, 3 to next most recently accessed and 1 to least recently accessed (1, 3, 4), the image is now in the LRU initial state shown in Fig. 5b; Step 5 a) swap out sub-image 1 and swap in sub-image 2 so that sub-image 2 can be updated with a portion of rectangle b; b) store portion of b in sub-image 2; c) update access status of 2 to most recently used, 4 to next most recently used and 3 to least recently used (3, 4, 2); Step 6 a) swap out sub-image 3 and swap in sub-image 1 to update sub-image 1; b) store portion of b in sub-image 1; c) update access status of 1 to most recently used, 2 to next most recently used and 4 to least recently used (4, 2, 1); Step 7 a) swap out sub-image 4 and swap in sub-image 3; b) store portion of b in sub-image 3; c) update access status of 3 to most recently used, 1 to next most recently used and 2 to least recently used (2, 1, 3); Step 8 a) swap out sub-image 2 in secondary storage and swap in sub-image 4 from secondary storage; b) store portion of b in sub-image 4; and c) update access status of 4 to most recently used, 3 to next most recently used and 1 to least recently used (1, 3, 4). Using the normal LRU scheme required seven swap operations between primary and secondary storage to modify the image to add the circle a and rectangle b. It is apparent from this example that the amount of swapping could have been reduced if the sub-image blocks were processed in an order based on knowledge of the state of primary storage. The performance of unnecessary swap out operations is referred to as thrashing. This thrashing can be significantly reduced by use of this modified LRU algorithm. The number of swap cycles can be substantially reduced using the modifications provided by the present invention. With the present invention, the virtual storage manager generates an access list to the primary storage manager. The primary storage manager processes the list to determine which image to access first. As each sub-image can be processed independently of any other sub-image, the primary storage manager can arrange for the sub-images to be accessed in any order. It accordingly accesses the sub-images in an order that will minimise store and fetch cycles between primary and secondary storage. The virtual memory system first determines the set of sub-image blocks that must be accessed and then processes them in the order requiring minimal swapping cycles. The swap out logic preferentially keeps sub-image blocks in the access set list in primary storage. In the example illustrated in Figs. 5a and 5b, sub-image blocks 2, 3 and 4 are on both the access list and in primary storage. The sequence of operations would be as follows: Step 1 a) generate access set list for sub-images {1, 2, 3, 4}; b) store portion of a in sub-image 2, as it is the least recently used and so is the least costly to access; c) remove sub-image 2 from access list leaving access list {1, 3,4}; d) update access status of 2 to most recently accessed, leaving primary storage in state (3, 4, 2); Step 2 a) store portion of a in sub-image 3 as it is the least recently used; b) remove sub-image 3 from access list, leaving list {1, 4}; c) update access status of 3 to most recently accessed, leaving primary storage in state (4, 2, 3); Step 3 a) store portion of a in sub-image 4; b) remove sub-image 4 from access list, leaving access list {1}; c) update access status of 4 to most recently used, leaving primary storage in state (2, 3, 4); Step 4 a) swap out sub-image 2 and swap in sub-image 1; b) store portion of a in sub-image 1; c) remove sub-image 1 from active list, leaving access list empty; d) update access status of 1 to most recently used, leaving primary storage in state (3, 4, 1); Step 5 a) generate a new access list {1, 2, 3, 4} for rectangle b, as shown in the initial state for the modified LRU in Figure 5b; b) store portion of b in sub-image 3; c) remove sub-image 3 from the access list, leaving access list {1, 2, 4}; d) update access status of 3 to most recently used leaving primary storage in state (4, 1, 3); Step 6 a) store portion of b in sub-image 4; b) remove sub-image 4 from the access list, leaving access list {1,2}; c) update access status of 4 to most recently used, leaving primary storage in state (1, 3, 4); Step 7 a) store portion of b in sub-image 1; b) remove sub-image 1 from the access list, leaving list {2}; c) update access status of 1 to most recently used, leaving primary storage in state (3, 4, 1); Step 8 a) swap out sub-image 3 and swap in sub-image 2; b) store portion b in sub-image 2; c) remove sub-image 2 from the access list, leaving access list empty; d) update access status of 2, leaving primary storage in state (4, 1, 2). As is readily apparent, the process of selecting the portion of the image on the access list and most readily available in primary storage has reduced the swap operations from seven for the unmodified LRU to only two for the modified LRU in the present simple example. As the changes become more complex, the savings in cycle times are increased in greater measure. In the disclosed embodiments, a modified least recently used algorithm has been used to determine the order of transfer of sub-images between primary and secondary storage. Any one of many other well known algorithms could be used to enable the efficient transfer of image information. Also, although we have described a particular memory management approach, there are obviously alternative techniques that could be selected to perform the invention.

Claims: An image processing system including: a display device; a first store comprising one or more image blocks: a second store comprising a plurality of image blocks, the number of image blocks in the second store exceeding the number of image blocks in the first store; image management means for loading digital representations of images into the image processing system, and subdividing each such image into a plurality of distinct sub-images, each sub-image being stored in an image block of the first and second stores, and being able to be processed within said first store independently of the other sub-images; a storage manager, operating under the control of the image management means, for transferring sub-images between first and second stores, as required, said stores operating in a cache arrangement; a separate status table associated with each complete image and each sub-image, each status table associated with a complete image including a definition of a view state for that image, said view state representing the current status of a spatial transformation or an editing operation of said image, and each status table associated with a sub-image including a definition of a view state for that sub-image, there being a plurality of possible view states, and any particular view state being derivable from other view states by application of a suitable transformation; said image management means being responsive to a request for display of a selected stored image with a particular view state on the display device, to generate a list of the sub-images that will need to be accessed; said storage manager being responsive to the generation of said list for transferring each listed sub-image into the first store for processing, and returning processed sub-images to the second store if necessary in order to make image blocks in the first store available for receipt of subsequent sub-images in the list; a comparison means for comparing the view states of sub-images stored in the first store with the view state of the image selected for display; and means for changing the view state of each listed sub-image to correspond to the view state of the selected image before sending the sub-image to the display device. An image processing system as claimed in claim 1, wherein the sub-images are stored in the second store in a compressed form. An image processing system as claimed in claim 1 or claim 2 further comprising means for indicating whether a sub-image in the list currently resides in the first store. An image processing system as claimed in any preceding claim, wherein the first store comprises two image blocks thus enabling two sub-images to be stored in the first store at any moment in time. An image processing system as claimed in any preceding claim, wherein the sub-images are rectangular. A method of spatially manipulating images within a data processing system including a display device, a first store comprising one or more image blocks, and a second store comprising a plurality of image blocks, the number of image blocks in the second store exceeding the number of image blocks in the first store, said first and second stores operating in a cache arrangement, the method comprising the steps of: employing an image management means to subdivide each input image into a plurality of distinct sub-images that can be processed independently of the other sub-images, and to store each sub-image in an image block within said first and second stores; maintaining separate view state records for each complete image and for each sub-image, there being a plurality of possible view states, identical wording as in claim 1 and any particular view state being derivable from other view states by application of a suitable transformation; selecting an image for manipulation; generating a list of the sub-images that include areas of said selected image requiring manipulation; transferring each listed sub-image into the first store for manipulation, and returning manipulated sub-images to the second store if necessary in order to make image blocks in the first store available for receipt of subsequent sub-images in the list; comparing the view states of sub-images stored in the first store with the view state of the image selected for display; and changing the view state of each listed sub-image to correspond to the view state of the selected image before display of that sub-image. A method as defined in Claim 6, wherein said first store is capable of storing only a portion of an image, said method further comprising the steps of: retrieving and manipulating sub-images already stored in said first store before sub-images stored in said second store are accessed; swapping sub-images in said first store for sub-images in said second store after all retrieving and manipulating operations have been performed on said sub-images in said first store; and manipulating said sub-images swapped into said first store. A method as claimed in claim 7, wherein the first store comprises two image blocks thus enabling two sub-images to be stored in the first store at any moment in time. A method as claimed in any of claims 6 to 8, wherein the sub-images stored in the first store have an associated access indicator, the access indicator denoting whether the sub-image has been accessed, whereby if the indicator denotes that the sub-image has not been accessed then the sub-image may be overwritten by a sub-image copied from the second store. A method as claimed in any of claims 6 to 9, wherein the sub-images are accessed in an order that requires the fewest swapping operations between the first and second stores. A method as claimed in any of claims 6 to 10, wherein the sub-images in the first store are replaced in accordance with a priority arrangement wherein sub-images in the first store which are not on the list and have not been modified are replaced first, sub-images not on the list are replaced second and sub-images on the list but not modified are replaced third. A method as claimed in any of claims 6 to 11, wherein the sub-images are stored in the second store in a compressed state. A method as claimed in any of claims 6 to 12, wherein the manipulating operations are selected from the group of operations including rotating an image, reflecting an image, inverting colour pattern of an image, pattern filling an image, annotating an image with graphical and textual information, scaling an image and copying one image onto another image. A method as claimed in any of claims 6 to 13, wherein the manipulating operations can be performed on sub-images of an image in any other. A method as claimed in any of claims 6 to 14, wherein the sub-images are rectangular.

Inventors: RYMAN ARTHUR GARY, RYMAN, ARTHUR GARY
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1988
Main classification: G06F15
IPC codes: G06T17, G06T1, G06T11, G06F12