peter.murray.rust
peter.murray.rust

Reputation: 38063

reconstructing line diagrams from subpixel rendering

I wish to interpret potentially monochrome bitmaps which appear to have been antialiased or compressed through JPEGS. Here is an example:

enter image description here

Although it appears monochrome magnification shows: enter image description here

Where have the colours come from? If we assume the original was monochrome (black + white) with sharp edges can we use this information to reconstruct the original (with less loss than simple image analysis)? If so is there a F/OSS library (Java preferred) to do it?

NOTE: I have altered the title because of @duskwuff's answer

Also the non-text seems to be grayscale (as implied by @duskwuff). Is this antialiasing? and can it be reconstructed?

enter image description here

Upvotes: 0

Views: 137

Answers (1)

denver
denver

Reputation: 3135

Where do they come from? The original was most likely not really monochrome. It is common to use varying shades of grey to help reproduce a straight line. Zoomed in it may not look the best, but at the intended display scale this makes the pseudo binary image look better. Did you look at the original to confirm it is really monochrome?

Remember you are looking at a sampled version of the line. If they sample using linear interpolation (will look like what you have) it looks better then if they had done nearest neighbor (will be strictly monochrome).

If you wish to convert to monochrome you need to threshold the image to make it binary. Simply loop through each pixel and if the value is <128 make it zero and if it is >=128 make it 255.

Upvotes: 1

Related Questions