Image processing apparatus

A patch image applied to a processing region to be subjected to a trimming/masking process is formed based on a background image of an original image or the like and an image of the processing region in the original image is replaced by the patch image.

BACKGROUND OF THE INVENTION

This invention relates to an image processing apparatus and image processing method which perform a trimming process or masking process with respect to an input image (original image), for example, and an image forming apparatus which forms an image subjected to the trimming process or masking process on an image forming medium.

In a conventional image processing apparatus, when the trimming process or masking process is performed, a region specified by the user is set as a region to be processed and the trimming process or masking process is performed with respect to the thus set region. In the conventional image processing apparatus, the entire portion of the image of the region subjected to the trimming process or masking process is replaced by fixed image data.

That is, in the trimming process or masking process in a conventional image processing apparatus, image data of the region to be processed is converted into white data (blank data) or fixed data, for example. Therefore, in the conventional image processing apparatus, there occurs a problem that the color of the region subjected to the trimming process or masking process becomes an unnatural color which is different from the background color.

BRIEF SUMMARY OF THE INVENTION

An object of this invention is to provide an image processing apparatus, image forming apparatus and image processing method which can convert an image of a processing region to be subjected to the trimming process or masking process to an image which the user wishes to obtain.

An image processing apparatus according to an aspect of the invention which performs an image modifying process with respect to an original image input via an image input section, for example, comprises a processing region setting section which sets a processing region in the original image input via the image input section, an image forming section which forms a patch image to be applied to the processing region specified by the processing region specifying section based on the original image input via the image input section, and an image editing section which replaces the image of the processing region in the original image input via the image input section by the patch image formed by the image forming section.

An image processing method according to another aspect of the invention which processes an original image input via an image input section, for example, comprises setting a processing region in the original image, forming a patch image to be applied to a processing region based on the original image input via the image input section, and replacing the image of the processing region in the original image input via the image input section by the patch image.

An image forming apparatus according to still another aspect of the invention which includes a scanner to read an image of a document, comprises a processing region setting section which sets a processing region in the image of the document read by the scanner, an image forming section which forms a patch image to be applied to the processing region specified by the processing region specifying section based on the image of the document read by the scanner, an image editing section which replaces the image of the processing region in the image of the document read by the scanner by the patch image formed by the image forming section, and a printer which prints an image obtained by replacing the image of the processing region by the patch image by use of the image editing section on an image forming medium.

DETAILED DESCRIPTION OF THE INVENTION

There will now be described an embodiment of this invention with reference to the accompanying drawings.

FIG. 1is a block diagram showing the schematic configuration of an image forming apparatus according to the embodiment of this invention.

As shown inFIG. 1, the image forming apparatus includes a control section10, user interface20, image input section30such as a scanner, image processing section40, page memory47, printer48and HDD49.

The control section10has a CPU (central processing unit), a memory in which a control program and control data are stored, and various interfaces. The control section10controls the whole portion of the image forming apparatus. The control section10is connected to the user interface20, scanner30, image processing section40, page memory47, printer48and the like.

The user interface20includes a display section21and operating section22. For example, the user interface20is configured by a liquid crystal display device containing hard keys and touch panel. The display section21of the user interface20displays guidance for the user, for example. The operating section22of the user interface20is used to input an instruction from the user by use of the hard keys and touch panel.

The scanner used as the image input section30optically reads a document and inputs an image of the document. Further, the image input section30may be used to input an original image from the external device. The image input section30is operated in response to an operation instruction from the control section10. In addition, the image input section30supplies an input image (original image) to the image processing section40. The image input section30can use a device which inputs image data from the external device via a network instead of the scanner.

The image processing section40subjects image data supplied from the image input section30to an image modifying process. As shown inFIG. 1, the image processing section40has a plurality of processing sections. The image processing section40selectively performs the process by one of the processing sections with respect to the image data based on the operation instruction from the control section10. Image data processed by the image processing section40is stored in the page memory47. Further, the image processing section40is connected to the HDD49used as a memory device to store an image input from the image input section30. The image processing section40can store an image in the HDD49and read an image stored in the HDD49.

If image data processed by the image processing section40is stored in the page memory47, the printer48performs the image forming process for forming an image on an image forming medium based on image data stored in the page memory47. The printer48includes a feeding mechanism which feeds an image forming medium, a developing device which forms an image on an image carrier, a transfer device which transfers the image formed on the image carrier onto the image forming medium, and a fixing device which fixes the image transferred to the image forming medium.

Next, an example of the configuration of the image processing section40is explained.

As shown inFIG. 1, the image processing section40has a first image processing section40A and second image processing section40B. The first image processing section40A is used to perform the trimming process or masking process with respect to an image input by the image input section30. The second image processing section40B is used to perform the smoothing process with respect to the image processed by the first image processing section40A.

The first image processing section40A includes a background color detecting section41, line buffer control section42, enlarging/reducing section43and editing processing section44. The editing processing section44includes a trimming/masking processing section45.

The background color detecting section41performs a process for detecting the background color as a background image in the image. The line buffer control section42performs a buffer control process for lines of the image. The enlarging/reducing section43performs the enlargement/reduction process with respect to the image. The editing processing section44performs the editing process such as image composition, color conversion and the like with respect to the image. The trimming/masking processing section45performs the trimming process or masking process among various functions which the editing processing section44has.

Further, the background color detecting section41performs a process for detecting the background color as a background image in a specified region of an input image (original image). In this case, as the specified region of the input image, a preset region or a region specified by the user is used. Further, as the specified region, the whole portion of the image can be used or a region (which is hereinafter referred to as a processing region) to be subjected to the trimming/masking process may be used. A method for specifying the region by the user will be described later.

In the present embodiment, it is assumed that the background color detecting section41detects a concentration or color of pixels which configure the background as the background color. When the background is formed of a specified pattern, the background color detecting section41may be used to detect the pattern of the image used as the background.

For example, when a black-and-white image is processed, the background color detecting section41detects the concentration of pixels which configure the background as the background color based on the concentration of each pixel in the region. Further, when the background color of the black-and-white image is detected, the background color detecting section41forms a histogram for each concentration of each pixel in the specified region and detects the concentration which appears most frequently as the background color. In this case, the background color of the black-and-white image may be detected by deriving the average value of the concentration values of the respective pixels in the specified region as the background color.

When a color image is processed, the background color detecting section41detects a color which forms the background as the background color based on the color component of each pixel in the region. Further, when the background color of the color image is detected, the background color detecting section41forms a histogram for each color of each pixel in the region and detects the color which appears most frequently as the background color. In this case, the background color of the color image may be detected by deriving the average value of color data items of the respective pixels in the specified region as the background color.

The editing processing section44performs the editing process with respect to the image. The editing processing section44includes a trimming/masking processing section45aand patch forming section45b.

The trimming/masking processing section45aperforms a trimming process or masking process with respect to the processing region in the input image. The patch forming section45bforms image data as a patch (patch image) which will be described later. The trimming/masking processing section45aapplies an image configured by pixels of fixed data to the processing region or applies a patch formed by the patch forming section45bto the processing region.

Further, the second image processing section40B includes a smoothing processing section46. The smoothing processing section46smoothes a variation in the color in the boundary portion of the processing region according to a variation amount of the color between an image within the processing region and an image lying near and outside the processing region. The smoothing processing section46has a gradation processing section46awhich performs the gradation process. The gradation processing section46aperforms a process to make continuous a color variation in the boundary portion of the processing region on the image.

Next, the trimming/masking process by the image forming apparatus with the above configuration is explained.

FIG. 2is a flowchart for illustrating the trimming/masking process.

First, the user selects one of the trimming process and masking process by use of the operating section22of the user interface20. Then, the control section10causes the display section21of the user interface20to display a processing region specifying screen which permits the user to specify a region (which is hereinafter referred to as a processing region) to be subjected to the trimming/masking process (step S10).

As the processing region specifying screen, for example, a screen as shown inFIG. 3is displayed. In an example of the processing region specifying screen shown inFIG. 3, the user specifies a processing region for the image by use of coordinate values. In the specifying screen shown inFIG. 3, the processing region is specified by use of a rectangle. In the specifying screen shown inFIG. 3, a rectangular region used as the processing region is specified by inputting four coordinate values for a rectangle into four input frames51A,51B,51C,51D.

The processing region may be specified by use of various shapes. For example, the processing region may be specified by use of a polygon, circle, eclipse or the like.

Further, the processing region can be specified by displaying an image on the touch panel used as the operating panel and permitting the user to touch the touch panel. In this case, it is necessary to fetch the image at least before the region is specified, but the user can directly and intuitively specify the processing region on the image.

In the image forming apparatus such as the copying machine, in general, an image read by the scanner as the image input section30is subjected to an image modifying process A and then the image is developed in the page memory47. After this, the image developed in the page memory47is subjected to an image modifying process B and printed by use of a printer. That is, in the image processing section40, the process for the input image is roughly divided into two processes, that is, a process before the image is developed in the page memory47and a process after the image is developed.

In the image forming apparatus such as the copying machine, there is a possibility that the position of a document with respect to the scanner will be changed if the image of the same document is read plural times with certain time intervals. Therefore, it is preferable that the scanner should read the image of the document immediately before the process as far as possible. This is because there occurs a possibility that the image read by the scanner before the specification of the processing region is deviated from the image read by the scanner after the specification of the processing region if the position of the document is changed before and after the specification of the processing region.

Therefore, it is effective to perform a process or the like which informs the user so as not to change the position of the document until input of an actually processed image (the document reading process) is completed in the image forming apparatus in a case wherein the image of a document is read by the scanner before the specification of the processing region. Thus, there is no positional deviation between an image displayed at the time of specification of the processing region and an image which is actually subjected to the trimming/masking process.

Further, it is possible to store the image of the document read by the scanner before the specification of the processing region to a memory device such as an HDD, develop the image stored in the memory device in the page memory and subject the image to the image modifying process such as the trimming/masking process. Also, in this case, there is no positional deviation between an image displayed at the time of specification of the processing region and an image which is actually subjected to the trimming/masking process.

The above operation is performed to suppress a possibility that the document position is changed after the processing region is specified.

If the user specifies the processing region, the control section10sets a processing region which is subjected to the trimming/masking process with respect to an input image (step S11). If the processing region is set, the control section10causes the display section21to display a selection screen which permits the user to determine whether or not one of a color and image pattern is attached to the processing region (step S12).

As the selection screen, a screen shown inFIG. 4is displayed, for example. In the example of the selection screen shown inFIG. 4, a key52A which specifies that a color or image pattern is attached to the processing region (the background color is left behind) and a key52B which specifies that no color is left behind (white color is left) are displayed. The keys52A and52B are displayed by use of a touch panel used as the operating section22. The user selects and specifies one of the keys52A and52B on the selection screen (step S13).

When the key52B is specified by the user, that is, when it is selected that a color or image pattern is not attached to the processing region (“No” in step S13), the control section10performs the trimming/masking process (step S14). Therefore, the processing region will be set to a preset image (an image formed of white or fixed data).

For example, when the key52B is selected, the control section10performs the trimming/masking process by causing the trimming/masking processing section45ato set image data in the processing region into white data (blank data). In this case, in an image obtained as the result of the trimming/masking process, all of pixels in the processing region in the image input from the image input section30are replaced by white pixels.

Further, when the key52A is specified by the user, that is, when it is selected that a color or image pattern (which is hereinafter referred to as a background color) is attached to the processing region (“YES” in the step S13), the control section10starts the patch forming process (step S15) which will be described later. The patch forming process is a process to determine the background color in the processing region. A patch (patch image) formed by the patch forming process indicates the background color in the processing region. Therefore, as the result of the patch forming process, the background color of the processing region is formed as a patch.

After the patch is formed by the patch forming process, the control section10performs the trimming/masking process with respect to the processing region specified by the step S11in the image input by the image input section30(step S16). The image subjected to the trimming/masking process is developed in the page memory47. When the image is developed in the page memory47, the control section10overwrites the patch formed by the patch forming process with respect to the processing region in the image developed in the page memory47(step S17).

An image having the patch formed by the patch forming process and written into the processing region (the image subjected to the trimming/masking process) is completed by steps S11, S15to S17. If the image having the patch formed by the patch forming process and written into the processing region is completed, the control section10displays the thus completed image on the display section21(step S18). By the above display operation, the user can confirm the image having the patch applied to the processing region.

As the image confirmation screen, for example, a screen shown inFIG. 5is displayed. In an example of the image confirmation screen shown inFIG. 5, an application key53A which specifies that the displayed image is satisfactory and a re-formation key (cancel key)53B which specifies that the displayed image is canceled (the image is re-formed) are displayed together with a display frame53C which displays the image subjected to the trimming/masking process. The application key53A and re-formation key53B are displayed by use of a touch panel used as the operating section22.

Therefore, in the example of the image confirmation screen shown inFIG. 5, the user watches the image displayed in the display frame53C and selects and specifies the application key53A or re-formation key53B. That is, the user watches the confirmation screen displayed on the display section21and determines whether the image is satisfactory or not.

In this case, if the image displayed on the display section21is not satisfactory, the user selects and specifies the re-formation key53B in order to cancel the image. When the re-formation key53B is specified (“NO” in step S18), the control section10returns the process to step S11and repeats the above process.

If the image displayed on the display section21is satisfactory, the user selects and specifies application key53A which indicates that the user has confirmed the image. When the application key53A is specified (“YES” in step S18), the control section10determines whether a variation in the pixel level (for example, hue or saturation information) of each pixel in the boundary portion (several lines lying before and after the boundary) of the processing region is larger than a preset level or not (step S19).

When it is determined that a variation in the pixel level in the boundary portion of the processing region is not larger than the preset level (“NO” in step S19), the control section10completes the trimming/masking process without performing the smoothing process with respect to the processing region. Further, when it is determined that a variation in the pixel level in the boundary portion of the processing region is larger than the preset level (“YES” in step S19), the control section10causes the display section21to display the selection screen which permits the user to determine whether the smoothing process (gradation process) with respect to the processing region should be performed or not (step S20).

As the smoothing process selection screen, for example, a screen shown inFIG. 6is displayed. On the smoothing process selection screen shown inFIG. 6, a key54A which specifies that the smoothing process is performed with respect to the processing region and a key54B which specifies that the smoothing process is not performed with respect to the processing region are displayed. The keys54A and54B are displayed by use of a touch panel used as the operating section22. In the example of the selection screen shown inFIG. 6, the user selects and specifies the key54A or54B to determine whether or not the smoothing process is performed with respect to the processing region.

In the above example, only when it is detected in step S19that a variation in the pixel level in the boundary portion of the processing region is larger than the preset level, the smoothing process selection screen is displayed so as to permit the user to selectively determine that the smoothing process is performed or not. However, the process of step S19can be omitted. That is, it is possible to display the smoothing process selection screen so as to permit the user to selectively determine that the smoothing process is performed or not irrespective of the variation amount in the pixel level in the boundary portion of the processing region.

When the key54B is specified, that is, when the user specifies that the smoothing process is not performed (“NO” in step S21), the control section10completes the trimming/masking process without performing the smoothing process.

Further, when the key54A is specified, that is, when the user specifies that the smoothing process is performed (“YES” in step S21), the control section10starts to perform the smoothing process (step S22).

The smoothing process is a process which makes continuous a variation in the colors of the respective pixels in the boundary portion of the processing region. That is, in the smoothing process, the colors are continuously changed between the color in the processing region and the color outside the processing region. Therefore, according to the smoothing process, the colors of the respective pixels in the boundary portion of the processing region are changed so as to make a smooth variation in the color based on the color in the processing region and the color in a portion near and outside the processing region.

After the smoothing process is terminated, the control section10completes the trimming/masking process. It is also possible for the user to confirm an image subjected to the smoothing process when the smoothing process is terminated. For example, the control section10causes the same screen as the confirmation screen shown inFIG. 5to be displayed on the display section21and permits the user to confirm an image subjected to the smoothing process.

Next, the patch forming process is explained in detail.

FIG. 7is a flowchart for illustrating the patch forming process in step S15in FIG.2.

First, a process which automatically forms a patch (auto mode, steps S30to S34) is explained.

As shown inFIG. 7, when a trimming/masking region (processing region) is specified and the user is instructed to attach a background color to the processing region, the control section10displays a patch specifying screen which specifies a background color as a patch of the processing region (step S30).

As the patch specifying screen, for example, a screen as shown inFIG. 8is displayed. In an example of the patch specifying screen shown inFIG. 8, an automatic key55A used to specify that the background color attached to the processing region is automatically set (auto mode) and a specifying key55B used to specify that the user specifies the background color attached to the processing region (manual mode) are displayed. The automatic key55A and specifying key55B are displayed by use of a touch panel used as the operating section22. The user selects and specifies the automatic key55A or specifying key55B on the selection screen (step S31).

When the user specifies the automatic key55A on the patch specifying screen (“auto” in step S32), the control section10performs the process (the patch forming process in the auto mode) in which the background color (patch) of the processing region is automatically set (steps S32to S34).

In the patch forming process in the auto mode, first, the control section10inputs an image by use of the image input section30(step S32). For example, if a scanner is used as the image input section30, the control section10operates the scanner to read an image of a document.

When an original image is input by use of the image input section30, the control section10performs a background color detecting process to detect the background color by use of the background color detecting section41(step S33). The background color detecting process is a process in which a color is detected and used to form a patch.

For example, in the background color detecting process, the background color within the processing region in the image (original image) input by use of the image input section30is detected. Further, in the background color detecting process, it is possible to detect the background color of the whole portion of the image input by use of the image input section30. Further, in the background color detecting process, a color which appears most frequently in the image of the processing region or in the whole input image is detected as the background color. In the background color detecting process, it is also possible to detect average data of the pixels in the image of the processing region or in the whole input image as the background color.

When the background color is detected in the background color detecting process, the control section10forms a patch configured by pixels of the background color detected by the background color detecting section41(step S34).

Generally, when it is desired to erase only an image such as characters in the processing region or when the background color of the whole portion of the original image is not uniform, it is preferable to form a patch by use of the background color in the processing region. When the patch is formed by use of the background color in the processing region, the processing region is replaced by a color detected as the background color in the processing region.

For example, when the patch is formed by use of the background color in the processing region, it becomes possible to cancel or erase only an image such as characters in the processing region with the background color in the processing region left behind. Further, when the background color is detected only in the processing region and if the background color of the whole portion of the image is not uniform, a sampling region used to detect the background color is limited within the processing region. Therefore, a merit that the most natural background color with respect to the processing region can be easily detected can be attained.

On the other hand, when it is desired to prevent the color of the processing region from producing unnatural feelings in the whole image or when the background color of the whole portion of the image is uniform, it is preferable to form a patch by use of the background color of the whole portion of the image. When the patch is formed by use of the background color of the whole portion of the image, the processing region is replaced by a color detected as the background color of the whole portion of the image.

For example, when the patch is formed by use of the background color of the whole portion of the image, the color of the processing region matches with the whole portion of the image so that the color of the processing region can be prevented from producing unnatural feelings in the whole image. Further, when the background color is detected based on the whole image and if the background color of the image is uniform, a sampling region used to detect the background color becomes large. Therefore, a merit that a natural background color can be easily detected can be attained.

As described above, in the automatic patch forming process, the method of detecting the background color and a region in which the background color is detected can be adequately determined according to the application condition of the image forming apparatus.

Next, a process (manual mode [steps S30, S31, steps S35to S43]) performed when the user specifies the background color attached to the processing region is explained.

When the trimming/masking region (processing region) is specified and the user specifies that the background color is attached to the processing region, the control section10displays a patch specifying screen which specifies the background color as a patch of the processing region (step S30).

When the user specifies the specifying key55B on the patch specifying screen (“specified” in step S31), the control section10performs a process (a patch forming process in the manual mode) in which the background color (patch) of the processing region is set based on a region specified by the user (steps S35to S43).

That is, when the specifying key55B is specified on the patch specifying screen, the user specifies a sampling region used to form a patch by use of the operating section22(step S35). For example, the sampling region is specified by the user on a screen as shown in FIG.8. In the example shown inFIG. 8, the sampling region is specified by inputting four coordinate values of a rectangle. The sampling region can be specified by the same operation as that performed to specify the trimming/masking processing region.

When the sampling region is specified by the user, the control section10holds the coordinate values indicating the specified sampling region (step S36). When thus holding the sampling region, the control section10displays a selection screen used to select a patch forming method (step S37). As the patch forming method, it is assumed that a method (first method) for forming a patch based on the background color detected in the sampling region and a method (second method) for forming a patch with a size applicable to the processing region by repeatedly providing an image of the sampling region can be selected.

For example, as the selection screen of the patch forming method, a screen as shown inFIG. 9is displayed. In the example of the selection screen ofFIG. 9, a key57A used to select the method for forming a patch according to the first method and a key57B used to select the method for forming a patch according to the second method are displayed. The keys57A and57B are displayed by use of a touch panel used as the operating section22.

When the key57A is specified by the user, that is, when the first method for forming a patch based on the background color detected in the sampling region is selected (“NO” in step S38), the control section10causes the background color detecting section41to start a process for detecting the background color in the sampling region.

Then, the control section10first causes the image input section30to input an image (step S39). For example, when a document image is read by use of the scanner used as the image input section30, the control section10reads an image of the document.

When an image is input by the image input section30, the control section10causes the background color detecting section41to perform a background color detecting process to detect the background color (step S40). The background color detecting process is a process for detecting a color used to form a patch. For example, in the background color detecting process, a color which appears most frequently in the sampling region is detected as the background color. Further, in the background color detecting process, average data of the pixels in the sampling region may be detected as the background color.

When the background color in the sampling region is detected in the background color detecting process, the control section10forms a patch configured by pixels of the background color detected by the background color detecting section41(step S41).

Further, when the key57B is specified by the user, that is, when the second method for forming a patch by repeatedly providing an image of the sampling region is selected (“YES” in step S38), the control section10starts a process for forming a patch by repeatedly providing the image of the sampling region.

Then, the control section10first causes the image input section30to input an image (step S42). For example, when a document image is read by use of the scanner used as the image input section30, the control section10reads an image of the document.

When an image is input by the image input section30, the control section10forms a patch with the same size as the processing region by repeatedly providing an image of the sampling region (step S43).

When the patch is formed in steps S35, S41or S43, the control section10causes the display section21to display a confirmation screen which permits the user to confirm the formed patch (step S44).

As the patch confirmation screen, for example, a screen shown inFIG. 10is displayed. In an example of the patch confirmation screen ofFIG. 10, an application key58A which specifies application of the displayed patch and a re-forming key (cancel key)58B which specifies cancellation (patch re-formation) of the displayed patch are displayed together with a display frame58used to display the formed patch. The application key58A and re-forming key58B are displayed by use of a touch panel used as the operating section22.

That is, in an example of the image confirmation screen ofFIG. 10, the user watches the patch displayed in the display frame58and selects and specifies the application key58A or re-forming key58B.

In this case, if the user is satisfied with the patch displayed in the display frame58, the user selects and specifies the application key58A which permits application of the formed patch. When the application key58A is specified (“YES” in step S45), the control section10completes the patch forming process. After the patch forming process is completed, the control section10proceeds the process to step S16ofFIG. 2so as to perform the trimming/masking process using the formed patch.

Further, if the user is not satisfied with the patch displayed in the display frame58, the user selects and specifies the re-forming key58B to re-form or cancel the patch. When the re-forming key58B is specified (“NO” in step S45), the control section10returns the process to step S31to repeat the above process.

The sampling region may be specified by displaying an original image on the touch panel used as the operating section22and causing the user to touch the touch panel while watching the original image. In this case, it is required to fetch the image at least before the sampling region is specified, but a merit that the user can directly and intuitively specify the sampling region on the original image can be attained.

As described above, when an image of the same document is read plural times at time intervals in the image forming apparatus such as a copying machine, there is a possibility that the position of the document in the scanner is changed. Therefore, it is preferable for the scanner to read the image immediately before the image processing process as far as possible.

That is, if the position of the document in the scanner is changed before and after the sampling region is specified, there occurs a possibility that the image read by the scanner after the sampling region is specified will be deviated from the image read by the scanner before the sampling region is specified.

Therefore, in a case where the image of the document in the scanner is read before the sampling region is specified, it is effective to perform the process for, for example, suggesting the user so as not to change the position of the document until input of the image to be actually processed (document reading process) is completed in the image forming apparatus. As a result, there occurs no positional deviation between an image displayed at the time of specification of the sampling region and an image to be actually subjected to the trimming/labeling process.

Further, an image read by the scanner before specification of the sampling region may be stored in a memory device such as an HDD and a patch may be formed based on the image stored in the memory device. In this case, an original image for the trimming/labeling process is fetched from the image stored in the memory device and is subjected to the image modifying process. As a result, there occurs no positional deviation between an image displayed at the time of specification of the sampling region and an image to be actually subjected to the trimming/labeling process.

Next, an application example of the trimming/masking process is explained.

FIG. 11shows an example of an image (original image)60input by the image input section30.FIGS. 12,13,14show examples of images61,62;63obtained by subjecting the image60shown inFIG. 11to the masking process.

InFIG. 11, a region60A is a processing region which is subjected to the masking process, a region60B is a sampling region which is specified by the user, and a region60C is a sampling region which is specified by the user.

First, in the masking process for the image60, when the user specifies the key52B (“the background color is not left behind”) on the selection screen52for selection of the presence or absence of the background color, the processing region60A of the image60is replaced by white data as fixed data as shown in FIG.12.

That is, when “the background color is not left behind” is specified as the process condition of the masking process, the processing region60A is replaced by white color and the image60is converted into the image61as shown in FIG.12.

Further, in the masking process for the image60, when the user specifies the key52A (“the background color is left behind”) on the selection screen52for selection of the presence or absence of the background color and specifies the automatic key55A on the specifying screen of the background color, the processing region60A of the image60is replaced by a background color detected by the background color detecting section41.

That is, when “the background color is left behind” and “the background color is ‘automatically’ detected” are specified as the process condition of the masking process (auto mode), the processing region60A is replaced by the background color of a preset region (in the whole image or processing region) and the image60is converted into the image62as shown in FIG.13.

Further, in the masking process for the image60, when the user specifies the key52A (“the background color is left behind”) on the selection screen52for selection of the presence or absence of the background color, specifies the sampling region60B and the specifying key55B on the background color specifying screen55and specifies “the background color of the specified region” on the selection screen for the patch forming method, the processing region60A of the image60is replaced by a background color detected as the background color of the sampling region60B by the background color detecting section41as shown in FIG.13.

That is, when it is specified to detect the background color of the processing region60A from the sampling region60B as the process condition of the masking process (manual mode), the processing region60A is replaced by the background color in the sampling region60B and the image60is converted into the image62as shown in FIG.13.

Further, in the masking process for the image60, when the user specifies the key52A (“the background color is left behind”) on the selection screen52for selection of the presence or absence of the background color, specifies the sampling region.60C and the specifying key55B on the specifying screen55of the background color and specifies “the background color of the specified region” on the selection screen for the patch forming method, the processing region60A of the image60is replaced by a background color detected as the background color of the sampling region60C by the background color detecting section41as shown in FIG.14.

That is, when it is specified to detect the background color of the processing region60A from the sampling region60C as the process condition of the masking process (manual mode), the processing region60A is replaced by the background color in the sampling region60C and the image60is converted into the image63as shown in FIG.14.

Next, an example of an image in which the patch formed by repeatedly providing the image of the sampling region specified by the user is applied to the processing region is explained.

FIG. 15shows an example of an image (original image)64input by the image input section30.FIG. 16is a diagram showing an example of an image65obtained by subjecting the image64to the masking process.

InFIG. 15, it is assumed that a region64A is a processing region to be subjected to the masking process and a region64B is a sampling region specified by the user.

In the masking process for the image64, when the user specifies the key52A (“the background color is left behind”) on the selection screen52for selection of the presence or absence of the background color, specifies the sampling region60B and the specifying key55B on the background color specifying screen55and specifies “repetition of the specified region” on the selection screen for the patch forming method, the processing region64A of the image64is replaced by an image obtained by repeatedly providing the image of the sampling region64B as shown in FIG.16.

That is, when “the background color is left behind” and the image which is obtained by repeatedly providing the image of the sampling region specified by the user and used as the background color are specified (manual mode), the processing region64A is replaced by the image obtained by repeatedly providing the image of the sampling region and the image64is converted into the image65as shown in FIG.16.

As described above, in the present embodiment, a patch image which is applied to a processing region subjected to the trimming/masking process is formed based on the background image or the like of an original image and the image of the processing region in the original image is replaced by the patch image. As a result, a pattern of a color or image which the user wants to obtain can be applied to the processing region in the trimming/masking process.

For example, when it is desired to erase only image information such as characters in the processing region and leave behind a natural background color in the processing region without performing any particular operation, the user specifies “auto”. As a result, it becomes possible to erase only image information such as characters in the processing region and leave behind the natural background color without performing the operation of specifying an image applied to the processing region. Particularly, when the background of the processing region or the whole portion of the input image is uniform, the background color can be easily and automatically detected. Therefore, only if the user specifies “auto”, an image formed of a natural background color can be applied to the processing region.

Further, when it is desired to apply a color which the user wants to obtain to the processing region, the user specifies a sampling region having a background of the color which is desired to be applied to the processing region. Thus, the image of the background color of the sampling region which the user has specified can be applied to the processing region. Particularly, if the background of the whole image is not uniform as in the image60shown inFIG. 11, the background color which the user wants to obtain can be applied to the processing region without fail by permitting the user to specify the sampling region.

Further, when it is desired to apply an image pattern which the user wants to use to the processing region, the user specifies a sampling region formed of the image pattern which is desired to be applied to the processing region. Thus, an image formed of the image of the sampling region which the user has specified can be applied to the processing region. Particularly, if the background of the image is not uniform as in the image64shown inFIG. 15, the image formed of the image pattern which the user wants to use can be applied to the processing region without fail by permitting the user to specify the sampling region.

That is, according to the present embodiment, an image pattern or color other than the preset color can be applied to the processing region which is subjected to the trimming/masking process according to the intention of the user.