Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4156

Possible optimization of SampledImageReader.from8bit by using InterleavedRaster

    XMLWordPrintableJSON

Details

    • Patch

    Description

      I noticed SampledImageReader.from8Bit assumed the source data to be interleaved, which means if the target raster uses an interleaved sample model, the data can by directly copied. 

      This can save 10-15% of total render time in files with large 8-bit images (tested on samples from PDFBOX-2092 , PDFBOX-3791 and the file "gs-bugzilla690022.pdf" from PDFBOX-4151). 

      In PDFBOX-2092 there is a discussion about how the sample model must be Banded, but I couldn't find a place in the code that directly relies on this, and the few tests I have run did not reveal problems. Perhaps the constraint is obsolete, or else it means custom sample models cannot be used? 

      Attachments

        1. interleaved_raster.patch
          4 kB
          Itai Shaked

        Activity

          People

            tilman Tilman Hausherr
            itai Itai Shaked
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: