When a color image is input, a histogram is generated for each primary
color, and a luminance value having the highest frequency is obtained.
Next, a luminance value that will become a background candidate is decided
in the neighborhood of the luminance value having the highest frequency
for each primary color. A value equal to or larger than the decided
luminance value is defined to be a background candidate. Additionally, a
background color is decided within a background candidate luminance area.
By replacing the pixels within the background candidate luminance area
with the decided background color, a reverse-side visible portion is
removed while maintaining the appearance of the background.