[ https://issues.apache.org/jira/browse/PDFBOX-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13923717#comment-13923717 ]
John Hewson edited comment on PDFBOX-1963 at 3/7/14 12:48 PM: -------------------------------------------------------------- {quote} And the "new" method should render directly into the graphics context of the bufferedimage. This does work, I just tested it. I.e. just converting from the rgb image would be suboptimal. {quote} Yep, that's what I had in mind. I'll check that PDFBox can do this without braking any internal assumptions about A/RGB and if it does break any assumptions then we can fix those assumptions. A quick skim read looks like it will be fine to me. The issue I was concerned about is that images embedded in PDF files are always converted to RGB or ARGB internally by PDFBox and are usually rendered to an ARGB or RGB page. By making the page BITONAL I was worried about Graphics2D#drawImage performing slow color conversions which we have seen it do in the past with CMYK images. was (Author: jahewson): {quote} And the "new" method should render directly into the graphics context of the bufferedimage. This does work, I just tested it. I.e. just converting from the rgb image would be suboptimal. {quote} Yep, that's what I had in mind. I'll check that PDFBox can do this without braking any internal assumptions about A/RGB and if it does break any assumptions then we can fix those assumptions. A quick skim read looks like it will be fine to me. The issue I was concerned about is that images embedded in PDF files are always converted to RGB or ARGB internally by PDFBox and are usually rendered to an ARGB or RGB page. By making the page BITONAL I was worried about Graphics2D#drawImage performing slow color conversions which we have seen it do in the past with CMYK images. > PDFImageWriter doesn't make use of PDFStreamEngine > -------------------------------------------------- > > Key: PDFBOX-1963 > URL: https://issues.apache.org/jira/browse/PDFBOX-1963 > Project: PDFBox > Issue Type: Improvement > Components: Utilities > Affects Versions: 2.0.0 > Reporter: John Hewson > Assignee: John Hewson > Fix For: 2.0.0 > > > PDFImageWriter is a subclass of PDFStreamEngine, however it never uses any of > its functionality, the writeImage methods could be marked as static and > behave in the same manner. > The relationship between PDFImageWriter, RenderUtil, and ImageIOUtil no > longer matches its historical origins and needs to be refactored. -- This message was sent by Atlassian JIRA (v6.2#6252)