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

SoftMask needs consider colormodel of input Image

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.0.5, 3.0.0 PDFBox
    • Component/s: Rendering
    • Labels:
      None
    • Flags:
      Patch

      Description

      I'm currently following a rendering problem of a poster. While doing so I found a first lead, that resulted in a first patch.

      The PDF I'll attach contains an image with a mask applied to it. If rendering works correctly, only a single green "OK" should be visible. With pdfbox 2.0.3 and HEAD I get a white sheet.

      I tracked this down into SoftMask.java. There a source raster is sampled by querying the pixel data via getPixel(int,int,int[]). This will only work correctly for RGBA input sources. In my case the input image is an RGB image and getPixel does not overwrite the initial 0 value in the rgba value array.

      The attached patch uses the colormodel corresponding to the source raster to convert into the components. This correctly returns the alpha value of an RGB image as 255.

        Attachments

        1. softmask.patch
          32 kB
          Matthias Bläsing
        2. MaskRendering.pdf
          15 kB
          Matthias Bläsing

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                mblaesing Matthias Bläsing
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: