A contour pixel is extracted from binarized image data. The contour of the
image data is approximated to a straight line based on the extracted
contour pixel. It is determined whether a first straight line in the
contour obtained by the straight-line approximation includes a portion to
be kept straight in the curved-line approximation, based on the
relationship between the first straight line and a second straight line
connected to the first straight line. In a case where it is determined
that the first straight line includes a portion to be kept straight,
curved-line approximation is performed by setting a control point on the
first straight line at a position closer to an end of the first straight
line connected to the second straight line with respect to a midpoint of
the first straight line.