Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Sunday, October 21, 2012

Tag, You are It!

I confess that I'm really not a power user when it comes to Facebook. Often, I want to do something that seems like it will be easy enough, but ends up turning out to be deceptively complicated.  Case in point, when posting a photo I really wanted to add a user hyperlink into the caption of the photo. The new "timeline" iteration of Facebook seems to make this an easy task, but try as I might, it is just about impossible to create the link when the person you want to link to is not one of your friends (but pretty straightforward if they are...).

After much trial and error, I was able to work out a process to add links into my photo captions, status updates, and other Facebook content, but it takes some planning and a couple of steps to accomplish this task -- for your Facebooking pleasure here is how I do this:

Step one, find the user's Facebook ID.  Back in the early days of Facebook all users had ID numbers that were fairly easy to find. Simply look them up and click on the link and the ID would appear in the URL of the users Facebook home page.  The user ID allowed savvy Facebookers to do all sorts of things (some clever and some nefarious).  But Facebook introduced custom (or vanity) URLs not too long ago, and that made it much more challenging for the neophyte to find the actual user ID.
 
But low and behold, there is a fairly simple and straight forward way to find an ID just by utilizing the user's Facebook user name. Because every object within the Open Graph has a unique URL it is easy enough to have information returned about that object (as long as you know the key - in this case the user's vanity profile link. Users pages are no exception.

For a facebook profile with a vanity URL, you will see something like this:

http://www.facebook.com/nicholas.myra.7

So for this example all you really need is the value of the users Facebook username which in my example is nicholas.myra.7

Launch this ink in your browser window:

http://graph.facebook.com/nicholas.myra.7

Now, you should see something that looks like this:


The user ID is specified in the id property. Simply copy this value (without the quotation marks). The same goes any user profile of Facebook fan page. You only need to add the username after http://graph.facebook.com/ to get the ID.

Now that you have the ID, a little piece of code will allow you to create the hyperlink to a user profile (who is not in your friends list).  The code for adding the hyperlink into a wall post, or image caption, is:

@[PROFILE_ID:0]

So, to post a tag to Nicholas Myra, you would simply type @[100000034458111:0] and voilĂ , the user's name appears in your post with a hyperlink to their Facebook profile (friend or not).  Here are before and after pictures:

Typing in the text string (with ID) and click the "done editing" button, and you get:

UPDATE (Dec. 2012): After much experimentation, I have found that this trick will only add the hyperlink if the permissions on the user account (that you are linking to) permit tagging, otherwise FB just inserts the user's name (sans the link).

QED

Monday, February 21, 2011

Creating a star filter effect in Photoshop CS4

I found it interesting, that after posting my Christmas blog in December, I received several e-mail comments -- not about the writing, but rather about the photo of our Christmas tree.  Not exactly the response I was expecting, but flattering (I guess) none-the-less...

Most of the comments read something to the effect of: "I really like the [Christmas tree] picture.  How did you get the starbursts?" Well in the "old days" I would have used a cross screen filter on my trusty SLR's 35-70mm zoom lens, as I was taking the picture. These filters are easily available for digital SLR lenses, but I didn't happen to have a filter when I took this digital photo (and to be honest it was taken in the wee hours of Christmas morning, and I was too tired/exhausted to even think of putting a filter on at the time anyway).  So I manipulated the picture in Photoshop to get the effect (which has to be one of the chief advantages of digital photography over the "old days").

The Photoshop technique I used isn't as straight forward as applying a ready-coded starburst filter (mostly because I just don't like the results from the filters I have seen).  But this process has a finite number of steps, so that most casual Photoshop users can create the effect with a little bit of effort and, if I dare say so myself, produce some very nice images.  So here is a tutorial detailing this technique for those who expressed some interest.

DISCLAIMER: This tutorial assumes that you have some previous experience with Photoshop and understand simple concepts like selecting tools/procedures from the menus, using the magic wand, pencil and lasso tools, cutting and pasting, etc... Also, please note that clicking on the images will bring up larger, more detailed, versions.

image 1: original photo w/background isolated
To begin with, the original picture I started with needed some work. As you can see, there is a hideous shadow (the result of using the camera's flash in an unlit room), also the background is cluttered and detracts from the main focus, which is the tree.  So, my first step was to isolate the background.  This ends up being the most tedious step in the process (using a combination of Photoshop's magic wand and lasso tools).

After isolating the background, choose Select -> Inverse from the menu bar and then the copy/paste commands to create a layer that includes only the tree and presents (the foreground) then change the exposure on the background layer via the Image -> Adjustments -> Exposure menu until you get the desired effect.

image 2: after adjusting the background exposure.
As you can see in image 2, the result is a much improved photo which still retains some hint of the depth behind the tree (that depth would disappear if the foreground was simply placed on a black background).

Now that the photo is prepared, select Layer -> Merge Down from the menu bar (or type ⌘E) to create the new background layer. Then duplicate the background layer by selecting the Layer -> Duplicate Layer option from the menu.  Be sure to choose the "new" Layer 1, from the layers tray, then choose the Threshold option from the Image menu (Image -> Adjustments -> Threshold). The Threshold option converts your layer to black and white (not grey-scale, but actually black and white pixels). This will result in your workspace looking like this:
image 3: applying Threshold command to Layer 1.
As you can see, the lightest areas on the original image are now white and the remainder is black.  The goal, for a good starburst filter is to isolate the areas of white, so that they correspond to where you want the effect to show up in your photo.  I adjust the Threshold level in the dialog box to remove most of the black/white balance until the lights were the primary points of white:

image 4: adjust the Threshold Level to isolate areas where the star effect will be added to the photo.
After this step is complete, you will notice that there are still many white spots that do not correspond to the light spots where you wnt to apply the effect.  Switch to the Pencil on the Photoshop tool pallet (I used a 13px sized pencil) and blacken in any of these white spots.  To make your life slightly easier, you can zoom in and toggle the black and white layer on and off, to determine which areas to blacken out as follows:
image 5image 6
After you have cleaned up all of the white spots on layer 1, to your satisfaction, duplicate the layer again, by selecting Layers -> Duplicate Layer from the menu.  Your layers tray should now look something like this:

image 7
Most of the set-up work is now complete, so you can get into the meat of creating the star filter effect.  To begin, select the copy of your first layer (the one that you just created) in the Layers tray.

On this layer, you will want to apply one of Photohop's pre-set filters called the motion blur.  Select the motion blur from the filters menu (Filters -> Blur -> Motion Blur).  If you have ever used motion blur before, the filter will have the last settings that you used pre-populated in its dialog box.  In all likelihood, these will need to be modified.

First, change the angle of the blur.  In this example I used a simple cross hatch where the rays of light emanate out perpendicular to each other (i.e, at 90° angles respectively).  You can choose to make your stars have more than two axes or non-perpendicular ones as well.

In this example, I chose to start by setting the blur axis to 45°.  After establishing the angle of the first axis, then you can adjust its length by changing the value in the distance box (I chose 850px).

image 8: adding the first motion blur
Now, as you can see from the accompanying scree shot, the layer appears to be solid black.  This means that the blur filter has done its job, blendeding the white spots into the black background.  However, do not fret, your streaks of white are there we just need to use the levels command to bring them back out.

Select Image -> Adjustments -> Levels to open the Levels dialog box which will look like this:
image 9: open the Levels dialog box.
Click on the white slider in the input levels chart and slide it to the left, as you do so, you will see the streaks of white lighten up as you move your mouse to the left:
image 10: bringing out the blurred streaks of light.
Now that you have "illuminated" the streaks, take a moment and jot down the values below the Input Levels graph.  You will want to use these values when you go to create the perpendicular (cross-hatched) layer. You will also notice that these streaks are fairly uniform in size and that they end rather abruptly (based on what you chose for the length in the blur step). The starburts formed on a real cross hatch filter taper off at the ends. To accomplish this, simply re-apply the motion blur filter. Since this was the last filter you used, it will be at the top of the Filter drop-down menu so select Filters -> Motion Blur (or type ⌘F):

