text: referring now to the drawings , the digital color copying machine of the present invention will be explained . fig2 is a cross - sectional view showing the entire construction of a digital color copying machine of this embodiment . the digital color copying machine is generally divided into an image reader portion 100 that reads document images and copying portion 200 that prints the image read by the image reader portion 100 on copying paper . the image reader portion 100 is constructed identical to a conventional apparatus . a scanner 10 is provided with an exposure lamp 12 to irradiate the document , a rod lens array 13 to condense light reflected from the document and a ccd sensor 14 to convert the condensed light to an electrical signal . the scanner 10 is driven by a motor 11 while the document is read to move in the direction of the arrow ( sub - scanning direction ) and scan the document loaded on top of the document glass table 15 . the image on the document irradiated by the exposure lamp 12 undergoes photoelectric conversion by the ccd sensor 14 . a read signal processor 20 converts the multiple value electrical signal consisting of three colors r , g , b obtained by the ccd sensor 14 into 8 - bit gradation data of either yellow ( y ), magenta ( m ), cyan ( c ) or black ( bk ) which is then stored in a buffer memory 30 for synchronous use . then , after carrying out gradation corrections ( γ correction ) in response to the gradation properties of the photoreceptor relative to the gradation data to be input , a print head portion 31 in the copying portion 200 carries out d / a conversion on the corrected image data after the correction , generates a laser drive signal and a semiconductor laser provided in the head portion 31 generates light in response to this drive signal . a photoreceptor drum 41 is evenly charged by an electric charger 43 after being irradiated by an eraser lamp 42 before each copy is exposed . when the photoreceptor drum 41 in a charged state is exposed by laser light , an electrostatic latent image of the document is formed on the surface of the drum . next , one out of four toner developing assemblies 45a to 45d of four colors cyan ( c ), magenta ( m ), yellow ( y ) or black ( bk ) is selected and develops the electrostatic latent image on the photoreceptor drum 41 . conversely , the copying paper is supplied from a paper cassette 50 and sent to a transfer drum 51 along supply guides . the copying paper is timed during the supply so that the leading edge of the paper is held by a gripper 52 on the transfer drum 51 and is wound around the transfer drum 51 . a transfer charger 46 transfers the toner image developed on the surface of the photoreceptor drum 41 to the copying paper wound around the transfer drum 51 . the above printing process is repeated in order of four colors of magenta ( m ), cyan ( c ), yellow ( y ) and black ( bk ). for each color the scanner 10 repeats the scanning operation in synchronization with the operations of the photoreceptor drum 41 and the transfer drum 51 . thereafter , the copying paper is separated from the transfer drum 51 by the operation of a separation claw 47 . toner adhering to the copying paper is fixed to the copying paper by a fixing device 48 . after the toner is fixed the copying paper is discharged to a discharge tray 49 . fig3 is a front view of the operation panel 1 provided in the main body of the copying machine . on the operation panel 1 provided are a ten - key pad 2 to set the number of copies or copy density , a start key 3 to start the copy operation , a display led 4 that displays the operation state of the copying machine main body , a mode setting key 5 , leds 6 to 8 that light when the mode setting key 5 is pressed , a background process selection key 9 and leds 10 to 12 that light when the background process selection key 9 is pressed . the modes set by the mode setting key 5 are the automatic magnification selection process mode , the automatic paper selection process mode and the manual process mode . each mode is selected in order every time the mode setting key 5 is pressed . when the automatic magnification selection process mode is selected , mode parameter i is set to 0 along with led 6 lighting . when the automatic paper selection process mode is selected , mode parameter i is set to 1 along with led 7 lighting . when the manual process mode is selected , mode parameter i is set to 2 along with led 8 lighting . the background process set by the background process selection key 9 includes no background process , deletion of background color and conversion of background color . these background processes are achieved by the extraction of the image area of the document . when no background process is selected , background process parameter j is set to 0 along with led 10 lighting . when deletion of background color is selected , background process parameter j is set to 1 along with led 11 lighting . when conversion of background color is selected , background process parameter j is set to 2 along with led 11 lighting . according to the copying machine of the present embodiment , when the base color of the document is judged to be a uniform , the density of this base color is considered to be the density of the background portion . the above judgment is done based on the criteria that when the base color is uniform , the frequency of appearance of pixels having the base color density is prominent compared to that of pixels of another density . the detection of the image area is done based on a value of reference level q determined from the density of the background portion . this value of reference level q is set based on that , in general , an image darker than the base color is written on a whitish base and an image lighter than the base color is written on a blackish base . namely , when the frequency of pixels having a color darker than the density of the background portion is high in the entire document , the value of reference level q is set larger than the density of the background portion by a predetermined value . further , when the frequency of pixels having a color lighter than the density of the base color is high in the entire document , the value of reference level q is set smaller than the density of the background portion by a predetermined value . therefore , when an image is written on a whitish base , a judgment can be made that the image area is a region where the color density of the pixels is larger than the reference level q . further , when an image is written on a blackish base , a judgment can be made that the image area is a region where the color density of the pixels is smaller than the reference level q . fig4 is an outline block diagram of the image area detector provided in the main body of the copying machine . cpu 300 controls the drive of a motor 11 so that a scanner 10 reads image of the document to generate image data and also processes the data between other processors such as the read signal processor 20 . because the cpu 300 detects the image area of the document before reading the image for the copy process , a preliminary scan is carried out by the scanner 10 . the image data of the document obtained when the scanner 10 carries out the preliminary scan of the document is input to the image area detector . as shown with dots in fig5 from among the image data to be input , a data memory 301 stores the data of sampling points provided at predetermined intervals . from the data memory 301 the cpu 300 reads the image data of the sampling points which are in the portion closest to the frame of the document shown by diagonal lines in fig5 to obtain a density histogram . an example density histogram obtained for this case is shown in fig6 ( a ). in this histogram the most frequent value d n is judged to be the density of the background . next , from the data memory 301 the cpu 300 reads the image data of the sampling points of the entire document to obtain a density histogram . an example density histogram obtained in this case is shown in fig6 ( b ). in this histogram , the quantity of data with a higher density is compared to density d n of the background and the quantity of data with a lower density is compared to density d n of the background . reference level q is set on the side of d n for which more data present . fig6 ( b ) illustrates the case where the quantity of data with a color density above d n exceeds that below d n . therefore , reference level q is set to density data d n + 1 . reference level q is then used to extract the image area from the document . to extract the image area the cpu 300 outputs reference level q obtained by the previous process to a comparator 302 . in the comparator 302 , a value p of the image data to be input is compared to the value of reference level q . if the value p of the image data is larger than the value of reference level q , a high level comparison result signal is output . if p is less than q , a low level comparison result signal is output . in other words , when the base color is whitish , the density of the image area is darker than the base color . consequently , the comparison result signal at the location changing from the background portion to the image area rises from a low level to a high level . similarly , when the base color is blackish , the density of the image area is lighter than the base color . consequently , the comparison result signal at the location changing from the background portion to the image area falls from a high level to a low level . an address signal of the main scanning direction is input to a latch circuit 303 synchronized with the image data . the latch circuit 303 latches the leading edge address of the image area and sends it to the cup 300 synchronized with the initial change ( rise or fall ) of the signal input from the comparator 302 , and also latches the trailing edge address of the image area and sends it to the cup 300 synchronized with the final change ( fall or rise ) of the signal input from the comparator 300 . the cpu 300 reads the address latched by the latch circuit 303 to verify the position of the image in the main scanning direction . by repeating this process by the number of sampling points provided in the sub - scanning direction , the image area can be detected . in the image area detecting section the image area be detected but also the document size . this is accomplished in a manner like the image area detection process but where the value of reference level q is compared to a value based on the color of the document glass table cover . further , based on the detected image area , regions outside the image area , such as the background portion , can also be removed . after removing regions outside the image area other background colors can also be set . the image area detection process executed by the cpu 300 and processes executed based on data of the detected image area will be described later using flowcharts . fig7 is a flowchart showing the main routine of the copying operation executed by the cpu 300 . at first , initial settings are made ( step s100 ). these initial settings are initialization of ram in which data is temporarily stored while the cpu 300 operates , as well as setting each function and clearing each timer counter . next , the internal timer is cleared and started ( step s101 ). after the internal timer starts , input of the mode selection key 5 and background process selection key 9 or , input of copying paper size , copying magnification or number of copies , all by the user , is requested ( step s200 ). after the key input , preliminary scan process ( step s300 ) starts . after the preliminary scan process , mode process routine ( step s400 ), background process routine ( step s500 ) and print process ( step s600 ) are executed . the above process waits until the internal timer completes ( yes in step s102 ) and then returns to step s101 to repeat . fig8 is a flowchart showing the key input process ( step s200 ). when the user presses the mode setting key 5 ( yes in step s201 ), the value of mode parameter i is examined . when the automatic magnification selection process mode ( i = 0 ) is set ( yes in step s202 ), the automatic paper selection process mode ( i = 1 ) is set ( step s203 ), and led 6 is turned off and led 7 is turned on ( step s204 ). further , when the automatic paper selection process mode ( i = 1 ) is set ( yes in step s205 ), the manual process mode ( i = 2 ) is also set ( step s206 ), and led 7 is turned off and led 8 is turned on ( step s207 ). still further , when the manual process mode ( i = 2 ) is set ( no in step s205 ), the automatic magnification selection process mode ( i = 0 ) is set ( step s208 ), and led 8 is turned off and led 6 is turned on ( step s209 ). when the user does not press the mode setting key 5 ( no in step s201 ), the mode which is already set is executed . moreover , when the user presses the background process selection key 9 ( yes in step s210 ), the value of background process parameter j is examined . when no background process ( j = 0 ) is set ( yes in step s211 ), deletion of background color ( j = 1 ) is set ( step s212 ), and led 10 is turned off and led 11 is turned on ( step s213 ). when deletion of background color ( j = 1 ) is set ( yes in step s214 ), conversion of background color ( j = 2 ) is set ( step s215 ), and led 11 is turned off and led 12 is turned on ( step s216 ). when conversion of background color ( j = 2 ) is set ( no in step s214 ), no background process ( j = 0 ) is set ( step s217 ), and led 12 is turned off and led 10 is turned on ( step s218 ). when the user does not press the background process selection key 9 ( no in step s210 ), the background process mode which is already set is executed . after inputting copy paper size , copy magnification and number of copies as well as other input processes the key insert process returns . fig9 is a flowchart showing the preliminary scan process ( step s300 ). at first , a judgment is made on whether or not an image area detection mode is set ( step s301 ). the image area detection mode means the automatic magnification selection process mode and the automatic paper selection process mode described in the above key input process ( step s200 ). when the image area detection mode is set ( yes in step s301 ), the motor 11 drives to move the scanner 10 in the sub - scanning direction ( step s302 ). as shown by the dots in fig5 image data of sampling points provided at predetermined intervals in the main scanning direction and sub - scanning direction is stored in data memory 301 ( step s303 ). waiting until the read of one screen of image data completes ( yes in step s304 ), image data of the sampling points at the frame portion of the document indicated by the diagonal lines in fig5 is read from the data memory 301 to obtain a density . when the base color is judged to be uniform based on the density histogram , the most frequent value d n is set as the density data of the background portion ( step 305 , refer to fig6 ( a )). the density detection process of this background portion will be described later . next , the data of the sampling points of the entire document is read , thereby a density histogram is obtained to determine reference level q based on the density data level of the background portion determined in step s305 ( step s306 ). the setting of this reference level q will be described later . the motor 11 is driven in reverse to return the scanner 10 ( step s307 ). during this time the cpu 300 reads the leading edge and trailing edge addresses of the document area latched by the latch circuit 303 ( step s308 ). when the number of sampling points provided in the sub - scanning direction is n , the process in step s308 described above is repeated n times ( step s310 ), thereby the image area is detected . the process waits for the completion of the process of n sampling points provided in the sub - scanning direction ( yes in step s310 ) to return . according to the copying machine of this embodiment , when the base color of the document is judged to be uniform , the density of this base color is the density of the background portion . the above judgment is executed based on the fact that the frequency of appearance of pixels having the base color is prominent comparing the frequency of appearance of pixels having another density when the base color is uniform . fig1 is a flowchart of the density detection process of the background portion ( step s305 ). first , image data in the sampling points at the frame portion of the document indicated by the diagonal lines in fig5 is read from the data memory 301 to obtain a density histogram ( step s311 ). the frequency of the most frequent value d n of the obtained histogram is compared to the frequency of another density ( step s312 ). if the base color of the document is uniform , a histogram as shown in fig6 ( a ) for example , can be obtained . however , when the document is a photograph and the base color is not uniform , there is not an extreme difference between the frequency of the most frequent value of the density histogram and the frequency of another density . thereupon , when the difference between the frequency of the most frequent value d n of the obtained histogram and the frequency of another density is larger than the threshold value determined by experiment ( yes in step s313 ), the base color of the document is judged to be uniform and the most frequent value d n is regarded as the density of the background portion ( step s314 ) and the process returns . conversely , when the above difference is smaller than the threshold value ( no in step s313 ), detection of the image area is judged to be impossible , then the manual process mode ( i = 2 ) and the no background process ( j = 0 ) are set , and the preliminary scan process itself is completed ( step s315 ). the detection of the image area is done based on the value of reference level q determined from the density of the background portion . the above value of reference level q is set in consideration that an image darker than the base color is written for a whitish base and an image lighter than the base color is written for a blackish base . in other words , when pixels darker than the density of the background portion appear frequently in the entire document , the reference level q is set to a value larger than the density of the background portion by a predetermined value . similarly , when pixels with a color lighter than the density of the base color appear frequently in the entire document , the reference level q is set to a value smaller than the density of the background portion by a predetermined value . the reason why the density of the background portion is not directly set as the reference level q is that a certain latitude is preferably allowed to a density of pixels regarded as the background . with such a procedure , reliability for detecting the image area is improved . fig1 is a flowchart showing the setting of reference level q executed during the above - described preliminary scan ( step s306 ). first , the sampled image data from the entire document is used to obtain the density histogram as shown in fig6 ( b ) ( step s320 ). next , the data is examined to determine whether ligt or dark density data appears more frequently in comparison with the background density d n ( step s321 ). here , if the frequency of darker data ( d n + 1 , d n + 2 , etc .) is higher than density data d n of the background ( yes in step s323 ), the document is judged to be written an image on a whitish base . therefore , to extract the image area from the document , density data d n + 1 darker than the data d n by a predetermined value ( for example 5 for data with 256 gradations ) is set to reference level q ( step s324 ). on the other hand , if the frequency of lighter data ( d n - 1 , d n - 2 , etc .) higher than density data d n of the background ( no in step s323 ), this document is judged to have a bright image written on a blackish base . therefore , to extract the image area from the document , density data d n - 1 lighter than the said data d n by a predetermined value ( for example 5 for data with 256 gradations ) is set to reference level q ( step s325 ). fig1 is a flowchart showing the mode process ( step s400 ). first the value of mode parameter i set by the key input process ( step s200 ) is examined ( step s401 ). when i = 0 , the automatic magnification selection process is executed ( step s402 ). in the automatic magnification selection process , an image area is enlarged or reduced to the size of the copying paper selected by the user based on the detection of the image area within the document and the largest width ( l1 and l2 of fig5 ) in the main scanning direction and vertical scanning direction of the detected image area ( refer to fig1 ( b )). when i = 1 , the automatic paper selection process is executed ( step s403 ). in the automatic paper selection process , an appropriate size of the copying paper is selected based on the detection of the image area within the document and the largest width ( l1 and l2 of fig5 ) in the main scanning direction and sub - scanning direction of the detected image area as well as the copying magnification set by the user . when i = 2 , the image area is not detected and the normal manual process is executed ( step s404 ). fig1 is a flowchart of the automatic magnification selection process . first , the image area is detected ( step s410 ). next , the size of the copying paper selected by the user is detected ( step s411 ). then , the largest width ( l1 and l2 of fig5 ) is obtained in the main scanning direction and sub - scanning direction of the image area detected in the above - said step s410 , and the copying magnification to enlarge or reduce the image area to the size of the copying paper selected by the user is set ( step s412 ) based on the obtained largest width . hereupon , as shown in fig5 the largest width l1 in the main scanning direction of the image area is the difference between the smallest leading edge address and largest trailing edge address . moreover , as shown in fig5 the largest width l2 in the sub - scanning direction is the width from the initially detected position of the image area to the finally detected position of the image area . since the copying magnification is set , for example , a smaller magnification is adopted between the magnification for which the image area would be fully enlarged in the main scanning direction of the copying paper and the magnification for which the image area would be fully enlarged in the sub - scanning direction . this prevent loss of a portion of the image area . by carrying out the copying process with the copying magnification set by the process described above , the image area within the document can to be enlarged to the full extent the copy paper as shown in fig1 ( b ), thereby it becomes unnecessary to make wasteful test copies when enlarging or reducing the image area . fig1 is a flowchart of the automatic paper selection process ( step s403 ). at first , the image area is detected ( step s420 ). next , the value of the copying magnification set by the key input process ( step s200 ) is detected ( step s421 ). the largest widths ( l1 and l2 of fig5 ) is obtained in the main scanning direction and sub - scanning direction of the image area detected in the above - mentioned step s420 . and then the smallest size copy paper is selected among any size of paper which is able to completely contain the image area obtained by multiplying the largest width ( l1 and l2 ) and the copying magnification together ( step s422 ). this allows selection of an appropriate size of copying paper in copying the image area at a desired magnification , and prevents copying paper from being wasted . in the copying machine of this embodiment , since the image area can be accurately detected in either step s410 or step s420 of said mode process ( step s400 ), the process below can be carried out for regions outside the image area such as the background portion . fig1 is a flowchart of the background process ( step s500 ). first , whether or not the mode to detect the image area has been set by the user is examined . when the manual process mode has been set by the user ( yes in step s501 ), the special process for the background is not executed ( step s502 ). on the other hand , when either the automatic magnification selection mode ( i = 0 ) or automatic paper selection process mode ( i = 1 ) has been set by the user ( no in step s501 ), the value of background process parameter j that has been set is examined ( step s502 ). when j = 0 , the special process for the background is not executed ( step s503 ). when j = 1 , the color of the background is removed ( step s504 ). the removal of the background color here means to set the value of the density data of the region outside the image area detected in either step s410 or step s420 of said mode process ( step s400 ) to a default value . the default value of the background color is set in the copying machine beforehand ( for example white ). when j = 2 , the background color is converted to another color ( step s505 ). the color conversion is carried out by converting the density data of the region outside the image area detected in either step s410 or step s420 of said mode process ( step s400 ) to a color set by the user . although the present invention has been fully described by way of examples with reference to the accompanying drawings , it is to be noted that various changes and modifications will be apparent to those skilled in the art . therefore , unless otherwise such changes and modifications depart from the scope of the present invention , they should be construed as being included therein .