Return-Path: X-Original-To: apmail-pdfbox-dev-archive@www.apache.org Delivered-To: apmail-pdfbox-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DE7E29D0F for ; Fri, 18 May 2012 09:42:32 +0000 (UTC) Received: (qmail 37435 invoked by uid 500); 18 May 2012 09:42:32 -0000 Delivered-To: apmail-pdfbox-dev-archive@pdfbox.apache.org Received: (qmail 37255 invoked by uid 500); 18 May 2012 09:42:31 -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 37213 invoked by uid 99); 18 May 2012 09:42:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2012 09:42:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2012 09:42:28 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 91F2FCBBF for ; Fri, 18 May 2012 09:42:08 +0000 (UTC) Date: Fri, 18 May 2012 09:42:08 +0000 (UTC) From: =?utf-8?Q?Andreas_Lehmk=C3=BChler_=28JIRA=29?= To: dev@pdfbox.apache.org Message-ID: <824617142.13354.1337334128607.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <485702683.2540.1328546639173.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (PDFBOX-1223) Strange color issues with convertToImage method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/PDFBOX-1223?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Andreas Lehmk=C3=BChler updated PDFBOX-1223: --------------------------------------- Issue Type: New Feature (was: Bug) =20 > Strange color issues with convertToImage method > ----------------------------------------------- > > Key: PDFBOX-1223 > URL: https://issues.apache.org/jira/browse/PDFBOX-1223 > Project: PDFBox > Issue Type: New Feature > Affects Versions: 1.6.0 > Reporter: Jimi Hulleg=C3=A5rd > Labels: colorspaces, convertToImage, rendering, transparent > Attachments: case1.pdf, case1.png, case2.pdf, case2.png, case3.pd= f, case3.png, case4.png > > > While testing PDFBox I noticed a few strange color issues when converting= the first page of an pdf to an image using the method convertToImage on a = PDPage. An example pdf and resulting png is attached for each case. > - Case 1: Most of the colors seem to get inverted. > - Case 2: The green color of the area in the top right is paler the the o= riginal, and the text under the logo at the bottom right is quite "pixely" > - Case 3: The blue area under the text is missing > - Case 4: The red area should be semi-transparent (so the rose stem can b= e seen behind it), not solid. > I compared all resulting images with how the pdf looks in Foxit Reader 5.= 1 on Windows 7. > This is the code I used: > --------- > PDFParser parser =3D new PDFParser(new FileInputStream(pdfInputFile)); > parser.parse(); > PDDocument document =3D parser.getPDDocument(); > List pages =3D (List)document.getDocumentCatalog().getAll= Pages(); > if (pages.size() > 0) { > =09PDPage page =3D pages.get(0); > =09BufferedImage image =3D page.convertToImage(BufferedImage.TYPE_INT_RGB= , 300);=09=09 > =09ImageIO.write(image, "png", pngOutputFile); > } > --------- > If there is some change I can do in my code or some configuration to impr= ove some of these issues, then I would love to hear about it. As a comparis= on, Ghost4j (with Ghostscript underneath) can handle these cases better. Ev= en the text under the logo in case 2 was less "pixely", with the same resol= ution. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira