text: the embodiments are related to a method of temporarily saving part of bit information to be reduced by an error diffusion process and suppressing degradation of the image quality caused by reduction of the bit width when the bit width of image data is reduced to decrease the data amount in storing data having undergone an image process in a storage means such as a frame memory or memory card in a case in which the number of quantization bits is increased for a high - precision digital image process in a digital image processing apparatus such as a digital camera or digital video camera , or the bit width increases due to a digital image process having a precision higher than the quantization step of image data . the embodiments are also related to a method of performing a level shift process or digital clamping process at a precision higher than the quantization step of image data without increasing the bit width of image data by an error diffusion process . in the embodiments , when lower bits of pixel data are to be cut , the quantization step is added to the reduced pixel data at a probability corresponding to data of lower bits to be cut . for example , a predetermined random number having the same bit width as that of data of lower bits to be cut is generated , and compared with the data of lower bits to be cut . if the random number is smaller or equal , the quantization step is added ; if the random number is larger , no quantization step is added . the quantization step can be added to reduced pixel data at a probability corresponding to the data of lower bits to be cut . if the number of lower bits to be cut is four and data is “ 1000 ” by a binary expression , the data is compared with a predetermined 4 - bit random number , and the quantization step is added at a probability of 50 %. according to another aspect of the embodiments , when the level of digital image data is to be shifted , the level shift is performed by a general addition / subtraction circuit for a part , equal to or higher than the quantization step , of a level shift value having a precision higher than the quantization step . the quantization step is added / subtracted to / from a part lower than the quantization step at a probability corresponding to the data . in this manner , the level is shifted at a precision equal to or higher than the quantization step . for example , when a 14 - bit value having four bits as bit positions lower than the quantization step is to be subtracted from a given area of image data having 10 quantization bits , 10 bits equal to or higher than the quantization step are directly subtracted from the image data . as for the four bits lower than the quantization step , pixels are selected at random from the area at a ratio corresponding to the figure of the four bits , and one bit of the quantization step is subtracted from only the selected pixels . this means that the 14 - bit value is equivalently subtracted from the 10 - bit image data in the entire area . this method hardly increases the number of image data bits , and can implement subtraction at a precision equal to or lower than the quantization step of original image data without increasing the data capacity . according to still another aspect of the embodiments , the clamping level is calculated at a precision higher than the quantization step of digital image data . subtraction is done by a general integer subtraction circuit for part of the quantization step that is equal to or higher than the quantization step . the quantization step is subtracted from pixel data at a probability corresponding to data of the clamping level that is lower than the quantization step . as a result , clamping is executed at a precision higher than the quantization step . for example , the average value of the black level area of image data having 10 quantization bits is calculated by 10 - bit integral part + 4 - bit decimal part = 14 bits to obtain the clamping level at a precision higher than the quantization step of original image data . the 10 - bit integral part is subtracted by an integer subtraction circuit from an image area to be clamped . the number of quantization bits is subtracted from the pixels of the image area to be clamped at a probability corresponding to the value of the 4 - bit decimal part . the digital clamping process can be done at a precision higher than the quantization step of an original image without increasing the data amount . the embodiments of the present invention will be described in detail below with reference to the accompanying drawings . fig2 a and 2b are views for explaining a principle according to the first embodiment of the present invention . fig2 a is a view showing a partial area ( 6 × 6 pixels ) of digital image data . a figure in each square ( pixel ) is image data representing the brightness of an image . the quantization step of image data is represented as llsb by using a unit “ lsb ( least significant bit )”. for example , when the number of quantization bits of image data ( the number of quantization steps ) is eight , 256 brightness levels ( e . g ., 0lsb to 255lsb ) can be expressed . that is , the image in fig2 a uniformly has a brightness of 5lsb . fig2 b shows the result of subtraction from the image data in fig2 a at a precision equal to or lower than the quantization step ( 1lsb ). in this case , 0 . 25lsb subtraction is exemplified . of 6 × 6 = 36 pixels , 25 % of the pixels = 9 pixels are selected at random , and llsb is subtracted from them . this error diffusion process increases the number of quantization bits , and the brightness level of the entire image area seems to decrease by 0 . 25lsb without increase image data . when pixels in fig2 a and 2b are checked one by one , the brightness level of a given pixel does not change , and that of another pixel decreases by llsb . the brightness level of one pixel does not decrease at a precision equal to or lower than the quantization step . however , the average brightness level of the entire area of interest is 5lsb in fig2 a and 4 . 75lsb in fig2 b . the brightness level of the entire area decreases by 0 . 25lsb , and the image looks darker by 0 . 25lsb to the human eye . subtraction can be equivalently executed at a precision equal to or lower than the quantization step ( 1lsb ). in general , the effect of making the entire area look as if the brightness level of the image were processed at a high precision is enhanced as the number of pixels of the image area subjected to addition / subtraction increases . fig2 a and 2b illustrate a uniform - brightness image in which all pixel data that form the image area are equal to each other . however , for a general object whose brightness is not uniform , addition / subtraction can be equivalently performed at a precision equal to or lower than the quantization step . fig3 is a block diagram showing an example of a circuit configuration according to the first embodiment . for example , image data of an area subjected to addition / subtraction is 8 - bit integral data , and data having a precision of 8 - bit integral part + 4 - bit decimal part = 12 bits is subtracted from the image data . the integral parts of image data and subtraction data are input to a subtraction circuit 10 , and subtracted by integer arithmetic . if no overflow occurs by arithmetic , the subtraction result has eight bits similarly to data before arithmetic . if overflow occurs due to arithmetic , one sign bit is added . the sign bit is represented by s , and the bits of the arithmetic result are represented by s + eight bits . the 4 - bit decimal part of the subtraction data is input to a comparison circuit 12 together with a random number generated by a 4 - bit random number generation circuit 11 . the random number generated by the 4 - bit random number generation circuit takes a value of 0lsb to 15lsb , and these values occur at almost the same probability . the 4 - bit random number generation circuit may be a known m - sequence random number generation circuit . alternatively , the least significant bit of pixel data may be regarded as noise at which 0 and 1 appear equally , and the least significant bit of data of each of four pixels near a pixel of interest may be adopted as each bit value of 4 - bit random number data , thereby generating one 4 - bit random number . alternatively , lower four bits of a pixel of interest or one pixel near the pixel of interest may be regarded as substantially noise data , and a random number may be generated from these four bits . in multitone image data of 10 bits or 12 bits , several lower bits , and especially the least significant bit are often noise components owing to noise of an image sensing element or analog circuit , noise generated by an a / d conversion circuit , or the like . the method of generating a random number from lower bits of image data can generate an almost uniform , preferable random number . the comparison circuit compares a decimal part a of the subtraction data and a 4 - bit random number b . if the decimal part a of the subtraction data is larger than the 4 - bit random number b , a result y of the comparison circuit 12 becomes 1 ; if b is equal to or larger than a , the result y of the comparison circuit 12 becomes 0 . when the 4 - bit decimal part a of the subtraction data takes a value of 0lsb to 15lsb , the 4 - bit random number b takes 16 values 0lsb to 15lsb at random . the probability at which the result y of the comparison circuit 12 becomes 1 is a ÷ 16 . in other words , y becomes 1 at a probability expressed by a numerical value of the decimal part of the subtraction data . the result y of the comparison circuit 12 is input to a subtraction circuit 13 , and further subtracted from the result of the subtraction circuit 10 , sending the difference to the next block . consequently , one is subtracted from an output from the subtraction circuit 10 at a probability expressed by the decimal part a of the subtraction data . this means that the integral part and decimal part a of the subtraction data are equivalently subtracted from entire image data of an area subjected to addition / subtraction . subtraction data having a precision of 8 - bit integral part + 4 - bit decimal part = 12 bits can be subtracted from image data of an 8 - bit integer . if no overflow is caused by arithmetic , the number of quantization bits of original image data is equal to that of the subtraction result . subtraction can be done at a precision higher than the quantization step of image data without increasing the image data . even if overflow occurs due to arithmetic , image data increases by only one bit after arithmetic , and the amount increased from the image data amount before arithmetic is very small . by clipping the overflow part by a clipping circuit or the like , the data amount becomes equal to that of image data before arithmetic . subtraction can be achieved at a precision higher than the quantization step of image data without increasing image data . in this case , an image is expected to hardly deteriorate by the clipping circuit . the second embodiment of the present invention will describe a case in which addition / subtraction at a precision equal to or lower than the quantization step is applied to clamping operation in a digital image process . clamping operation will be called digital clamping . fig4 is a schematic view of a captured image for explaining the digital clamping method . an optical black ( ob ) area is set on the left side of the image , and represents the black level of the image . when attention is paid to a given line , the average of pixels in the ob area is defined as a clamping level . in digital clamping , the clamping level is subtracted from all effective pixels on the line . conventional digital clamping operation can perform subtraction at only the precision of the quantization step . the average of the clamping area can be calculated at a precision equal to or lower than the quantization step . however , the level varies between lines at the quantization step or more in subtraction . this appears as horizontal line noise on the image , degrading the image quality . for example , when the entire effective pixel area has a level of 10lsb , and the clamping level is 5lsb on line 1 and 4lsb on line 2 , the effective pixels of line 1 exhibit 5lsb after digital clamping , and those of line 2 exhibit 6lsb . line 1 and line 2 do not have any difference in the effective pixel level on the image before clamping , but suffer a difference of 1lsb after clamping owing to quantization error noise by digital clamping . this quantization error noise in digital clamping can be greatly reduced by using addition / subtraction at a precision equal to or lower than the quantization step according to the second embodiment . for example , when addition / subtraction is performed at a precision of 0 . 1lsb , quantization error noise decreases to 0 . 1lsb which is smaller by 0 . 9lsb than noise generated when the second embodiment is not applied . this difference clearly appears as a difference in image quality , and digital clamping according to the second embodiment can provide a high image quality . fig5 a to 5 d are graphs for explaining an example of detailed digital clamping operation according to the second embodiment . fig5 a to 5 d pay attention to a given line of image data having 12 quantization bits . the length of the effective pixel area is 24 pixels , and the clamping level calculated by , e . g ., obtaining the average of the ob area is 11 . 625lsb . the clamping level can be represented by a hexadecimal expression “ 00ba ” using a 12 - bit integral part and 4 - bit decimal part . a case in which digital clamping is executed for 12 - bit image data at a precision of 16 bits will be explained . fig5 a shows the state of an original image , and fig5 b shows a state after the integral part “ 11lsb ” of the clamping level is subtracted from the original image . in order to subtract the remaining 0 . 625lsb of the clamping level from the state of fig5 b , some of 24 pixels on one line are selected at a probability represented by the subtraction level ( 0 . 625lsb ), that is , 62 . 5 % of 24 pixels = 15 pixels are selected by using a random number , as shown in fig5 c . the selected pixels are numbered pixels in fig5 c . subtraction of llsb from the selected pixels as shown in fig5 d means subtraction of 0 . 625lsb from one line . as a result , 11 . 625lsb can be equivalently subtracted from the state before digital clamping in fig5 a . this operation is repeated by the number of lines of image data to perform digital clamping in which the image quality is hardly degraded by the quantization error in comparison with the conventional method . as described above , according to the second embodiment , when a predetermined value is added / subtracted to / from a partial or entire area of digital image data , an error is diffused within the area . addition / subtraction can be equivalently done in the entire area at a precision equal to or lower than the quantization step without increasing image data . in an application of the addition / subtraction method to digital clamping , no horizontal line noise is generated by the quantization error . clamping operation can be performed while the image quality is kept high . in level shift of digital image data , a level shift value having a precision higher than the quantization step of the image data can be added / subtracted without increasing the image data capacity . the clamping level can be calculated at a precision higher than the quantization step of image data , and digital clamping can be equivalently performed at a precision higher than the quantization step . the object of the above - described embodiments is also achieved when a storage medium ( or recording medium ) which stores software program codes for realizing the functions of the above - described embodiments is supplied to a system or apparatus , and the computer ( or the cpu or mpu ) of the system or apparatus reads out and executes the program codes stored in the storage medium . in this case , the program codes read out from the storage medium realize the functions of the above - described embodiments , and the storage medium which stores the program codes constitutes the present invention . the functions of the above - described embodiments are realized when the computer executes the readout program codes . also , the functions of the above - described embodiments are realized when an operating system ( os ) or the like running on the computer performs some or all of actual processes on the basis of the instructions of the program codes . furthermore , the present invention includes a case in which , after the program codes read out from the storage medium are written in the memory of a function expansion card inserted into the computer or the memory of a function expansion unit connected to the computer , the cpu of the function expansion card or function expansion unit performs some or all of actual processes on the basis of the instructions of the program codes and thereby realizes the functions of the above - described embodiments . the present invention is not limited to the above embodiments and various changes and modifications can be made within the spirit and scope of the present invention . therefore , to apprise the public of the scope of the present invention the following claims are made .