*** From the Archives ***

This article is from January 21, 2008, and is no longer current.

Add Strokes to Placed Images in Illustrator

18

Q. I’m having a problem with Illustrator that seems pretty basic, but I can’t figure it out. I placed a picture into my document, and I want to add a stroke around it. But when I do, the line doesn’t show up. What am I doing wrong?
A. I get this question a lot. Unlike InDesign, which has a concept of frames (and the frames have Fill and Stroke attributes), Illustrator is frameless. A placed image in Illustrator isn’t an object that can have Fills or Strokes. It’s not a vector shape and therefore lacks those attributes.
Most people use the Rectangle tool to draw a shape around the image. But even that’s too much work.
First, it’s important to understand that a placed image is not a vector object and hence, can’t have a fill or stroke attribute. So we’ll need to create another vector object to contain our stroke attribute. But I don’t want to create that object on my own. I want Illustrator to create it for me. There are two ways to accomplish this: have Illustrator automatically create a mask for the image; or use an effect to convert the bounds of the object into a vector object. Both have pros and cons and work better depending on the task at hand.
Technique #1: Use a Mask
This technique requires Illustrator CS3 and works only when your keyline will be rectangular in shape.

  1. Choose File > Place and choose an image to place into your Illustrator document. You can either Link or Embed the image. Once you’ve chosen the image, click the Place button.
  2. The image is selected (if your image already exists in your document, select it now), so if you look in your Control panel at the top of the screen, you’ll see a button labeled “MASK”. Click on it. This creates a mask at the exact bounds of the image.
  3. Press the “D” key for Default. This gives the mask a black 1 pt stroke attribute. Adjust the stroke per your design needs.

NOTE: An additional benefit to this method of using a mask is that you now have the elements in place to simulate a “frame and image” paradigm like InDesign. Once you’ve created your mask, you can decide to “crop” your image by double clicking anywhere on the photo. This will put you into Isolation Mode. Now click on the frame edge and resize at will. When you’re done, double click outside the image to exit isolation mode and continue working. This method works wonderfully when you’re using the Selection tool (black arrow) and have the Bounding Box option turned on (in the View menu).
Technique #2: Use an Effect
At first, it may seem that applying a keyline with the use of an Effect is a tedious process. But we all know that once we’ve applied an effect, we can store it as a Graphic Style, at which point applying our keyline will become a single click. Go ahead, ask me why Adobe doesn’t ship Illustrator with such an effect as a default setting in the NDPs (New Document Profiles). Go ahead, ask me why Adobe doesn’t allow us to assign keyboard shortcuts to styles like InDesign does. I don’t have answers to either of those questions (sorry). But let’s get on with the styles, shall we?
There are two separate effects that we can use, and each provides a different benefit.

  1. Choose File > Place and select an image to place into your Illustrator document. You can either Link or Embed the image. Once you’ve chosen the image, click the Place button.
  2. The image is selected (or if your image already exists in your document, select it). Open your Appearance panel and from the Appearance panel flyout menu, choose Add New Stroke. We can’t see the stroke yet, because all we have is an image. But we’ll change that in short order.
  3. With the Stroke highlighted in the Appearance panel, choose Effect > Convert to Shape > Rectangle. Check the Preview button, select the Relative option, and set both the Extra Width and Extra Height to zero (0). (Be careful not to press Tab after you enter the second value, or it will switch back to Absolute.) Click OK to apply the effect. Style the stroke attribute to match your design preference.
  4. Now make this easier to apply in the future. With the object still selected, open the Graphic Styles panel and click the New Graphic Style button at the bottom of the panel. Give the style an appropriate name. If you then add this style to your NDPs, it will be readily available in all new files that you create.

This technique obviously works only if your keyline is rectangular in shape. But what if your image had transparent areas in it? What if you silhouetted the photo in Photoshop (keeping the background transparent) and placed the PSD into Illustrator? There is a way to apply a stroke to the boundary of the art instead of to the boundary of the entire image. The method I’m about to show you will do just that, and will also do the job for rectangles as well.

  1. Choose File > Place and select an image to place into your Illustrator document. You can either Link or Embed the image. Once you’ve chosen the image, click the Place button.
  2. The image is selected (if your image already exists in your document, select it now). Open your Appearance panel and from the Appearance panel flyout menu, choose Add New Stroke. We can’t see the stroke yet, because all we have is an image. But we’ll change that in short order.
  3. With the Stroke highlighted in the Appearance panel, choose Effect > Path > Outline Object. If you’d like, style the stroke attribute to match your design preference.
  4. To make this easier to apply in the future, with the object still selected, open the Graphic Styles panel and click the New Graphic Style button at the bottom of the panel. Give the style an appropriate name. It’s a good idea to add this style to your NDPs so that it’s readily available in all new files you create.

If you’re applying this last effect to an image with no transparency, only the outside portion of the stroke will become visible. That is, if your stroke weight was set to 1 pt, only .5 pt of the stroke will be visible. To get the full 1 pt stroke, select the Stroke attribute in the Appearance panel and choose Effect > Path > Offset path. Then choose an offset amount that’s half the weight of the stroke. In our example, you would use a .5 pt offset value.
For even more fun, you can combine both of these effects by adding two strokes to your image, giving your transparent images a stroke around the bounds of the artwork as well as a keyline around the bounds of the entire image.

  • Anonymous says:

    This was exactly what was needed! Works exactly like this in CS4 also.

  • Anonymous says:

    This is an amazing post – we need more people like you explaining these things to the rest of us! :)

  • Anonymous says:

    Your instructions were clear and concise and allowed me to place a stroke around a placed image easily. As a beginner in Illustrator, I really appreciate it!

  • Anonymous says:

    As mentioned, really great tutorial. Thorough, useful, and well explained. Just what I needed at a critical time at work. BUT I can not figure out what needs to happen to allow rotation of images using this effect. It seems like you can not apply this fabulous effect to a rotated image to begin with. Stroke does not apply or stay aligned once rotation is involved.

  • Anonymous says:

    super helpful. THANK YOU!

  • Anonymous says:

    Very good answer. Thank you.

  • Anonymous says:

    Too. LONG!

  • Dejan N. says:

    Very, very useful even after 5 1/2 years from posting!

  • Sirganit says:

    I just used the pen tool, with smart guide, snap to points. And there it was, simple as that!

    • kristens1 says:

      4+ years later…You are a genius!! Forget all this other stuff, people. The pen tool is the ticket. Thank You!!!

  • faroe2k9 says:

    Thank u!!!

  • Kiersten says:

    Thank you x 1 million

  • Guest says:

    Thank you!

  • Robert Hoops says:

    It’s 2016. We can land probes on asteroids. This shouldn’t be this hard. C’mon, Adobe. I can do this in half a second in PS/ID.

  • Amy G says:

    I truly appreciate the easy to follow directions for completing a task that definitely should not be as difficult as it ends up being :) CreativePro/Mordy Golding is the real MVP!

  • Cherylanne says:

    Thank you for taking the time to write this out!
    So much easier in Freehand :/

  • >
    Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo