You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Dridi Seifeddine <sd...@iptech-group.com> on 2013/10/17 16:36:47 UTC

FOP dithering algorithm

Hello,

I started to look into the implementation of Bayer's dithering algorithm in
FOP and I noticed that it produces wrong results in some cases, different
from what is expected.  If you render the attached FO file to AFP with
dithering enabled, you'll see some artifacts which aren't visible in the
expected AFP document. After experimenting with the settings of the
algorithm, I found out that the problem lies in this expression:  "boolean
dot = !(bayer[i] < ditherIndex - 1)" (see DitherUtils.java, line 121 & 133),
which should be "boolean dot = !(bayer[i] <= ditherIndex - 1)" according to
the literature [0].

Regards,

Seifeddine

[0] Digital Image Processing Laboratory: Image Halftoning
<https://engineering.purdue.edu/~bouman/grad-labs/Image-Halftoning/pdf/lab.p
df> 

   

Re: FOP dithering algorithm

Posted by Pascal Sancho <ps...@gmail.com>.
Hi Dridi,

you should file in a bug in JIRA, attaching all material (source FO
and resulting/expected afp).

2013/10/17 Dridi Seifeddine <sd...@iptech-group.com>:
> Hello,
>
> I started to look into the implementation of Bayer’s dithering algorithm in
> FOP and I noticed that it produces wrong results in some cases, different
> from what is expected.  If you render the attached FO file to AFP with
> dithering enabled, you’ll see some artifacts which aren’t visible in the
> expected AFP document. After experimenting with the settings of the
> algorithm, I found out that the problem lies in this expression:  “boolean
> dot = !(bayer[i] < ditherIndex - 1)” (see DitherUtils.java, line 121 & 133),
> which should be “boolean dot = !(bayer[i] <= ditherIndex - 1)” according to
> the literature [0].
>
> Regards,
>
> Seifeddine
>
> [0] Digital Image Processing Laboratory: Image Halftoning
>
> <<...>> <<...>> <<...>>



-- 
pascal