9 Replies Latest reply on Aug 10, 2011 4:03 AM by Peter Spier

    Stroke transparent image (PNG)

    Mr. Bounce Back

      I'm trying to stroke around the edges of an image with a transparent background (png), whenever I stroke the image (or apply another effect such as drop shadow or outer glow) the effect goes around the bounding box not the image edges. Is it possible to stroke the edges of an irregulalry shaped image?

      Capture.PNG

        • 1. Re: Stroke transparent image (PNG)
          Grant H Level 4

          easily done: with object selected (use direct selection tool to select the object inside the frame the goto: object / clipping path / options / type - alpha channel, alpha type (in this case transparency), adjust threshhold and other options choose to inset (a minus number will offset the path outside the object and the opposite well you know whati mean). Click ok. then with the object se;ected (not frame once again) goto: object / clipping path / convert path to frame. and i'm sure you can work the rest out from here.

           

          G

          • 2. Re: Stroke transparent image (PNG)
            Peter Spier Most Valuable Participant (Moderator)

            Whoa....

             

            That's a lot more work than necessary, I think. Just select the transparent image with the direct select tool and apply the drop shadow. No need for the clipping path.

             

             

            That aside, looking at the image in the example, I'm not entirely sure why you would want to apply a drop shadow at all. It clearly has an area that is the "ground" onto which you would expect shadows to be cast (and there is a cast shadow in the image). Adding a drop shadow would cause the image to appear to be like an asteroid floating above the page. Perhaps that's the intent, though...

            • 3. Re: Stroke transparent image (PNG)
              Mr. Bounce Back Level 1

              That's exactly the intent! There'd be a white stroke, and then a drop shadow to make it look like a cut-out floating above the paper (for a layered effect). However, the image I used was only as an example - the problem has been bugging me for ages. It isn't specific to this project.

               

              I tried using PSDs but any transparency is ignored completely, as you probably know, and filled with white space,

               

              Anyway, I'm a bit busy at the moment but I'll try your methods and award you 'points' accordingly (!). I'm sure your suggestions will work. Thanks for replying.

              • 4. Re: Stroke transparent image (PNG)
                Peter Spier Most Valuable Participant (Moderator)

                Transparent .psd should work fine, and I would recommend it over .png if this is for print. I don't know what you mean that tranparency in the .psd is ignored.

                1 person found this helpful
                • 5. Re: Stroke transparent image (PNG)
                  Peter Spier Most Valuable Participant (Moderator)

                  Mr. Bounce Back wrote:

                   

                  That's exactly the intent! There'd be a white stroke, and then a drop shadow to make it look like a cut-out floating above the paper (for a layered effect). However, the image I used was only as an example - the problem has been bugging me for ages. It isn't specific to this project.


                  The white stroke would need to be a part of the image to do this without constucting an image-shaped frame, but that's really easy to do in Photoshop, too.

                   

                  Ctrl (Windows) or Cmd (Mac) click on the layer icon in Photoshop to select all the pixels, then Select > Modify > Expand.. to make the selection larger. Add a layer, fill the selection with white (or other color of your choice) and move to the back. Alternatively open the Paths panel and conver the selection to a path, then stroke the path.

                  1 person found this helpful
                  • 6. Re: Stroke transparent image (PNG)
                    Mr. Bounce Back Level 1
                    P Spier wrote:

                    That's a lot more work than necessary, I think. Just select the  transparent image with the direct select tool and apply the drop shadow.  No need for the clipping path.

                     

                     

                    This doesn't work. I orignally tried this but it needs the alpha channel converting into a path like the first reply said. You cannot stroke until you change the bounding box/frame into the shape of the transparent image. I tried the clipping path myself first but I did 'detect edges' and it didn't work. So the Alpha channel is what I needed. I think the convert to frame was just as important to know aswell.

                    P Spier wrote:

                     

                    Transparent .psd should work fine, and I would recommend it over .png if this is for print. I don't know what you mean that tranparency in the .psd is ignored.

                    Yes, but you have to make sure to save the psd and place the file. The transparency was ignored if I dragged the layer into InDesign. I also have problems maintaining transparency when dragging artwork with raster effects applied (drop shadow for example) from indesign to illustrator and vice versa - if this doesn't affect Photoshop then maybe I just got confused and always assumed it did.

                     

                    Also, thanks P Spier for the help with the Photoshop stroke. I am experiened in Photoshop and knew how to do everything you said, but I never knew about control and clicking the small thumbnail on the layers panel to make it into a selection. In the past, I used to uncontiguoous wand the transparent area, which obviously takes longer.

                    • 7. Re: Stroke transparent image (PNG)
                      Peter Spier Most Valuable Participant (Moderator)

                      Just to clarify, you only need to add the clipping path if you want to apply the stroke inside ID. That's a lot more work, in my opinion, and a lot less accurate than adding the stroke to the image in Photoshop. ID's clipping paths leave a LOT to be desired unless the contrast is very strong.

                      • 8. Re: Stroke transparent image (PNG)
                        Mr. Bounce Back Level 1

                        Thanks for the information. This was actually my workaround to the problem when I didn't know how to stroke transparent image edges in InDesign. I'd use a Photoshop stroke, save that and paste that image in Indesign. I thought it was less than ideal because I typically hate how Photoshop does strokes (how it rounds corners off on squares) so based on this evidence I assumed doing a vector-based stroke would be preferable. If not, I might simply go back to my old method based on your advice.

                        • 9. Re: Stroke transparent image (PNG)
                          Peter Spier Most Valuable Participant (Moderator)

                          If you want hard corners you can always draw a shape in photoshop and fill it with white (you could do the same in ID, but it's easier to do it in Photoshop where you get to see the image while drawing the shape) instead of selecting. This would allow you to have more contol over the final shape of your white border and might make simulating a cutout more realistic. Someone using scissors to cut out a shape would likely use a less complex path than you get with a full pixel mapping.