4 Replies Latest reply on Apr 2, 2018 9:32 AM by G.Hoffmann
      • 1. Re: Problem exporting w/ Transparent Background
        Mylenium Most Valuable Participant

        Transparency doesn't delete any pixels of other channels. You are mistaken about that. It's really just a way of masking. Hence tools that aren't so smart about handling transparency may indeed destroy the transparency info and the original content reappear.

         

        Mylenium

        1 person found this helpful
        • 2. Re: Problem exporting w/ Transparent Background
          Theresa J Adobe Community Professional

          Can you share the layer panel where you removed the background originally? Did you mask the background?

          It still seems weird to me that the background can be recovered (even unintentionally) from the exported png. Did you try the legacy save for web instead? I’m just curious if you would see the same issue.

          1 person found this helpful
          • 3. Re: Problem exporting w/ Transparent Background
            Doc_Pit Level 1

            I selected the two figures, inverted the selection, and deleted (with the delete key) the background.  No masking.

             

            In a second attempt, I duplicated the layer with the deleted (now transparent) background into a new file, saved that file, then exported from that file, saving as a .png with transparency.  I thought that would preclude any information from any other layer finding its way into the exported file.  All that makes sense if, in fact, deleting the background means actually destroying/discarding the pixels.  Apparently, Mylenium is correct; that information is being masked rather than discarded even though no actual masking occurred.

             

            If I open that .png file in another program, like Paint, the background appears white rather than transparent.

             

            Many thanks for your responses.

            • 4. Re: Problem exporting w/ Transparent Background
              G.Hoffmann Level 4

              With special reference to Theresa, #2:

               

              Quote 1:

              https://www.w3.org/TR/2003/REC-PNG-20031110/#11transinfo

              Portable Network Graphics (PNG) Specification (Second Edition)

              The colour values in a pixel are not premultiplied by the alpha value assigned to the pixel.

              This rule is sometimes called "unassociated" or "non-premultiplied" alpha. (Another

              common technique is to store sample values premultiplied by the alpha value; in effect,

              such an image is already composited against a black background. PNG does not use

              premultiplied alpha. In consequence an image editor can take a PNG image and easily

              change its transparency.)

               

              Quote 2:

              https://en.wikipedia.org/wiki/Portable_Network_Graphics

              Transparency of image

              PNG offers a variety of transparency options. With true-color and grayscale images either

              a single pixel value can be declared as transparent or an alpha channel can be added

              (enabling any percentage of partial transparency to be used). For paletted images, alpha

              values can be added to palette entries. The number of such values stored may be less than

              the total number of palette entries, in which case the remaining entries are considered fully

              opaque.

              The scanning of pixel values for binary transparency is supposed to be performed before any

              color reduction to avoid pixels' becoming unintentionally transparent. This is most likely to

              pose an issue for systems that can decode 16-bits-per-channel images (as they must to be

              compliant with the specification) but only output at 8 bits per channel (the norm for all but

              the highest end systems).

              Alpha storage can be "associated" ("premultiplied") or "unassociated", but PNG

              standardized[17] on "unassociated" ("non-premultiplied") alpha so that images with

              separate transparency masks can be stored losslessly.

               

              End of quotes. Bold by me.

               

              So we see, transparency can be encoded by a special number per pixel (like in GIF, my guess)

              or by a adding an alpha channel value per pixel, this for continuous/variable  transparency.

              Only in the second case the image can be recovered in transparent areas.

               

              Best regards --Gernot Hoffmann

              2 people found this helpful