1. An image forming apparatus comprising: an image processing device to compensate at least one of a gray value and a line width of an edge, according to the edge type forming an input image, wherein the image processing device comprises a detection unit to detect an edge of an input image, a categorization unit to categorize the edge into an edge type, according to a gray value and a line width associated with the edge, and a compensation unit to compensate at least one of the gray value and the line width, according to the categorized edge type, and wherein the categorization unit categorizes the edges as rising edges or as falling edges, according to whether a sum of the differences of the gray values of the pixels of the detected edge is positive or negative, and categorizes the falling edges and the rising edges as positive hairlines or as negative hairlines, respectively, according to a comparison with a threshold value (TH_WIDTH) of a predetermined line width, wherein the image is formed of pixels, and the detection unit sequentially sets each of the pixels as a center pixel, and determines whether the center pixel is included in an edge, by comparing a sum of gray value differences between the center pixel and adjacent ones of the pixels with a predetermined gray threshold value, wherein if the sum is positive, the categorization unit categorizes the edge as a rising edge, and if the sum is negative, the categorization unit categorizes the edge as a falling edge, and wherein if the line width of the rising edge is less than a predetermined line width threshold value, the categorization unit cateqorizes the rising edge as a negative hairline, and if the line width of the falling edge is less than the predetermined line width threshold value, the categorization unit categorizes the falling edge as a positive hairline.