1. A method for generating an electronic document by processing an image, comprising: obtaining an image comprising a connected component comprising a plurality of pixels, wherein the image further comprises a writing board and the connected component that is drawn on the writing board with a marker, and wherein the plurality of pixels comprise a plurality of colors due to noise factors associated with the marker; calculating, by a processor, a representative color for the plurality of colors; mapping, by the processor, the representative color to an application color in an application color palette of an application; and generating, by the processor, the electronic document comprising a revised version of the connected component entirely in the application color.