image 11: 2nd motion blur pass.
The result of the second blur pass should give you a series of nice long, tapered, streaks:
image 12: first light streak layer complete.
Now you are going to switch from this layer back to layer 1 (the layer originally manipulated with the Threshhold level adjustment.  On this layer, you will repeat the steps above, to create another layer of streaks.  However, the blur on this layer should be perpendicular to the blur created initially.  Since I used a simple 45° blur on the initial layer, I'm just going to reverse that by changing the angle to -45° (the distance will remain the same):
image 13: creating a new layer with a perpendicular blur.
Once again, select Image -> Adjustments -> Levels from the menu, and this time type in the values you wrote down from the initial streak layer, then re-apply the secondary motion blur:
image 14: adjust the levels using the same values as the first time.
Now you'll need to blend the two "streak" layers together to create the cross-hatch effect.  I do this by using the screen option from the pull-down menu on the layers tray:
image 15: blend layers using the screen option.
The screen option works particularly well because the background on the image layers is black. The result of blending the two layers shows the classic cross-hatching that we are looking for:
image 16: after blending the "streak" layers.
Be sure you have the top most layer selected and select Layer -> Merge Down (⌘E) again, combing the two top layers:
image 17: merge the two streak layers to create the cross-hatch.
The last steps are to take the cross-hatch layer and blend it into the background image, then make any adjustments to the cross-hatch layer to "punch up" or "tone down" the starbursts, and finally to flatten the final image for the web...

Blending the starburst streaks into the background can be done using several different blend mode techniques.  As was done to create the cross-hatch layer itself, you can use the screen option to blend the layers together.  This may work for some kinds of images, but on images with rich colors the result of the screen blend maybe "too white" (it is for my tastes).  So for this example, I chose the color dodge blending option:
image 18: Blend the cross-hatch using the color dodge mode.
After applying the blending mode, use the Image -> Adjustments -> Levels menu to change the input levels on the cross-hatch layer to achieve your desired starburst effect:
image 19: adjust the levels on the cross-hatch layer before merging the layers and saving the image.
Merge the top layer down again (⌘E), and save the image in your favorite file format (JPEG or PNG for web) for the finished star filtered image.

QED

Sunday, March 23, 2008

I Miss Green Bar Paper and Fixed-Pitch Fonts...

I have to admit, that I am pretty old school, at least that is what my staff (and kids) tell me... As much as I like, and embrace, technology (managing technology and IT types being a significant portion of my work responsibility), I still prefer printed books to digital ones, I prefer file folders stuffed with papers to 300 page PDF documents (of the same stuff).  Paper has a tactile quality that is simply something that a computer will never be able to replicate.

As a result of my fondness for paper, I go through frequent paper purges in my office. Essentially, trying to digitize documents so they are retrievable records of the work we handle--today happened to be one of those days.

As I was digging through one old file folder, I found several really old reports from when I used to work at a subsidiary of the Atlantic Richfield Company (one of my first "real" jobs after college).  The reports themselves were nothing spectacular, but they made me nostalgic none-the-less.  These reports were old school spreadsheets printed on line printers in our data center and were printed on green bar paper in a monospaced font. Ahhhh, the "good ole' days."

Back in the "day" most people did not have PCs on their office desktops.  Most of us had a terminal that was networked to a mainframe in the data center (and if we did have a PC, we were using it like a terminal).  There was fairly robust spreadsheet software on these mainframe systems, but it wasn't like the WYSIWYG applications that are used today.  Then, when you printed a report, it went into a queue and you had to get up from your desk and walk to the data center to pick it up (although if you were high enough on the corporate food chain, the report would be delivered to you). 

The entry level (from a skill perspective) just to get to the data from the mainframe was pretty high (you had to actually know and understand how the data was stored to retrieve it).  But then to to format that data into a useable report, well, you really had to understand more about how computers are programmed/work than you do with today's high level programming languages and GUIs.

Don't get me wrong, I love my Macintosh and its elegant GUI. I am glad that many more people can utilize spreadsheet, word processing and database software to create reports, and I believe those are skill sets that should be taught in our secondary education system (although, I also believe that PowerPoint maybe the root of all evil...but I'll save that for a different post).  I am also happy that printers are cheap and ubiquitous (and that we recycle a lot more paper now, so we "kill" fewer trees).

The problem is, that with all of the tools and options we have today, too few people know how to really use them.  Rather than the intuitive GUIs and WYSIWYG applications truly bringing computing power to the masses, enabling the end user to produce a report that is concise, clear and too the point, too many people spend too much time worried about how the report looks, and not the actual content of the report.  Or (only slightly less worse) they can not use the most rudimentary of tools inside of these applications to perform simple tasks.

Looking at this old report, I remembered that it was in this particular position that I discovered that I had a somewhat unique technical skill that my peers (and supervisors) lacked.  The ability to translate between "geek speak" (before the popular GeekSpeak radio/pod-cast was glimmer in anyone's eye) and English. This skill has propelled me throughout my career, for which I am thankful. But its has also held me back (in some circles)--as I am perceived as the office's "go to tech guy..."

In fact, just the other day, I was instructed to change the fonts on all reports going to one of our high level executives.  When I asked why, the answer came back: "That is the font he prefers reading internal reports in" (sic). Really?! Are you serious?  I'm trying to re-work a report so that it contains the correct data and you want me to stop and change fonts on 30 reports? This is our priority today? Yes, there is something wrong with this picture...

There is something wrong with the fact that most of the people that work in offices (including mine) don't have the requisite familiarity with the primary business applications that they use on a daily basis (just in the last month, I have shown the same person 6 times how to sum a column of numbers...seriously).  There is something wrong with the fact that many people can't simply format a report (despite all of the WYSIWYG features embedded in our programs) so that it is readable...

Which is why the discovery of that old report made me nostalgic for "the good-ole' days" of green bar paper and mono-spaced fonts.  The fonts were easy to read, clear and unambiguous.  We didn't worry if the font matched our letterhead or wordmark, it was a report after all--its purpose was to convey information first (style wasn't unimportant, the information needed to displayed in a way comprehensible by the user, but it was a distant second, and wasn't really about aesthetics).

All of these observations really make me wonder why we don't have any line printers (or any impact printers for that matter) anymore?! We do have Excel and a bunch of laser printers though, and they do produce more aesthetically pleasing documents (or at least they can). Changing a font to a different fixed-width one is pretty straight forward in most applications (⌘A and change the font) but since that train had already left the station today, simulating green bar paper is my mission...Fortunately all of that WYSIWYG power in Excel can come to the rescue (using the conditional formatting feature)...

So, for those wishing to replicate the shading of green bar paper in Excel, here are some quick instructions: First highlight the rows that you wish to apply the formatting to (you can either do a portion of the spreadsheet or select all rows in the spreadsheet as done here):
image 1: select all sells in spreadsheet
Select the Conditional Formatting option form the Format menu in the menu bar:
image 2: select conditional formatting from menu
When the Conditional Formatting window appears, select "Formula Is" from the drop down list on the left side of the dialog box. Then type the following formula: =mod(row(),2)=1
image 3: type formula into dialog box.
Next, we need to select the color we want to see in the alternating rows. To do this, click on the Format button (below the formula bar).

When the Format Cells window appears, select the Patterns tab. Then select the color that you'd like to see. In this example, we've selected a light grey. Then click on the OK button.
image 4: select highlight color desired.
When you return to the Conditional Formatting window, you should see the following. Next, click on the OK button.

image 5: click ok to apply formatting to spreadsheet.
Now when you return to the spreadsheet, the conditional formatting will be applied.
As you can see, you now have alternating colors in the rows. You can insert, delete, and move rows, and you don't have to worry about reapplying formatting.

image 6: congrats alternate rows are now shaded.
As good as this is, the traditional green bar paper that I worked with was shaded in blocks of 4 or 5 lines.  In order to accomplish that, a better understanding of what is going on with the conditional formatting command is necessary...

The Excel MOD function returns the remainder after a number is divided by a [specified] divisor. The result of the function ends up having the same sign as divisor. So in this case the formula in the conditional formatting field (which was =mod(row(),2)=1) means that Excel is dividing the row number by 2, and returning the remainder (which is either 1 or 0).  If the remainder is equal to 1, then it is shading those cells as specified.

So, let's say that you want to shade blocks of 4 rows (like my green bar paper of old), the formula will need to be modified slightly.   In this case we want blocks of 4 rows to be shaded and then blocks of 4 rows to be unshaded.  This means one pattern of shaded and non-shaded cells is comprised of 8 rows (rather than 2 in the alternating scenario above).

However the remainder results from specifying a formula of =mod(row(),8) will range from 0-7. So grouping those numbers together we'd have rows with a remainder of 0-3 will be shaded and those 4-7 will not (i.e., the formula to type in the dialog box would be =mod(row(),8)<=3).

This would work perfectly, if the rows started with 0 instead of 1, but since the first row of any spreadsheet is row 1, the first cycle of shading only shades 3 rows.  Therefore, to get the formula to work properly a small modification needs to be made to the formula as follows:

=mod(row()-1,8)<=3
image 7: enter the modified formula in the formula bar
By subtracting one from the row number we are effectively forcing the rows to start at zero (as far as the formatting is concerned) and  everything works out perfectly:
image 8: groups of 4 rows are now shaded.
So, you can use this formula for any number of rows =mod(row()-1,2n)<=(n-1)

Where n = the number of rows you want grouped and shaded.  For instance if you wanted to shade every 6 rows the formula would be: =mod(row()-1,12)<=5.

QED