Bug 694375 - antialiasing in b&w PDF images (XObject Image)
Summary: antialiasing in b&w PDF images (XObject Image)
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: unspecified
Hardware: PC Windows 7
: P4 normal
Assignee: Robin Watts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-25 15:53 UTC by michel.onoff
Modified: 2013-10-01 05:28 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
0001-Disable-image-interpolation-with-a-hint.patch (7.02 KB, application/octet-stream)
2013-07-02 12:33 UTC, Robin Watts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description michel.onoff 2013-06-25 15:53:04 UTC
I just upgraded from MuPDF 0.9 to MuPDF 1.2.

While the appearance of text is quite similar upon rendering with the two versions, b&w images appear differently, presumably because of different antialiasing algorithms. Antialiasing makes the images appear much more smoothed in version 1.2 than in 0.9.

This, in turn, causes troubles in barcode recognition software that fails to recover many barcodes after a PDF document has been rendered with 1.2, while it worked satisfactorily with 0.9. I guess this is caused by the lower contrast in the smoother rendering of 1.2.

The antialias flag of mudraw (-b) does not seem to affect images (while it clearly affects text, for example).

Is there a way to control antialiasing in image rendering?
Comment 1 Robin Watts 2013-07-02 12:33:39 UTC
Created attachment 10041 [details]
0001-Disable-image-interpolation-with-a-hint.patch

The attached patch should disable image interpolation when -b 0 is used.

Can you try this out and let us know if it solves the problem please?

I'd love to see an example file that shows the problem please.
Comment 2 michel.onoff 2013-07-02 14:00:07 UTC
I'm on Windows, with a binary installation of MuPDF, so applying the patch is not feasible in my environment. Is there a Windows build to download?

Unfortunately, I cannot publish an example since the 2D DataMatrix barcodes which cause the problem contain information considered confidential (personal data of customers). However, I guess that interpolation is quite visible in most PDFs that include 2D barcodes.

If I'll stumble across a publicly available PDF containing a 2D barcode I'll upload it here.
Comment 3 Robin Watts 2013-10-01 05:28:19 UTC
Committed as:

commit 6a6284ddfa453f909ba6576b85166b7cf26941ee
Author: Robin Watts <robin.watts@artifex.com>
Date:   Tue Jul 2 13:30:37 2013 +0100

    Disable image interpolation with a hint.

    Set the hint in mudraw when AA bits is set to 0.