1. An image processing apparatus, comprising: a memory to store determination conditions; and at least one processor or circuitry or a combination thereof configured to, acquire image data of a scanned document from a scanner, determine a document type of the scanned document from the image data, extract a feature element from the image data, the feature element selected from a plurality of feature element types, the plurality of feature element types including at least a dividing line element type, a virtual dividing line element type, a specific character element type, and a picture element type, determine whether the extracted feature element satisfied conditions defined in the determination conditions associated with the selected feature element type and the determined document type, set an attribute of an area of the image data corresponding to the extracted feature element based on the determination conditions, and compress the image data corresponding to the area based on the set attribute of the area.