Bug 687345 - Image interpolation problem at a band boundary
Summary: Image interpolation problem at a band boundary
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Graphics Library (show other bugs)
Version: master
Hardware: PC Windows XP
: P2 normal
Assignee: leonardo
URL:
Keywords: bountiable
Depends on:
Blocks:
 
Reported: 2004-03-05 08:09 UTC by Igor Melichev
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
chess-.ps (60.44 KB, application/postscript)
2004-03-05 08:11 UTC, Igor Melichev
Details
455690-.pdf (3.44 KB, application/pdf)
2004-03-06 16:17 UTC, Igor Melichev
Details
455690-1.pdf (39.33 KB, application/pdf)
2008-02-02 07:13 UTC, leonardo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Melichev 2004-03-05 08:09:06 UTC
Detected with a.pdf using same method as described in the bug 687342.
Likely 119-10.ps, 119-47.ps and many others have same problem.
Likely chess.ps have same problem when drowing a cached character 
raster "(\265) 72 474 T". Likely 455690.pdf have same problem as chess.ps .

Use CVS HEAD after gxfill.c revision 1.116 .
Comment 1 Igor Melichev 2004-03-05 08:11:15 UTC
Created attachment 530 [details]
chess-.ps

A reduced chess.ps .
Comment 2 Igor Melichev 2004-03-06 09:33:22 UTC
Oops, chess-.ps is a different problem. Please ignore it here together with 
455690.pdf .
Comment 3 Igor Melichev 2004-03-06 16:16:52 UTC
See bug 687348 about chess-.ps .
455690.pdf has a problem related to this bug.
Comment 4 Igor Melichev 2004-03-06 16:17:45 UTC
Created attachment 534 [details]
455690-.pdf

Attached a reduced 455690-.pdf with a single bitmap.
Comment 5 Dan Coby 2004-03-16 00:19:29 UTC
Testing using 455690-.pdf  - No differences. (both with and without 
interpolation)

Testing using 119-10.ps - At 300 dpi, a single line of differences.
Comment 6 Raph Levien 2004-06-23 11:10:00 UTC
This may be related to the image interpolation problem described in bug 687039.
Comment 7 Raph Levien 2004-06-23 11:11:48 UTC
Ignore comment #6, please. It was submitted to the wrong bug.
Comment 8 Timothy Osborn 2007-08-02 12:04:23 UTC
As in comment #5 I found that there is no difference with the simplified
455690-.pdf. However I did find a 2 areas of difference (Diff Count: 12) with
the original full PDF 455690.pdf.

Unlike comment #5 I did not see any difference with 119-10.ps.

Used r8170/Mac OS X/commands as described in bug 687342.
Comment 9 Henry Stiles 2008-01-01 21:20:24 UTC
like bug 687342 the output is correct if high level images are disabled.  I did
not investigate further.  As noted the problem is not reproducible in the
diminutive test case, but 455690.pdf in the comparefiles directory of the
regression suite does show the problem.
Comment 10 leonardo 2008-02-02 07:13:07 UTC
Created attachment 3763 [details]
455690-1.pdf

Another reduced test that reproduces the problem with current HEAD.
Comment 11 leonardo 2008-02-02 07:40:43 UTC
Commands to reproduce :

..\..\gs-hd\bin\gswin32c.exe -IF:/AFPL/gs-hd/lib;f:\afpl\fonts -r300 -
dMaxBitmap=100000    -dNOPAUSE -dBATCH -dNOOUTERSAVE -sDEVICE=ppmraw -
sOutputFile=cur-b.ppm -dLastPage=1 decompr-455690-1.pdf
..\..\gs-hd\bin\gswin32c.exe -IF:/AFPL/gs-hd/lib;f:\afpl\fonts -r300 -
dMaxBitmap=100000000 -dNOPAUSE -dBATCH -dNOOUTERSAVE -sDEVICE=ppmraw -
sOutputFile=cur-n.ppm -dLastPage=1 decompr-455690-1.pdf
F:\AFPL\fuzzy\Debug\fuzzy.exe -t 0 -w 1 -c cur-b.ppm cur-n.ppm diff.bmp

