<p>This looks like JPEG artefacts so I guess the image went through a JPEG compression step at one stage and that permanently introduced noise into the image. The red channel is blurred stronger because JPEG additionally applies chroma subsampling.</p>

<p>I suspect the original image was subpixel rendered as you shouldn't really have anything in the chroma channels for a monochrome input image.</p>

CC BY-SA 4.0
2019-06-28T11:26:56.937Z
I don't think it has been clipped from a screen as it's common to many publishers and (I assume) subpixel rendering is device specific. It seems more likely that it't been automatically rendered to JPEG by a PDF production company (there are only ca 3 main ones) and they probably all use similar JPEG conversions.
peter.murray.rust
CC BY-SA 4.0
2019-07-02T03:11:51.683Z
I was wondering where the red halo was coming from. For a monochrome input this image would only exist in the Y plane so there should be nothing in the chroma channels to cause that artefact. It's possible the image came from a scanner source and there was some chromatic aberration added in from that.
PaulHK
CC BY-SA 4.0
2019-07-03T08:55:09.597Z
It would be very useful to know the source so I'll include an ImageJ ColoInspector3D output which might give some cludes
peter.murray.rust
CC BY-SA 4.0
2019-06-28T09:27:23.833Z
2019-06-28T09:53:08.777Z
2019-06-28T09:53:08.777Z
PaulHK
<p>I am analysing a large number of PDF files from scientific articles, all of which contain images which (I think) were originally monochrome ( black/white). 
The images have been extracted with Apache PDFBox and I am doing image processing on <code>*.png</code>.
The images have severe colour distortion, and blurring which I do not think is due to the extraction process or to subpixel antialising (see <a href="https://stackoverflow.com/questions/16242731/reconstructing-line-diagrams-from-subpixel-rendering">https://stackoverflow.com/questions/16242731/reconstructing-line-diagrams-from-subpixel-rendering</a>). Note that the effect is present on both lines and text.</p>

<p>The effect is present in all PNG files though in different amounts. I suspect it comes from the tool/s used to create the PDFs from the original images which 
apply some softening process (antialising). I have analysed this visually and it consists of a narrow plane in HSV with only two colours mixed with a lot of white/grey/black.</p>

<p>I'd like to know what the algorithm is that creates this blurring and colour so that I can reverse it. Traditional sharpening is only partially successful.
I'd be delighted if anyone has code that does this (any language will do).
<a href="https://i.sstatic.net/iOWh8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iOWh8.png" alt="enter image description here"></a></p>

<p>NOTE: I do not have originals.</p>

<p>UPDATE.
Here are some analyses of the colors with ImageJ ColorInspector3D plugin in YCbCr space</p>

<p>= YCbCr frequencies =
Note the <em>very</em> sharp plane in which the colors lie</p>

<p><a href="https://i.sstatic.net/QvIAN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QvIAN.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/h1c1f.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/h1c1f.png" alt="enter image description here"></a>
and a histogram to show the distribution more clearly. 
<a href="https://i.sstatic.net/UTbw8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/UTbw8.png" alt="enter image description here"></a>
(The red/pink <em>is</em> there on the RH sides - not very clear in this screen shot)</p>

<p>I intend to ask another question on how to sharpen this. (This Q is *where" does the effect arise; the next will be <em>how to correct it</em> even if we don't know the origin)</p>

CC BY-SA 4.0
2019-06-28T06:16:58.960Z
This looks like JPEG artefacts so I guess the image went through a JPEG compression step at one stage and that permanently introduced noise into the image. The red channel is blurred stronger because JPEG applies chroma subsampling.
PaulHK
CC BY-SA 4.0
2019-06-28T09:15:08.923Z
That's really useful and sounds like a very possible cause. If you add it as an answer I'll upvote it .
Is there any way to deconvolute this? I know JPEGs are lossy but we know a lot about the original image.
peter.murray.rust
CC BY-SA 4.0
2019-06-28T09:28:53.893Z
You can mostly clean it up. You can "despeckle" it in photoshop to get rid of the high frequency / random dots. The chroma subsampling is a bit trickier as some parts of the colour space are at lower resolution. As your image is monochrome we could cheat, and just capture the highest resolution colour channel (Green) and reconstruct the monochrome image from that. An even better way would be to convert RGB back to YCrCb space, and then keep only the Y/Luminance channel as these are usually encoded at 1:1 scale unlike the Cr/Cb colour channels.
PaulHK
CC BY-SA 4.0
2019-06-28T09:43:00.090Z
Great suggestions. BTW I am doing this automatically (using https://boofcv.org/ - a great Java library similar to OpenCV.) Maybe I should open a new question for this?
peter.murray.rust
CC BY-SA 4.0
2019-06-28T09:51:08.477Z
Go for it, would be interesting to see other ideas.
PaulHK
<image-processing><antialiasing><blur>
Origin of blurring and colour distortion in monochrome diagrams
peter.murray.rust
# Origin of blurring and colour distortion in monochrome diagrams

(Asked by: username_0 on 2019-06-27)

I am analysing a large number of PDF files from scientific articles, all of which contain images which (I think) were originally monochrome ( black/white).
The images have been extracted with Apache PDFBox and I am doing image processing on `*.png`.
The images have severe colour distortion, and blurring which I do not think is due to the extraction process or to subpixel antialising (see <https://stackoverflow.com/questions/16242731/reconstructing-line-diagrams-from-subpixel-rendering>). Note that the effect is present on both lines and text.

The effect is present in all PNG files though in different amounts. I suspect it comes from the tool/s used to create the PDFs from the original images which
apply some softening process (antialising). I have analysed this visually and it consists of a narrow plane in HSV with only two colours mixed with a lot of white/grey/black.

I'd like to know what the algorithm is that creates this blurring and colour so that I can reverse it. Traditional sharpening is only partially successful.
I'd be delighted if anyone has code that does this (any language will do).
[![enter image description here](https://i.sstatic.net/iOWh8.png)](https://i.sstatic.net/iOWh8.png)

NOTE: I do not have originals.

UPDATE.
Here are some analyses of the colors with ImageJ ColorInspector3D plugin in YCbCr space

= YCbCr frequencies =
Note the *very* sharp plane in which the colors lie

[![enter image description here](https://i.sstatic.net/QvIAN.png)](https://i.sstatic.net/QvIAN.png)
[![enter image description here](https://i.sstatic.net/h1c1f.png)](https://i.sstatic.net/h1c1f.png)
and a histogram to show the distribution more clearly.
[![enter image description here](https://i.sstatic.net/UTbw8.png)](https://i.sstatic.net/UTbw8.png)
(The red/pink *is* there on the RH sides - not very clear in this screen shot)

I intend to ask another question on how to sharpen this. (This Q is \*where" does the effect arise; the next will be *how to correct it* even if we don't know the origin)

**Tags:** image-processing, antialiasing, blur

> **Comments:**
> **username_1**: This looks like JPEG artefacts so I guess the image went through a JPEG compression step at one stage and that permanently introduced noise into the image. The red channel is blurred stronger because JPEG applies chroma subsampling.  
> **username_0**: That's really useful and sounds like a very possible cause. If you add it as an answer I'll upvote it . Is there any way to deconvolute this? I know JPEGs are lossy but we know a lot about the original image.  
> **username_1**: You can mostly clean it up. You can "despeckle" it in photoshop to get rid of the high frequency / random dots. The chroma subsampling is a bit trickier as some parts of the colour space are at lower resolution. As your image is monochrome we could cheat, and just capture the highest resolution colour channel (Green) and reconstruct the monochrome image from that. An even better way would be to convert RGB back to YCrCb space, and then keep only the Y/Luminance channel as these are usually encoded at 1:1 scale unlike the Cr/Cb colour channels.  
> **username_0**: Great suggestions. BTW I am doing this automatically (using https://boofcv.org/ - a great Java library similar to OpenCV.) Maybe I should open a new question for this?  
> **username_1**: Go for it, would be interesting to see other ideas.  

---

## 1 answers

### Answer by username_1 on 2019-06-28. Score: 3 | Accepted answer

This looks like JPEG artefacts so I guess the image went through a JPEG compression step at one stage and that permanently introduced noise into the image. The red channel is blurred stronger because JPEG additionally applies chroma subsampling.

I suspect the original image was subpixel rendered as you shouldn't really have anything in the chroma channels for a monochrome input image.

> **Comments:**
> **username_0**: I don't think it has been clipped from a screen as it's common to many publishers and (I assume) subpixel rendering is device specific. It seems more likely that it't been automatically rendered to JPEG by a PDF production company (there are only ca 3 main ones) and they probably all use similar JPEG conversions.  
> **username_1**: I was wondering where the red halo was coming from. For a monochrome input this image would only exist in the Y plane so there should be nothing in the chroma channels to cause that artefact. It's possible the image came from a scanner source and there was some chromatic aberration added in from that.  
> **username_0**: It would be very useful to know the source so I'll include an ImageJ ColoInspector3D output which might give some cludes  

---

