From dev-return-59945-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Mon Dec 3 15:20:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id F2DE7180645 for ; Mon, 3 Dec 2018 15:20:03 +0100 (CET) Received: (qmail 62376 invoked by uid 500); 3 Dec 2018 14:20:03 -0000 Mailing-List: contact dev-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list dev@pdfbox.apache.org Received: (qmail 62309 invoked by uid 99); 3 Dec 2018 14:20:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2018 14:20:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 8D952C05DD for ; Mon, 3 Dec 2018 14:20:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.001 X-Spam-Level: X-Spam-Status: No, score=-109.001 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id MMNFV5ryJA_x for ; Mon, 3 Dec 2018 14:20:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 42A8E5FB32 for ; Mon, 3 Dec 2018 14:20:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B623CE1013 for ; Mon, 3 Dec 2018 14:20:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 326C924DD7 for ; Mon, 3 Dec 2018 14:20:00 +0000 (UTC) Date: Mon, 3 Dec 2018 14:20:00 +0000 (UTC) From: "Tilman Hausherr (JIRA)" To: dev@pdfbox.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PDFBOX-4391) Page to image rendering in pdfbox 2.0: Poor quality compared to 1.8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PDFBOX-4391?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Tilman Hausherr updated PDFBOX-4391: ------------------------------------ Labels: antialias barcode image quality (was: antialias image quality) > Page to image rendering in pdfbox 2.0: Poor quality compared to 1.8 > ------------------------------------------------------------------- > > Key: PDFBOX-4391 > URL: https://issues.apache.org/jira/browse/PDFBOX-4391 > Project: PDFBox > Issue Type: Bug > Components: Rendering > Affects Versions: 2.0.13 > Environment: Windows 10 > JDK 1.8.0_181 > JDK 1.8.0_192 > Reporter: Olivier M > Priority: Major > Labels: antialias, barcode, image, quality > Fix For: 2.0.14 > > Attachments: barcode-128-BW-antialiasing-off.png, barcode-128.pdf= , barcode-image-1.8.16.png, barcode-image-2.0.13.png, comparison.png > > > I have a process that needs to convert pages of pdf files to images to be= able to detect barcodes. > Since I've upgrade to pdfbox 2.0 my barcodes are not correctly detected a= nymore. > I noticed the cause was the result of the page to image rendering impleme= nted in pdfbox 2.0. > The quality of the image is really poor compared to pdfbox 1.8. > See the attached image (comparison.png): > On the left you have the image generated with pdfbox 2.0.13 > On the right you have the image generated with pdfbox 1.8.16 > We can clearly see the difference. > Both images were generated using the same resolution (200 dpi here): > For 2.0.13: > {code:java} > BufferedImage image =3D pdfRenderer.renderImageWithDPI(0, 200, ImageType.= BINARY);{code} > For 1.8.16: > {code:java} > PDPage page =3D (PDPage) pdfDocument.getDocumentCatalog().getAllPages().g= et(0); > BufferedImage image =3D page.convertToImage(BufferedImage.TYPE_BYTE_BINAR= Y, 200);{code} > Buffered images were both written to files using: > {code:java} > ImageIO.write(image, "png", file);=C2=A0=C2=A0 =C2=A0{code} > I've attached the pdf file (barcode-128.pdf) and the generated images (ba= rcode-image-2.0.13.png and barcode-image.1.8.16.png) > =C2=A0 > =C2=A0 > =C2=A0 > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org For additional commands, e-mail: dev-help@pdfbox.apache.org