An image forming apparatus comprising: a line width detection unit configured for detecting a width of a line contained in image data from attribute data corresponding to said image data, wherein detecting includes selecting attribute data which is a target of processing for correcting a line width, from the attribute data; an edge detection unit configured for detecting an edge pixel from said image data; a storage unit configured for storing a line width correction coefficient corresponding to a line width; and a correction unit configured for acquiring a line width correction coefficient corresponding to said line width detected by said line width detection unit from said storage unit with regard to said edge pixel, and configured for correcting a gradation of said edge pixel through the use of said line width and said line width correction coefficient, thereby correcting said line width; wherein said line width detection unit includes: an erosion processing unit configured for performing erosion processing on said attribute data through the use of one of a filter formed from a one by one matrix of pixels to a filter formed from an "n" by "n" matrix of pixels; a first dilation processing unit configured for performing dilation processing on said erosion processing using the filter formed from each matrix of pixels through the use of a filter having a size equal to that of the filter used in said erosion processing; a second dilation processing unit configured for performing dilation processing on said erosion processing using the filter formed from each matrix of pixels through the use of a filter having a size larger by two pixels than that of the filter used in said erosion processing; and a line width output unit (307, 311) configured for outputting a first line width as a result of the processing in said first dilation processing unit and a second line width as a result of the processing in said second dilation processing unit. a line width detection unit configured for detecting a width of a line contained in image data from attribute data corresponding to said image data, wherein detecting includes selecting attribute data which is a target of processing for correcting a line width, from the attribute data; an edge detection unit configured for detecting an edge pixel from said image data; a storage unit configured for storing a line width correction coefficient corresponding to a line width; and a correction unit configured for acquiring a line width correction coefficient corresponding to said line width detected by said line width detection unit from said storage unit with regard to said edge pixel, and configured for correcting a gradation of said edge pixel through the use of said line width and said line width correction coefficient, thereby correcting said line width; wherein said line width detection unit includes: an erosion processing unit configured for performing erosion processing on said attribute data through the use of one of a filter formed from a one by one matrix of pixels to a filter formed from an "n" by "n" matrix of pixels; a first dilation processing unit configured for performing dilation processing on said erosion processing using the filter formed from each matrix of pixels through the use of a filter having a size equal to that of the filter used in said erosion processing; a second dilation processing unit configured for performing dilation processing on said erosion processing using the filter formed from each matrix of pixels through the use of a filter having a size larger by two pixels than that of the filter used in said erosion processing; and a line width output unit (307, 311) configured for outputting a first line width as a result of the processing in said first dilation processing unit and a second line width as a result of the processing in said second dilation processing unit. an erosion processing unit configured for performing erosion processing on said attribute data through the use of one of a filter formed from a one by one matrix of pixels to a filter formed from an "n" by "n" matrix of pixels; a first dilation processing unit configured for performing dilation processing on said erosion processing using the filter formed from each matrix of pixels through the use of a filter having a size equal to that of the filter used in said erosion processing; a second dilation processing unit configured for performing dilation processing on said erosion processing using the filter formed from each matrix of pixels through the use of a filter having a size larger by two pixels than that of the filter used in said erosion processing; and a line width output unit (307, 311) configured for outputting a first line width as a result of the processing in said first dilation processing unit and a second line width as a result of the processing in said second dilation processing unit.