Monday, October 19, 2009

Autumn Glory

Big Leaf Maple LeavesThis Big Leaf Maple (Acer macrophyllum) near our house has the most amazing fall color thing happening. I can't wait to see how it develops over the next couple of weeks.

Ain't nature grand?

Monday, September 28, 2009

Tutorial: Circular Photo Frames in Photoshop

Photoshop tutorialThere are several methods for creating a circular frame for a photo in Photoshop. You could, for instance, simply use the oval Marquis tool to make a circular selection of a photo, copy it, and paste it into another document, but that technique only copies the pixels inside the original circular selection. Here's one way to achieve the same thing, while giving you more options for resizing or repositioning the photo behind the frame.

(Click on any image to view a larger version; or, Control-click/right-click and open in another window or tab)

Start with a new document and fill it with whatever background color you wish. I've chosen this reddish orange.
Photoshop tutorialUsing the oval Marquis tool (it's the top left tool in the default Tools palette; click and hold on the tool to select the oval variant of the tool from the drop-down menu), make a circular selection (hold down Shift while dragging to constrain the selection to a perfect circle). With the Marquis tool still selected, you can click inside this selection and move it to wherever you want in the document. To resize the selection, go to Select>Transform Selection and use the corner controls to alter the size; click Return/Enter when done to accept the transformation.
Photoshop tutorialOpen the photo that you want to copy, and select all (Command/Control-A), then copy it (Command/Control-C). You can close the photo file. Go back to the document that has your circular selection in it. If you've left the photo file open, go to Window>new file name to make it the current window.

Now, go to Edit>Paste into and your photo will appear inside the circular selection that you made earlier. When you paste anything into a Photoshop file, Photoshop creates a new layer directly on top of the layer that was active when you initiated the Paste action. When you Paste Into a selection, Photoshop also automatically creates a Layer Mask in the shape of your selection. Of course, your selection can be any shape you want, and Photoshop will create a mask in that shape. Nifty, no?

Photoshop tutorialIf we look at the Layers palette (if it's not already open it, display it now by going to Window>Layers), we can see that our document now has two layers: the Background layer is our original colored layer, and the next layer up contains the photo, as well as the layer mask. The layer mask reveals or hides the contents of the upper layer depending on its shape (and opacity, which we won't be dealing with in this tutorial).

In the Layers palette, we now see a thumbnail for the photo, as well as a black and white thumbnail for the layer mask. Note that the entire photo is actually there, but the layer mask is only showing us the part that is revealed by the white area of the mask. We can now resize the image, or move it around behind the mask, which gives us much more flexibility than if we had simply copied a circular selection of pixels and pasted them in.

Photoshop tutorialIf we want to resize the image, first make sure that the layer that contains it is active (click on the photo thumbnail), then go to Edit>Free Transform (or, just press Command/Control-T). We now see the transformation box on the image, and we can click and drag the controls to resize the image, while leaving the circular mask the same.

Now, let's suppose we want to create a second circular image that's the same size as the first one. To do this, we need to copy the original circular selection that was used to create the original layer mask.
Photoshop tutorial

To do this, Control-click on the layer mask thumbnail in the Layers palette. This loads the mask as a selection. Using the Marquis tool (press M), we can now go back to our image and click inside the circular selection and drag it to a new location. By using the Marquis tool, we are assured of only moving the selection, and not the image inside the selection.
Photoshop tutorial
We can now paste a second image into this new selection (open a new photo, select all, copy, return to the destination image, paste into) and Photoshop will create another new layer, complete with a new layer mask. Easy!

Photoshop tutorialTo add a little dimension to your frames, you can add a Layer Style, which I've done on the left image. To add a Layer Style, click on the image thumbnail of the layer you want to style, then go to Layer>Layer Style and select Inner Shadow (or, click on the Layer Style button at the bottom of the Layers Palette). Adjust the settings to your liking, and press OK.

If you want to move your circular frames around, you need to lock the image and its corresponding layer mask. Do this by click the space between the image thumbnail and the layer mask thumbnail; a small chain link will appear, signifying that they are now locked. You can now use the Move tool (press V) to click and drag the circles around; both the image and the mask will move. When the image and its mask are locked, you can also resize both simultaneously (Command/Control-T). To unlock the image from its mask, just click on the little chain link and you can then transform them independent of one another.

Layer masks are powerful tools, and I've just scratched the surface of what you can do with them. They are an essential tool for compositing images, and well worth your time exploring. Have fun!

Sunday, September 27, 2009

Early Fall at the Farmstands

Sweet peppers from the farm standIt's officially fall, and the items available in the island farm stands are reflecting the change in seasons.

Besides these gorgeous sweet peppers, we found garlic, storing onions, amazingly sweet green-striped tomatoes, Desirée potatoes, and purple kohlrabi.

We also found island-grown melons at the island organic grocery store.

I love harvest time!

Friday, September 11, 2009

September Riches

Melon, Raspberries and KiwiIsland-grown melon, raspberries from Burlington, Washington, organic kiwi fruit from Trader Joe's (god knows where they got them from).

Pretty tasty!

Thursday, August 27, 2009

Tutorial: Resizing an Image in Photoshop

If you're posting images online, and who isn't these days, it pays to know how to re-size images so they aren't bandwidth hogs. Photoshop makes this easy, but like all things related to Photoshop, there are a few subtleties that make big differences in the result. In this tutorial, I will re-size a photo, then save it as a JPEG for posting to a blog or website.

Before we get started, I want to say a couple of things about resolution. This subject is little understood outside the computer graphics and print worlds, but it's an important thing to understand.

An image that has a resolution of 300 pixels per inch (ppi), if it is 1 inch by 1 inch in dimensions, will contain 900 pixels. When printed on most printers, it will print at 1 inch by 1 inch. On screen, however, at 100% magnification, it will look much larger. That's because computer monitors (typically) have a resolution of between 72 and 96 pixels per inch. Therefore, our 300 pixel wide image at 300 ppi will appear to be more than 3 times as wide on screen as when it prints.

For print, you usually want the most pixels you can get. This means a large number of pixels both across and down in your image. The more pixels, the better continuous-tone images like photographs will print. But the large number of pixels has a price: the computer has to store data for each and every pixel in your photo, with multiple bits for the three color channels (red, green and blue), as well as information about luminance (the tonal range) and transparency (usually referred to alpha). Image files intended for print are usually quite large (in terms of file size), even if their printed size is small.

We don't need all of that weight for an online image, due to both storage issues (your uploaded photo is just a file on a server somewhere) and bandwidth (how much data needs to be transmitted to a computer to view an online image). Plus, the screen resolution of less than 100 ppi will display much smaller images at what appears to be "normal" size, although if you print that same image, it will be about 1/3 of the size it was on-screen.

Fortunately, the internet is utterly non-committal about the resolution of an image (the ppi). The internet only cares about pixel dimensions—how many pixels wide and how many pixels tall is the image?

So, now that I've diverted into the murky world of image resolution, let's forget about it and concentrate only on the pixel dimensions of our image.

I've opened the photo I'll be working with in Photoshop. I'm using Photoshop CS2 on a Mac, but the techniques are the same for Windows.

Because I shoot all my digital photos at the maximum size allowed by my camera (so I can print nice sharp versions at the largest possible size if I choose), I know that this image is going to be too large to display on-screen. If we go to Image>File Size…, we can examine the resulting dialog box.

Resizing photosThe image's dimensions are shown in the top box, conveniently labeled "Pixel Dimensions," along with the size of the file (in this case, 9MB). I usually have my units of measure set to pixels in Photoshop, so that's what comes up here, but if you don't see "pixels" next to the width and height boxes, use the drop down buttons to change it.

I want people to be able to see the entire photo without scrolling in their browser window, so that gives me a guideline for the height. You can search the web for safe dimensions by browser, but I can't be bothered trying to accommodate the multitude of browsers now available, so I'm going to try 500 pixels for the height. People with small screens are used to scrolling, anyway, so they'll get the experience they're used to.

Before changing the height, make sure the "Constrain Proportions" box is checked. This will ensure that when we change the height, the width will adjust appropriately. We can completely ignore the second section of this dialog box, because we're not concerned with resolution or document size for this exercise, only the pixel dimensions.

Before clicking OK, we need to change one other setting, and that is the bottom control labeled "Resample Image." The default setting for this control, which determines how Photoshop decides which pixels to throw away while maintaining the visual integrity of your image, is Bicubic, and that is fine for a default. I get better results when shrinking an image, however, by selecting "Bicubic Sharper" from the dropdown. Conversely, when enlarging an image (more on this in a minute), I select "Bicubic Softer." I don't understand the technical reasons why this gives me better results, I just like the results I get. Now click OK.

OK, we've re-sized our photo to a web-friendly size. Now, we need it in a format that can be displayed on the web. For photographs, this usually means either JPEG or PNG (an open-source algorithm developed to replace JPEG, which is a patented process). These are both compression algorithms that are used to shrink file size (remember storage and bandwidth). Both are what are known as "lossy" algorithms, meaning they produce a smaller file size by throwing away data. We want to control this process to ensure the highest possible image quality at reasonable file sizes.

If we started with a JPEG (which is the most common format used by point-and-shoot digital cameras), it would be tempting to just hit File>Save now. We could also use File>Save As… and then choosing .jpg or .png in the file type drop-down, but neither of these methods gives us any control at all.

Save for web dialog boxInstead, use File>Save for web…, which will then open some controls we can change. The Save for web… dialog box has several important features. In the upper left, we can select to display only the original image, only the compressed image (Photoshop calls the compressed image "Optimized"), or display them side by side. If you want to try out several different levels of compression, you can click the 4-Up tab, then set different levels of compression for each window. I usually find that the 2-Up configuration works fine. It lets me keep an eye on my original (left pane) as well as the compressed version (right pane). In the lower left corner, you can change the magnification of the previews in case you need to really see what's happening up close. I usually leave it at 100% because that's the size I'll be viewing it once it's online.

In the upper right, there is a dialog box with several controls. Select JPEG or PNG from the drop down (PNG-8 will result in smaller files than PNG-24, but will also throw out more data in order to achieve that small file size). For photos, these are really the only two options you should consider, and I won't discuss the other options in this tutorial.

I've selected JPEG, then played with the Quality setting. The information at the bottom of the right-hand image shows me what the resulting file size will be based on my settings. I usually look for a balance of image integrity and file size, remembering that many users won't often wait for a large image file to download to their screen, but will click away after just a few seconds. When I have the settings the way I want them, I click OK, then give the JPEG a file name.

That's it. My JPEG is now a svelte 40k in size and still looks good. I wouldn't print an image that small, but it's fine for viewing on a screen.

Images of the same pixel dimension can end up different sizes after saving as a JPEG. The "busier" the image, the larger the final file size. This is because the JPEG algorithm looks at the edges between things to determine what it can toss. The more edges (say, in a crowded street shot with lots of buildings, windows, and people), the larger the file size will be. The Save for web… dialog lets you see what your final image will both look like as well as how large it will be (file size), while letting you control both. It's a great tool.

Now, what about enlarging an image? Enlarging the pixel dimensions of an image is problematic to say the least. When you shrink an image, the computer is throwing away pixels; when you enlarge an image, the computer has to invent what it thinks the new pixels should look like. Enlarged images always—repeat, always—suffer a loss of sharpness. It rarely results in a quality image. There are third-party plug-ins and stand-alone programs that purport to do this with greater accuracy, but they are still inventing pixels based on what they start with. I don't recommend enlarging images if the end result is to be crisp and detailed. If your goal is to get something fuzzy or pixelated, and sometimes that's what I need for artistic reasons, then go for it.

So that's it. Have fun!

Thursday, August 20, 2009

Cooking: Cabbage Koftas

Cabbage KoftasOne of my favorite cooking web sites is Manjula's Kitchen. I especially love watching her knead doughs for rotis, parathas, and other Indian breads, using just her right hand. But what a hand! So expressive.

I've made several of her recipes, although I usually dial back the chilies to better suit our palates.

Recently, she posted a video about making Cabbage Koftas, fritters made from mostly cabbage, with some seasonings and a binder. Manjula serves her koftas in a spicy tomato gravy, but I wondered what they would be like in a mixed vegetable curry with coconut milk. Dinner with friends presented the perfect opportunity. I used garbanzo flour instead of gram flour (which is made from hulled black lentils) and a modified frying technique. Here's my revised recipe.

Cabbage Koftas
makes about 16 koftas

2 cups finely shredded cabbage (I used red cabbage)
1 hot chili, seeded and chopped (I used a Santa Fe chili; jalapeño or serrano would work well, too)
2 tablespoons chopped cilantro
1 tablespoon chopped ginger
1 teaspoon whole cumin seed (or use 3/4 teaspoon ground cumin)
1 teaspoon kosher salt
3/4 cups garbanzo flour
oil for frying (I used sunflower oil; coconut oil would work beautifully, too)

Begin heating oil over medium-high heat in a cast-iron or stainless steel skillet. There should be 1/2 inch of oil in the pan.

Combine cabbage, chili, cilantro, ginger, cumin seed, salt and flour in a bowl and combine. Using your hand, press the mixture together, squeezing as you go, until the cabbage exudes enough moisture for the whole thing to hold together. Keep at it—this can take a few minutes.

Test the oil by dropping a small ball of the "dough" into it. The oil should start to bubble around it.

Form small ovals of the mixture by squeezing them and patting them into shape, then gently lay them in the hot oil. Continue with as many as will fit in the pan without them touching—if you crowd them, things will steam, not fry. Leave them alone, bubbling away, for a couple of minutes, then gently turn them. I just used a table fork for this. If you try to turn them before the bottom has crusted, they will break.

Continue cooking on the other side until it, too, is crisp and golden brown. Press the ovals lightly with the tines of the fork—when they feel solid, they're done. Remove to a plate lined with a paper towel, then continue cooking the remaining mixture until they're all fried.

These are utterly delicious to eat out of hand and would make a great appetizer or first course, served perhaps with a fresh chutney. Frankly, they were so good, I don't even think that is necessary.

I used them in a different fashion, however, placing four of them in the bottom of the dish before serving a luscious vegetable curry over and around them. The curry contained lots of onion, garlic, ginger, fresh turmeric, chopped chilies, carrots, yams, cauliflower and green beans, plus coconut milk. Seasoned liberally with home-made curry powder, it was sublime.

The delightfully chewy, rich-tasting koftas were like little bundles of treasure. I'll definitely be making these again, soon.

Curry with Cabbage Koftas