Note it is not reproducible with default MaxBitmap. The attachment 534 [details] does not 
reproduce the problem with current HEAD, don't know why so.
Comment 12 leonardo 2008-02-02 07:56:54 UTC
The effect has no dependance on the value of MaxBitmap parameter. I tried 
100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 
1000000, 2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 
9000000, 10000000 - all gave same output. So I think the problem is not related 
to band boundary, but need to check how the image is placed on the page while 
working through clist.
Comment 13 leonardo 2008-02-02 09:23:33 UTC
clist_image_plane_data recieves image data devided into blocks with the source 
image reader buffering. Then clist_image_plane_data places each block to those 
bands which are covered by the block. I guess the block origin is rounded to 
integral pixels either when writing to clist, or when reading from clist. It 
can explain why no dependence on the band boundary : the rendering artifact can 
happen at a block boundary.
Comment 14 leonardo 2008-02-03 10:25:58 UTC
The file 455690-1.pdf demonstrates a problem with Interpolate=false. penum-
>dda.row.y.step is different for banded anod nobanded rendering :

Noband: dQ=254 dR=437 NdR=379
Banded: dQ=254 dR=437 NdR=380
Comment 15 leonardo 2008-02-03 10:31:54 UTC
Correction to the last comment :

Noband: dQ=254 dR=438 NdR=379
Banded: dQ=254 dR=437 NdR=380
Comment 16 leonardo 2008-02-04 14:19:08 UTC
A partial fix to HEAD for image scaling only :
http://ghostscript.com/pipermail/gs-cvs/2008-February/008101.html
Comment 17 leonardo 2008-02-12 12:34:09 UTC
One more patch to HEAD :
http://ghostscript.com/pipermail/gs-cvs/2008-February/008106.html

Now the list of banded/unbanded raster differences reduces to this :

"034-01.ps" 
"148-11.ps" 
"A-12-3480-0109-5.pdf" 
"a.pdf" 
"Altona.Page_3.2002-09-27.pdf" 
"Altona_Technical_1v1_x3.pdf" 
"B-12-3077-1831-7-001.pdf" 
"Bug687840.pdf" 
"Bug688485.pdf" 
"chilis_black.pdf" 
"chilis_red.pdf" 
"Clarke Tate Manns Chinese.ai" 
"gradmesh.ai" 
"john_clippedimage.pdf" 
"jpx-flowcontrols.pdf" 
"Openhuis_pdf_zw.pdf" 
"rotate0.pdf" 
"rotate180.pdf" 
"rotate270.pdf" 
"rotate90.pdf" 
"SmoothShading.pdf" 

Some of them may be not images.
Comment 19 leonardo 2008-02-20 13:15:57 UTC
One more patch to HEAD :
http://ghostscript.com/pipermail/gs-cvs/2008-February/008120.html

After this patch we still have the following banded-unbanded raster 
differences :

Images :
Bug687840.pdf
john_clippedimage.pdf 
jpx-flowcontrols.pdf 
rotate0.pdf 
rotate180.pdf 
rotate270.pdf 
rotate90.pdf 

Not images :
034-01.ps 
Bug688485.pdf
chilis_black.pdf
chilis_red.pdf
Clarke Tate Manns Chinese.ai
gradmesh.ai
Openhuis_pdf_zw.pdf
SmoothShading.pdf
Comment 20 leonardo 2008-02-21 12:35:14 UTC
Problems with rotate*.pdf is not related to image rendering, but an image is 
necessary to show it. The reason for raster difference is that a clipping 
region appears different with banding and with no banding. Since it is not an 
image rendering, we'll not work on it within this bug.
Comment 21 leonardo 2008-02-21 12:41:23 UTC
With john_clippedimage.pdf  raster difference dissappears when I remove 
clipping from the PDF file. So it is same problem as one in Comment #20.
Comment 22 leonardo 2008-02-21 12:50:13 UTC
Bug687840.pdf demonstrates same problem as one in Comment #21.
Comment 23 leonardo 2008-02-21 12:55:44 UTC
jpx-flowcontrols.pdf demonstrates same problem as one in Comment #21.
Comment 24 leonardo 2008-02-21 13:00:43 UTC
Thus we have no image problems now, so I'll close this bug. Will move resting 
problems to new bug 689715.
Comment 25 leonardo 2008-02-22 12:19:56 UTC
One more patch to HEAD :
http://ghostscript.com/pipermail/gs-cvs/2008-February/008123.html
Comment 26 leonardo 2008-02-23 20:12:32 UTC
One more patch toi HEAD :
http://ghostscript.com/pipermail/gs-cvs/2008-February/008127.html
Comment 27 leonardo 2008-02-24 01:23:36 UTC
One more patch to HEAD :
http://ghostscript.com/pipermail/gs-cvs/2008-February/008128.html