Apr 10 2010

illustrator techniques: part 1 defining patterns

(This is a repeat of a post that somehow has been deleted! It is a technique that is requested often so it’s worth re-posting.)

This is a rather long post, but I have gotten this question repeatedly so this is an attempt to point my students to one place for the answer. (Who knows? It could also be the germ of a book.) This is also a 2-part tutorial. The second part takes up the question of how to quickly and easily test different colorways for a pattern.

I am always in search of vintage motifs to use in designing repeat patterns, backgrounds, borders, or textures for both print and web projects. Often I can find something in my library of Dover publications that I have been collecting since the 1970s. (Note: Though it is tempting to search for online sources for design, it is necessary to carefully negotiate the copyright minefield, even for “vintage” material. Before you offer something for commercial purposes, be mindful of use rights.)

Since I may want a design to do double-duty as both backgrounds for websites (at 72 ppi) and at larger scale in print (at 300 ppi), I prefer to render patterns in vector format to maintain a clean appearance at any scale. Printing a scanned image from a printed book creates all sorts of moire madness. Whether the source was from a book or from the web, a vector pattern has the following advantages:

  • It is scalable without loss of quality
  • The repeats are seamless (if set up correctly)
  • Colors are clearer and more uniform
  • Colors can easily be edited

For that reason, I have developed some basic skills with vector tools using Illustrator. There are other vector drawing programs (CorelDRAW, Xara Xtreme) but I prefer Illustrator for many reasons, but chiefly because of the robust color management tools. More about that in Part 2.

Manual tracing is a good way to hone Pen tool skills. It also causes you to think about pattern repeats and timesaving ways to manipulate objects (Rotate, Reflect). The more recent versions of Illustrator include some powerful and easy to use drawing tools (Blob Brush and Eraser, to name a couple).

What about Live Trace? Illustrator provides a “Live Trace&rdquot; utility which I almost never use for this purpose. I find it faster and more precise to hand trace simple design motifs using the drawing tools rather than manipulate the Live Trace options to get the best rendering and then adjust the paths to remove wayward anchor points or to smooth curves–too much fussing! Also, very low resolution images are just not suitable for Live Trace.

To prove this point, the source for our example is a Japanese textile pattern from an online (low resolution) source. The image was scanned from an antique book. This seems like a good choice for background texture at very small scale as well as an interesting large scale pattern. You can download the image to follow along with this tutorial.

The steps in this tutorial are followed by an image that illustrates them. This tutorial is aimed toward the beginner, using Illustrator for the first time, however the first steps involve a little Photoshop.

The original is dark and low contrast making accurate tracing a little difficult. It’s worthwhile to take the extra time to correct this.

Open the image in Photoshop and bring up the Levels dialogue box: Image > Adjustments > Levels…

Click on the eyedropper on the right to set the white point. Since there is a portion of the unprinted page showing that should be white, click on this area. If there is no indication of white in your image (page edge or a white portion of the motif) this step can be skipped.

To increase the contrast, move the leftmost triangular slider under the histogram to the right to darken the darkest regions. Then, move the middle slider to the left to lighten the midtones. Adjust these as required until you can clearly see the intricacies if the design.

Save the image.

In Illustrator:

Open a new, blank document (preferably for print, though a web document will do).

Place the image file: File > Place…

Open the Layers panel. The image will be on a layer with the name of Layer 1.

Hint: if a panel noted below is not visible, select it from the Window menu:

Add a new layer (A) which should be above Layer 1 (if not, click on Layer 1 in the Layers panel and drag it beneath Layer 2). Lock Layer 1 by clicking in the square next to the layer name (B).

Still in the Layers panel. click on the image layer (Layer 1) to make it active and then double-click on this layer (to the right of the layer name) to bring up the Layer Options dialogue box.

Check the box to Dim Images to 50% (C).

Select the Eyedropper Tool (A) to sample the colors from your image.

As you click on the image, the sampled color will appear in the Fill/Stroke color boxes (B) and the Color panel (C)

(Hint: double-click the Eyedropper Tool to bring up the Eyedropper Options dialogue box. At the bottom you can change the Raster Sample Size from Point Sample to 3 x 3 Average or 5 x 5 Average. This may result in better color matching.)

For each sample, click the Color panel options (D) to reveal a flyout menu and select Create New Swatch (E) to add this color to the Swatches panel.

After each of the colors have been sampled and added to the Swatches panel (A), click on Layer 1 to make it active.

Next, make sure that the Rulers are visible at the top and left side of the window. If they are not, select View > Show Rulers.

To be able to precisely align the guides for the repeat, zoom in (or magnify) the view (View > Zoom In).

Drag a horizontal Guide line by clicking on the top ruler and dragging down to a point where the pattern repeat will begin (Guide B – C).

Drag a second horizontal Guide to find the next instance of the same position on the motif (Guide D – E).

Drag a vertical Guide from the left ruler to align with the beginning point of the pattern repeat (Guide B – E).

Drag another vertical Guide and find the next instance of the same position on the motif (Guide C – D).

Points A, B, C and D will be in the same position on the motif and will define the extents of the pattern to be repeated.

Drag Guides to the midpoint of the pattern repeat area.

Lock the guides in place (View > Guides > Lock Guides).

Zoom in (View > Zoom In) further to be able to clearly see the design detail.

Select the pen tool and set the Fill color to [None] and the Line color to a visible color such as white. If necessry, change te Stroke Width in the Stroke panel to 0.25 pt or 0.5 pt. Tracing with a very heavy stroke is difficult and will result in a distorted path.

Trace around the flower. In this case, since the flower is symmetrical, it is only necessary to draw one-quarter of the flower. The rest can be generated by copying and reorienting this quarter.

Switch the Line and Fill colors (Shift-X).

Using the Selection Tool, select the object and click once on the Reflect Tool.

Find the center-marker (A) and, as you hold down the Option key, drag the center-marker to the center of the flower motif (B). This will also be the intersection of two guides.

As you release the mouse button the Reflect dialogue box will appear.

Choose the Horizontal Axis and click on the Copy button.

These two quarters can now be joined.

Zoom in (View > Zoom In) further, if needed to see individual anchor points.

Using the Direct Selection Tool, drag across the first two anchor points that are to be joined (A) and choose Object > Path > Average…

Choose Both axes from the Average dialogue box.

Choose Object > Path > Join to connect the two paths.

Repeat for the two opposite anchor points (B).

Change back to the Selection Tool. Select this new object and click once on the Reflect Tool.

Position the center point on the intersection of the two Guides again (Option-drag).

The Reflect dialogue box appears when you release the mouse button. Choose Vertical Axis and click on Copy.

Choose the Ellipse Tool (found by clicking and holding down the Rectangle Tool to reveal a flyout menu.) To complete the flower, draw a circle in the center by holding down the Shift button as you drag.

With the Selection Tool, reposition the circle, if necessary.

Average the anchor points and Join the two halves of the flower, as described above.

Deselect everything (Select > Deselect) and zoom out, if necessary to see more of the design.

Exchange the Fill and Line colors again (Shift-X) and draw a rectangle at the intersection of the lattice with the Rectangle Tool (A). Using the Stroke panel, set the Stroke weight to 2 pt (B) and the style to rounded (C).

Using the Reflect Tool as you did for the flower, copy the rectangle in the Vertical Axis first, by positioning the center maker in the center of the circle in the middle of the flower.

Then, with the Selection Tool, select one of the rectangles and hold down the Option key as you drag a copy into position at the intersection of the two Guides on the left side of the repeat.

Using the Reflect Tool, reposition the center marker and copy the rectangle in the Horizontal Axis.

Using the Line Segment Tool (A), draw a line between the left and top rectangles.

With the line still selected, open the Stroke panel and change the Stroke Weight to 3 pt (B) and the style to Butt Cap/MiterJoint (C).

Using the Reflect Tool, copy the other 3 line segments.

The lattice is bordered by a slightly darker shade. The best way to achieve this effect is to make a double stroke using the Appearance panel (A).

Choose the Selection Tool and select all 4 line segments.

In the Appearance panel, select the Stroke appearance and click on the Duplicate Selected Item icon (B). This will set a new appearance (C) below the original stroke.

With the new Stroke appearance selected, click on the color icon (D) and change the color to black.

The new stroke is the same weight as the original and it is underneath so it will not show until you change the stroke weight (E). Use 5 pt in this example.

Select the 4 rectangles and copy them (Edit > Copy).

Then paste them in back of the originals (Edit > Paste In Back). IMPORTANT: Do not deselect or click away from the copied rectangles. They will not be visible until the color and stroke weightare changed.

Usine the Appearance panel, change the stroke color to black and the stroke weight to 4 pt.

With these 4 black rectangles still selected, send them behind all of the other objects (Object > Arrange > Send To Back).

The flower and 3 sides (+ 2 rectangles) will be copied to the upper right. If the Guides are not visible, make them visible (View > Guides > Show Guides).

Select these elements by shift-clicking on each one or dragging a marquee around them and start dragging them to the new position. As you drag, hold down the Option key to turn the selection into a copy.

Be as precise as you can in placing the objects to achieve a smooth pattern repeat.

Select everything (Select > All) and, while holding down the Shift key, click on the 2 line segments and drag a marquee selection around a portion of each of the 3 rectangle groups. This will deselect these objects.

Option-drag to copy these elements into position to complete the motif.

Shift-click on each of the flower motifs (and their center circles) to select them all.

Change the Fill color of the flowers using the sampled colors in the Swatches panel (A).

Make Layer 1 invisible (B) to more clearly see the changes.

Select the line segments and using the Appearance panel, change the stroke colors.

Select one of the white rectangles and select similar elements using Select > Same > Stroke Color. Change the color.

Selecting the remaining black rectangles is tricky since they are exactly underneath the rectangles that you have just colored. Drag a selection marquee around one of the rectangles. Shift-click to deselect the topmost rectangle (you won’t see anything different, except that the Stroke Color box at the bottom of the Tool Bar should now be black).

When you have successfully selected one of the black rectangles, select all similar elements using Select > Same > Stroke Color. Change the color.

Choose the Rectangle Tool and set the Fill Color to the darkest of the previously selected colors.

Draw a rectangle that covers all of the other elements.

Send this rectangle to the back (Object > Arrange > Send To Back).

Deselect all elements (Select > Deselect).

Set both the Fill Color and Stroke Color to [None].

Choose the Rectangle Tool and draw a blank rectangular box with corners at points B, C, D, and E.

Immediately, while the box is still selected, send it to the back (Object > Arrange > Send To Back).

Select everything (Select > All).

Make a pattern swatch (Edit > Define Pattern).

In the Define Pattern dialogue box give it a name.

It will now appear in the Swatches Panel.

Deselect all elements (Select > Deselect).

Zoom out and move away from the pattern design.

Using the Rectangular Tool, draw a large rectangle and set the Fill Color to your new pattern.

The pattern should fill the entire rectangle, or any object that has the Fill Color set to this pattern.

Save the pattern for future use by selecting Save Swatch Library As AI… from the flyout menu in the Swatches panel (found by clicking in the upper right corner of the panel).

In the next window, navigate to the decorative pattern swatches folder in the Illustrator Application folder (this navigation trail may be slightly different, depending on the version of Illustrator. For CS4:

Applications > Adobe Illustrator CS4 > Presets > en_US > Swatches > Pattern > Decorative

Next tutorial, use Illustrator CS4 Color Editor to simply change the colors of patterns.


Jan 28 2010

flash techniques: inspect detail with a magnifying glass

Does anyone still use Flash? Okay, I admit, I do. I have a little library of useful tools and this is one of them. How many times have you embedded an image on your website and then decided that you needed to have an enlarged version for more detailed views?

This has an obvious drawback—piracy of the enlarged image is one. If a detailed view of a portion of the image is all that is required—for example, for inspection of intricate designs or to focus in on map details—this is a way to accomplish magnification without giving away your work. View an example.

The requirements are Flash (of course) and a little bit of Actionscript know-how. This example uses Actionscript 2.0 so it can be accomplished using venerable versions of Flash, beginning with Macromedia Flash MX and more recent.

The first thing you need is a large version of your image from which a smaller version will be made.

The small image will be sized to fit in your webpage layout. For this example, I wanted the image to be 480 px wide.

The magnification will be 2.5 times, therefore the large image would be 1200 px wide (480 x 2.5 = 1200). The image you choose should be at least 1200 px wide.

In Photoshop (or another image editing application), File > Open > (your large image) Now is a good time to save the image with a new name so that you don’t accidentally ruin the original. I saved the exmaple image as large.jpg (the image can be any format that Flash recognizes: .jpg, .gif, .psd, etc.)

Re-size the image to be 1200 px wide: Image > Image Size… Make sure the resolution is set to 72 ppi (A) and change the pixel dimension to 1200 px wide (B).

Now, save the image as large.jpg.
(File > Save As…)

Once again, re-size the image (Image > Image Size…) but this time the pixel dimensions will be 480 px wide (or 2.5 times smaller than large.jpg). Remember the height dimension— it will be needed in Flash.

Save this as small.jpg.

Open a new Flash file. If using CS4 be sure to specify Actionscript 2.0, not 3.0.

The stage size will need to match the size of small.jpg: Modify > Document…

In the dialogue box enter 480 px wide x the height dimension of small.jpg.

Import small.jpg to the stage: File > Import > Import To Stage…

Position the image so that it completely fills the stage. In the Properties palette, change the position to x: 0.00 and y: 0.00.

Rename the layer: small (A) (Note: rename the layer by double-clicking on the layer name to enter edit mode.)

Create a new layer (B) and rename it: large

At this point you should save the file: File> Save As…

The large image will be loaded into a Symbol: Insert > New Symbol…

Give the symbol the Name: large_mc and the Type: Movie Clip

This will open the new blank movie clip. Into this, import the large image: Import > Import To Stage…

Set the position to x: 0.00 and y: 0.00

Return to the main stage by clicking “Scene 1″ in the upper left of the project window:

Click on the keyframe in layer large (A) to make it active.

From the Library panel, drag the Movie Clip, large_mc (B) onto the stage.

The position on the stage is unimportant, however to better see what you are doing, drag it to one side or the other of the main stage.

With large_mc still selected, open the Properties panel and give it an Instance Name: largeView.

Right-click on the Movie Clip to bring up the contextual menu and select Actions.

This will bring up the Actions panel. Enter the following code, exactly as shown (be sure to include the closing bracket on the last line):

onClipEvent (enterFrame) {

_root.largeView._x = (_root._xmouse * -1.5);
_root.largeView._y = (_root._ymouse * -1.5);

}

This code works as long as the large image is 2.5 times larger than the small image. The value “-1.5″ controls the positioning of the mouse relative to the large view. If you think of the small view as being 1x and the large image as 2.5x, 1x – 2.5x = 1.5x. -1.5 is the value used in the code. Therefore, if your large image is 3 times larger than the small image, the formula would be 1x – 3x = 2x and -2 would be used instead of -1.5 in the code.

Close the Actions panel.

Create a new layer above large and name it glass. (Note: the order of the layers is important.)

At the bottom of the Tool panel, set the Stroke color (A) to transparent. The Fill color is unimportant.

Using the Oval Tool (B), draw a circle (hold down the SHIFT key as you drag to constrain to a circle shape).

In the Properties panel, make the diameter 140 pixels (C).

Right-click on the circle and select Convert to Symbol…

In the Symbol dialogue box, give the circle a Name of glass_mc and a Type of Movie Clip.

Close the dialogue box.

There should be a circle and small crosshairs in the center of your circle. In the Properties panel, give the Movie Clip an instance name of glassLens.

Right-click on the circle and choose Actions from the contextual menu. In the Actions panel, enter the following code:

onClipEvent (enterFrame) {

_root.myCircle._x = (_root._xmouse);
_root.myCircle._y = (_root._ymouse);

}

Close the Actions panel.

Right-click on the glass layer in the Timeline and choose Mask from the contextual menu.

The layers should appear as shown below and the circle will now be invisible.

Save the file.

Test the movie: Control > Test Movie.

If you want to add a bezel (rim) to the magnifying glass, create a new layer above glass and rename it bezel.

On this layer, draw a circle with a stroke color that will show against the background of your image.

In the Properties panel, change the diameter of the circle to 140 pixels and the stroke size to 2.00 pixels.

With the Selection Tool, double-click on the circle to enter edit mode.

Click once on the fill region of the circle to select it and press DELETE to erase it, leaving only the stroke.

Click on “Scene 1″ at the top of the edit window to return to the stage.

Right click on the bezel and select Convert to Symbol…

In the Symbol dialogue box, give the symbol a Name of bezel_mc and the Type of Movie Clip.

Close the Symbol dialogue box. In the Properties panel, give the Movie Clip and instance name of bezelEdge.

Right-click on the Movie Clip and select Actions.

Enter the following code in the Actions panel:

onClipEvent (enterFrame) {

_root.bezelEdge._x = (_root._xmouse);
_root.bezelEdge._y = (_root._ymouse);

}

Close the Actions panel.

To make the cursor invisible, place your cursor in the keyframe of the bezel layer (A), right-click and select Actions (B).

In the Actions panel, enter the following code:

Mouse.hide();

Close the Actions panel. Save and test the movie.

You should now be able to insert the .swf file to your webpage.


Dec 28 2009

proofing your website on different browsers

Chances are that you have designed a website or two where your creativity pushed the limits of (specifically) Internet Explorer’s capacity to deal with it. I’ll bet that most web designers don’t use IE as their default browser. Being a Mac shop, I have struggled with a foolproof way to proof newly-minted websites in IE. I broke down and bought a used Windows laptop for that (sole) reason. It was less expensive than running Windows through Parallels on the Mac. Also, in that way I get to see the actual rendering of fonts and images at Windows screen resolutions. I am suspicious that using a Windows emulator on a Mac would not render the screen in the same way.

This method works well but Windows has a tendency to drop out of my network for no reason, especially if I have not been using it. When I need it the most it takes precious time to wade through the maze of Windows to find the one that allows changes to the IP addressing. When Internet access is finally restored I must install all of the system security and virus protection updates that I missed. I digress…

When it comes to proofing for IE I like IE Tester, which is a free utility from DebugBar. This utility permits live testing of the site in IE5 through IE8 in XP, Vista, and Windows 7 environments (you supply the OS). The nice thing about IE Tester is that the functionality of the site can be tested as well as the styling. If you’ve wondered whether the Javascript utility operates as intended, this is a good solution.

The one remaining problem is proofing on the other browsers that Windows supports. It means preserving archival versions of Firefox 2.0 or Opera 6.0. And there’s Chrome. I have not found an easy way to proof on earlier versions of browsers for either Mac or Windows.

That is until now. If you sometimes haunt the halls of Adobe Labs you may have heard of Adobe BrowserLab. If you have not, it is worth trying to get on board with their limited free preview.

This utility resides in “the cloud”, similar to Kuler (another worthwhile utility) so all you need to do is download a small app and use your Adobe registration to log in. BrowserLab renders screenshots of your site in Firefox 2.0, 3.0 and 3.5 on Windows XP and Mac OS X; Internet Explorer 6.X, 7.X, and 8.X on Windows XP; Safari 3.X and 4.X on Mac OS X; and Chrome 3.0 on Windows XP. This list will be updated as browsers are updated–soon I hope for Chrome on Mac OS X.

You access the utility from the Adobe BrowserLab website, provide your Adobe registration info (or sign up), choose the combination of browsers/OSs that you want to preview and feed it the URL of your site:

You can compare in a 2-up display or as an ‘onion skin’, showing two browsers superimposed, which is helpful for fine-tuning alignment. Also helpful is a ruler option to pinpoint an exact location.

The utility can also accessed through a Dreamweaver CS4 extension.

The most discouraging aspect of this otherwise very helpful utility is that it renders the page as a static screenshot. The dynamic functionality cannot be tested or compared. Still, I hope that Adobe continues to make this available, if not for free, at least as a low cost subscription.