8 Replies Latest reply on Mar 26, 2008 7:43 AM by Newsgroup_User

    Mask from transparent Photoshop image

    Bob Pierce Level 1
      Targeting player 7, is there a straightforward way to make a shape from the non-transparent areas of an imported bitmap? By straightforward I mean other than breaking apart the bitmap and selecting the non-transparent areas with the magic wand and deleting them. I have a number of product images with transparent backgrounds and I want to make masks the same shape as the products.
        • 1. Re: Mask from transparent Photoshop image
          Level 7
          Hello Bob,

          > Targeting player 7, is there a straightforward way to make a shape
          > from the non-transparent areas of an imported bitmap? By
          > straightforward I mean other than breaking apart the bitmap and
          > selecting the non-transparent areas with the magic wand and deleting
          > them. I have a number of product images with transparent backgrounds
          > and I want to make masks the same shape as the products.
          >

          Use "Blend" option for MC ("Alpha" or "Erase").


          • 2. Re: Mask from transparent Photoshop image
            Level 7
            > Use "Blend" option for MC ("Alpha" or "Erase").

            + with "Layer" blend a top.


            • 4. Re: Mask from transparent Photoshop image
              Level 7
              Hello rlc5611,

              > For Flash 7?

              You are right. I've missed this one...
              Certainly, this is available only for 8+


              • 5. Re: Mask from transparent Photoshop image
                Bob Pierce Level 1
                Thanks for the input. Maybe it's time to move on from Flash 7! The blend mode approach doesn't quite do what I want - unless I've misunderstood something. This is what I'm trying to do:

                this.blendMode = "layer";
                bitmap_mc.blendMode = "erase";
                maskee_mc.setMask(bitmap_mc);

                Without the 3rd line, bitmap_mc successfully knocks it's own shape out of mcs below it. But when set as a mask it knocks out it's containing rectangle. If instead of blend I manually delete the "transparent" areas from the bitmap I get the required result. It's difficult to understand the difference between the bitmap I produce this way and the original imported .psd file with the same transparent areas.
                • 6. Re: Mask from transparent Photoshop image
                  Level 7
                  Hello Bob,

                  > Thanks for the input. Maybe it's time to move on from Flash 7! The
                  > blend mode approach doesn't quite do what I want - unless I've
                  > misunderstood something. This is what I'm trying to do:
                  >
                  > this.blendMode = "layer";
                  > bitmap_mc.blendMode = "erase";
                  > maskee_mc.setMask(bitmap_mc);
                  > Without the 3rd line, bitmap_mc successfully knocks it's own shape
                  > out of mcs below it. But when set as a mask it knocks out it's
                  > containing rectangle. If instead of blend I manually delete the
                  > "transparent" areas from the bitmap I get the required result. It's
                  > difficult to understand the difference between the bitmap I produce
                  > this way and the original imported .psd file with the same transparent
                  > areas.


                  You are absolutely right about concealing difference between blend feature
                  and actual transparency in imported images (.psd, .png).
                  However, I suppose this was just a first step of adobe (initially macromedia
                  team) back to Director ideas of masking (it was perfectly marvelous there).
                  When you need to mask an image with some predefined mask it's much easier
                  to use images that already have transparency (.png is the choice). Nevertheless,
                  think of situation when you are dynamically (via AS) building complex mask:
                  you can use BitmapData class to scan, for example, an image and build your
                  mask on the basis of this scan with further option to apply different blending
                  modes on the fly. Need more vivid example? No problemo: for instace, you
                  are making some dynamic gallery or e-shop frontend, all your photos are initially
                  made for easier keying feature (on some solid color background. most often
                  green or blue), and you need to use these photos to be displayed semi-transparent.
                  Of couse, you can use photoshop (processing images like a sort of a robot...),
                  but you can use the method I've described above (letting you flash work over
                  the photos and making it possible for you to spend much more time with sweet
                  chicks d^_^b or beer, or whatever you like). The choice is yours )))


                  • 7. Re: Mask from transparent Photoshop image
                    Bob Pierce Level 1

                    Interesting! But an imported .png with transparency doesn't work as a mask. Are you saying that by using BitmapData class I can convert it to something that does?
                    • 8. Re: Mask from transparent Photoshop image
                      Level 7
                      Hello Bob,

                      > Interesting! But an imported .png with transparency doesn't work as a
                      > mask. Are you saying that by using BitmapData class I can convert it
                      > to something that does?

                      Exactly. Reading an image bit-by-bit -> processing them for your purpose
                      -> creating necessary graphics (for masking via blend) -> applying blending
                      ) I personally didn't run the whole process above, but separately - yes )