Quick Photoshop Tutorial

As a photographer, and an obsessive-compulsive nut, I spend a lot of time working on tweaking photos in Photoshop. Inspired by a recent project, here’s my workflow for one image. Here’s what I started with:

It’s an aerial photograph, and certainly not a bad photograph. But it can be better!

The first thing I tend to address is how much detail is “lost” in the shadows and highlights. Often you’ll find a photo that looks washed out. (Less often, you’ll find one that’s excessively dark.) The good news is that, within reason, you can fix this up. The classic way is the Levels tool in Photoshop (Ctrl+L). But newer versions have a Shadows & Highlights wizard, something I’ve taken to using before I even get to Levels. The Shadows & Highlight tool (Image / Adjustments / Shadow & Highlight) gives you two sliders, one to bring out detail in the shadows (the dark regions), and one to bring out detail in the highlights (the exceedingly light regions). Here’s how it looks after a quick adjustment:

It’s definitely looking better. But it’s still not quite there. You have to be careful with the Shadows & Highlight tool, because applying too much results in an image that looks entirely artificial. You can adjust it so it starts to look like real life, but take it much further and you’re quickly at, “Wow, someone got carried away in Photoshop…” So I had to stop when the image was still slightly washed out. Take a look at the shadows cast by the buildings, which are the darkest part of the photo. The darkest part should be black, not gray. This is where Levels (Ctrl + L, or Image / Adjustments / Levels) comes in:

A few things to note. The graph is called a histogram, and it’s basically a graph of how much of the photo is each shade of gray, ranging from pure black on the left to pure white on the right. Short of just hitting the ‘Auto’ button (which often produces results I don’t quite like), the easiest way to tweak the levels is to drag the sliders appropriately. Pull the black arrow (underneath the graph, above the “0” text box) until it points to where the graph is just starting to slope upwards. (Or, more accurately, to where the graph is non-zero.) You could do the same with the whites, although in this case, it’s properly-adjusted.

In this case, this is all we need. Press “OK” and you’re done. (A more advanced technique that’s sometimes called for involves using the eyedroppers above the “Preview” checkbox. Click the black eyedropper, and then click on the photo to select what you want to define as 100% black. Do the same with the white eyedropper, selecting what should be pure white in the photo. The gray one is more tricky, as you’re setting color balance, but you essentially want to find a “neutral gray,” something like pavement. You really just click around until you find something that looks good. But in this case, none of this is necessary.)

After clicking OK, here’s what you get:

The shadows are now black. More generally, and perhaps more importantly, the photo no longer looks washed out. It’s properly exposed.

In this case it’s not bad, but the next step is to look at the color cast of the image. It’s more pronounced in other photos, which often have various color tints that they shouldn’t.

Here’s the Variations menu (Image / Adjustments / Variations):

>

Make a habit of clicking on the photo under “Original,” which will reset it. When you first start otherwise, it’ll save whatever settings you have from last time. Unless things are insanely bad, I tend to slide the slider over from the center to where it’s shown in the photo. Do this mostly just “to taste.” My end result is subtle:

Now, we’re basically there. One last thing. I like really “sharp” images. It’s not blurry per se, but it doesn’t have that “tack sharp” status. Photoshop makes it very easy to sharpen images. I tend to use the “Smart Sharpen” available in newer Photoshop versions, though the older “Unsharp Mask” remains popular and effective. Here’s the Smart Sharpen (Filters / Sharpen / Smart Sharpen…) dialog:

>

You set two things: the amount of sharpening to apply, and the radius of the sharpening. Here, I used settled on an amount of 66%, and a radius of 0.5 pixels. This sort of blend is common. Another alternative is the “haze” sharpen, which is something like 20/20 (a low 20%, but over a huge 20 pixels). Applying the 66%, 0.5-pixel sharpening gives us this image:

So here we are. We’ve made lots of subtle changes, but all of them are quick. But then jump back to where we started:

One additional tip: I didn’t need it here, but adjusting Saturation can help with some more dull-looking photos. Ctrl+U is the shortcut to memorize, but Image / Adjustments / Hue & Saturation is the menu entry. Just don’t go too overboard.

It’s Florida

What is it with Florida and screwing up elections?

Right now there’s a big debate over what to do with their election results, which officially don’t count, and in which no candidates were allowed to campaign. Hillary did anyway, and, unsurprisingly, won.

Of course, counting the votes is unfair–only one candidate campaigned, and she was breaking the rules in doing so. So obviously, it would favor her. But then again, not counting the votes would be equally unfair–you’re disenfranchising a whole state.

Right now, I suspect that, as with Florida and the 2004 general election, 2008’s Democratic primary is going to be very close. And we’re going to end up with a big fight over Florida, the outcome of which will swing the vote one way or the other.

Except I think we’re at a critical juncture. A united Democratic front can take back the White House in 2008. A bitterly-divided Democratic party, feuding over the nomination, is going to lose. And if we get into a “credentials fight” at the DNC, it’s going to be the latter.

So, from the 49 other states–actually, 48, as Florida isn’t the only one with problems: please, figure out how to hold an election!

Awesome Radios

So the Project 25 protocol, with its IMBE CAI digital voice, is being rolled out in huge numbers. Motorola’s ASTRO is the most commonly-used, although several other providers make radios that do the P25 standard, too.

They’re calling it interoperability. When you and the next town over both buy $3,000 radios doing a crappy 9600bps digital audio protocol, your radios can talk to each other! I’m really not sure who fell for this, since the existing strategy, analog voice, worked 100% of the time. They’re switching people over to a new, proprietary (kind of: the voice codec is proprietary, but it’s part of an open standard) digital system so that everyone’s radios can talk to each other. This has never made sense to me.

The other big problem is that there are multiple bands out there. In New Hampshire, VHF is most common. You’ll find police, fire, and ambulances between 152 and 161 MHz. (More or less: they expand a bit on both sides.) Massachusetts is big on UHF, with the police usually being between 460 and 490 MHz. But it’s not quite that standard–some municipalities do their own thing. The 800 MHz band is becoming big, too, especially with trunked radio systems. You find that a lot in big cities. (Indeed, I think Manchester and Nashua are on 800, though I don’t monitor either so I wouldn’t swear to it.) And now there’s a 700 MHz band coming out that’s slowly being introduced.

As a ham, we have allocations on VHF and UHF that are both very common: 144-148 MHz and 420 or 430 through 450 MHz. Since both are commonly used, a lot of ham radios will do both bands. So my ham radios merrily transmit on both VHF and UHF. But, for whatever reason, this never caught on with “commercial” radios, like the ones public safety agencies use. If you want your police cars to monitor VHF and UHF, you put two radios in them. God forbid you work for something like a huge city, or a regional task force, where you may need to communicate on VHF, UHF, and 800 MHz. That’s three radios everyone will need to carry.

Vertex (the “commercial” branch of Yaesu, a ham company) made a dual-band radio. Once. The FTH-2070 came out in the 80s (?) and did VHF and UHF in one radio. It was huge, but for people who needed both bands (lots), it was a huge boost. For some reason, no one ever made a radio to follow in its footsteps, and the radio hasn’t been made for several years.

So it’s actually a grand mess. You have four different bands that a public safety agency may be on. They might be using analog voice, or they might using digital. (And this isn’t even counting wacked-out proprietary standards like OpenSky / EDACS / SmartNet, which are all additional technologies that need their own radios.)

Finally, someone saw the light. Thales has announced The Liberty, a handheld that supports P25 digital (and, of course, analog voice), and covers all four major bands. Pricing is rumored to be around $5,000, but you have to keep in mind that it’s doing the job of four radios that would probably cost $2,500 each. It’s SDR-based, front-panel programmable, and supports several different encryption protocols as well.

Thales previous filled a bit of a niche market. It looks like they do a lot of government stuff, and I seem to recall them being bigger overseas (but maybe I’m confusing them with another company). But this radio has a lot of high-end radio afficionados over here drooling. They not only did a dual-band radio, but they did a multi-band radio. It’s got a big color screen. (What the functionality is remains to be seen.) I think a lot of people, not just me, are hoping that this will lead to more competition, which will lead to more innovation.

Captchas

For those not aware, “captcha” is the name given to the little images with distorted text. The premise is that a human can figure out what they say, but that a computerized “bot” cannot. Thus they’re used to keep people from writing scripts to sign up for hundreds of accounts, or to prevent spammers from leaving comments. (Incidentally, there are some clever ways to defeat captchas. The most creative was a group of people that apparently started a “free” porn site, where users only had to complete a captcha to sign up. Except that the captcha actually came from another site: they were essentially getting hundreds of porn-starved people to help them bulk-register for various accounts!)

Anyway, besides causing major problems for the visually-impaired, there’s another problem with captchas… Consider the one I got the first time I tried to sign up for Hulu:

The Most Awesome Thing…

…Ever.

Hulu. You can watch TV shows online. In (seemingly, I don’t know the exact resolution) high def. That’s pretty cool. Plus, it’s legal. Oh, and, the most important part: there’s no catch… It’s free. You sign up and watch TV shows.

With shows like Arrested Development, The Office (only 9 episodes right now), House (only 2 episodes), Psych (5), Monk (6), Journeyman (13), I Dream of Jeannie, National Geographic Presents, and…

Alright, you know what? I started listing the cool shows to write a nice, proper review. But the truth is, I really don’t want to write this anymore. I have 8 episodes of The Office, and an episode each of House and Psych to watch. And that’s just of the first four series I’ve listed. Paging through the list of shows to list the ones I love, I realized that I’d much rather be watching Hulu than writing about it.

So sign up and come join me in what might be the single biggest blow ever dealt to American productivity.

PayPal

PayPal’s really been getting on my nerves.

About a month ago, they froze my account, citing protecting my security. They said someone had attempted to access my account, they said. I performed the first two verification steps, but now I’m waiting on mail at home with a “security code” I have to enter to confirm it. Of course, it’s been almost two weeks with no mail from them.

So, through the PayPal site, I sent them a message asking what was up. I should clarify that I’m absolutely positive it was the “real” PayPal site. The certificate matches, and I initiated the access, so it’s not like I’m getting e-mail asking me to click a link (to paypal.com.this.is.a.scam.geocities.com)

It just bounced back to me, citing an unknown user on their end.

So I’m now approaching a month with no access to my account. I am not impressed, especially by their internal contact form bouncing back to me.

Professionalism

I frequent WebHostingTalk.com, a really good forum for people in the web hosting industry. There are lots of really knowledgeable people on there, but there are also sorts of people without so much technical knowledge….

There was one guy a while back who announced that he was starting a video sharing site (a la Youtube) and that he’d need 450 petabytes of transfer a month. No one was quite sure how to respond, since this is orders of magnitude more than anyone measures anything in. I calculated that he’d be using about 1,400 Gbps. (And that’s an average… Real traffic patterns for big sites are more of a sine wave, so you’d probably want about 2,000 Gbps aggregate capacity, which you’d be filling at peak hours.) I’m fairly certain that even a site like Google doesn’t use anything like that. In fact, I’m fairly certain that even if a site like Google called up their providers and asked for 1,400 Gbps, they’d be laughed at. No one out there can provide that.

But some are just distressing. One guy posted, maybe a year ago, that he was getting a “private room” and didn’t know what he’d need for equipment. Did he need a router? Switches? A “private room” in a data center, by the way, is to host your many racks of servers, walled off from others for maximum security. You’ve got to be a very big place, with a very big budget, to be doing that. This is kind of like asking, “I’m buying a 500,000 square foot warehouse. What do I need? Do I need a forklift? Lights?” (A lot of answers were basically, “What do you need? You need an IT department, and someone who doesn’t have to ask this question.” Although my favorite answer was, “Padded walls.” Normally it annoys me when people give rude answers online, but I couldn’t help but burst out laughing.)

Today’s post is from a guy who seems to have about 30 servers with one company, running what I can only assume is a successful hosting company. He’ll fill one server and order another, but he’s having difficulty “managing” the traffic–he wanted to pool all of the bandwidth together. This is something that most big companies will do for you if you ask, since you’re a huge customer and they know that their competitors will do it if they don’t.

If you buy a dedicated server, you’re usually given a bandwidth allocation in GB/month. I’m allowed 1,000 GB a month, for example. (And I don’t use 5% of it.) This comes out to using about 3 Mbps 24/7, but it’s much more convenient for me since I don’t have to worry about momentary usage, just the net amount of transfer moved. There are also subtleties here: I have 1,000 GB over a 10 Mbps line. 1,000 GB means that my average use can be up to 3 Mbps. But, in real life, as I mentioned, traffic patterns ebb and flow. If I were using 3 Mbps average (I’m not), I might be using 5 Mbps during the day, and 1 Mbps at night. So just giving me a 3 Mbps line wouldn’t cut it, since it’d be really crappy during the day.

But this guy’s host quoted him a price in Mbps. He was very confused by this. He was used to his GB/month, and didn’t know what to make of these foreign “Mbps” measurements.

Someone else just posted about how some guy with the IP 0.0.0.0 keeps connecting to him, and wondering if he should ban that IP, which he thinks is awfully suspicious. (It’s not as bad as the guy who was getting people with “blank IPs” connecting to him, and wondering if he could ban a null IP in his firewall… It turned out that he was running some random command which was returning way more than just IPs, hence a number of blank lines…)

Who are these people? I wouldn’t post a blog making fun of people who didn’t know otherwise obscure things, except that these should be basic little tasks for people in these positions. It’d be like a certified (not certifiable, but certified) sysadmin for Windows systems posting and saying, “I need to change my desktop background? How can I do this?” Or a car mechanic, who’s gone on and opened his third garage, posting and saying, “The oil in my car is old and dirty. Is it possible to somehow drain the old oil and put new oil in?” Or, for the more absurd requests we see, someone posting on a financial forum about how they’re starting a lemonade stand and think they need $750 billion in startup capital, wondering what bank will give them a better interest rate. It just shocks me that these people are successful and yet so clueless.

BitTorrent is Cool

Having recently pulled down some updates via BitTorrent, I discovered a cool neat thing about the protocol. Obviously, it’s basically a peer-to-peer filesharing tool. But it has some neat things that keep it working well. Files are split up into many pieces, and each of those chunks can be downloaded from anyone. (Apparently, various file-integrity provisions exist, too, to help guard against people injecting garbage.)

The first neat thing is the concept of “choking” selfish systems. As I download chunks, my torrent client will automatically start sharing the completed chunks. If my client detects that you’re downloading completed pieces I have, but not sharing the completed pieces you have, you get “choked,” or banned. I stop sharing with you. (Periodically, an “optimistic unban” will kick in, giving you another chance.) This greatly increases the incentive for you to share files: otherwise, everyone would want to download only, meaning that very few people had the file.

The obvious problem is that the file, if one piece is missing, is useless. If you take a random 1MB chunk out of the middle of Microsoft Office, the whole program will fail to work. (Not that I condone downloading MS Office via BitTorrent. After all, it’s free from school!) So it’s important to make sure that no pieces become unavailable. So most clients implement a neat algorithm, called “rarest first.” The name sums it up pretty well: as clients go out advertising what pieces of the file it has, it will go out and grab the least-available pieces first. And after I finish that piece (and, by necessity, begin advertising that piece to peers), I go and get the next-rarest piece. Since the whole is useless without all the parts (the whole point of the rarest-first system), it doesn’t matter what order I acquire them in, thus permitting each client to help raise availability.

Overall, the more I read about the inner workings, the more impressed I am.

BitTorrent

A few tips, in the hopes that it’ll help someone else. (Aside: don’t download illegal stuff with BitTorrent. Do download the many awesome, legal things on BitTorrent, such as Ubuntu torrents.)

  • You can encrypt your BitTorrent traffic, which is meant at circumventing ISPs that feel like being pains and blocking traffic. However, “Enabled” isn’t the value you want. You want “Forced.” In uTorrent, this is under Preferences -> BitTorrent.
  • If you don’t upload at all, other nodes will “choke” you by refusing to talk to you. It doesn’t seem to me like it has to be entirely equitable; I’ve capped my upload at a pretty small number, but am downloading around 100 kB/second (800 kbps).
  • You’ll have a port number for incoming connections. If this port isn’t coming through (such as if you have a “default-deny” policy), things will work, but they’ll be unbearably slow. As an aside, if you’re behind an OpenBSD firewall (using pf), have a local IP of 192.168.1.79, and use the randomly-selected port 26689 as your local port for BitTorrent, the firewall rule looks like rdr on $ext_if proto tcp from any to any port 26689 -> 192.168.1.79 port 26689. Remember to flush the rules (pfctl -F rules) and then (possibly required? possibly done automatically with the flush?) load them back in (pfctl -f /etc/pf.conf).

With these three principals in mind, my (legitimate) download went from 0.8 kB/sec to 145 kB/sec.

Huh, a neat tip… If you pick a torrent from one site, but it’s something identical to what other sites have, add the additional trackers in to the first download, which will give you more peers!

Oh, another tip: don’t arbitrarily set a download limit! My downloads wouldn’t break 145 kB/sec or so, until I realized that I’d set a limit of 150 kB/sec. I removed the limit and am suddenly at 400 kB/sec. (Incidentally, our available bandwidth has suddenly plunged to nothing…)

One final note: Peer Guardian is good, but don’t run it unnecessarily, since it blocks a lot of legitimate traffic. Including, oddly, Steam’s servers (for games like Counter-Strike and TF2), apparently because they use Limelight’s CDN, and they’ve dubbed Limelight bad?

Activation

My debit card expires this month, so I just got a new one in the mail. It has a number you have to call to activate it. So I dialed, and it rang twice. (I’m used to auto-answer systems picking up on the first ring, but whatever.)

I expected something like, “Thanks for calling Visa! To activate a card, press 1…”

Instead, I got:

“November 8, 2007!!!”

[awkward pause]

[lengthy message in Spanish directing Spanish speakers to press 2]

“Here’s how I can help you.”

[awkward pause]

[To activate a card, say “Activate a card.” To report a lost or stolen card…]

Me: “Activate a card.”

“Okay.”

[awkward pause]

“Please say the last four digits of the card.”

Me: [does so]

“All cards associated with this account have been activated. Goodbye.”

It was the strangest thing. And while “normal people” may like it, I find it extremely awkward to speak to computers on the phone. I’d think it would be less error-prone if I was asked to dial the last four digits. And it would certainly feel less awkward than me sitting in the living room saying, “Activate a card! 1-2-3-4!”

The worst is the greeting. Especially when it comes to credit cards, it’s important to at least pretend you’re a real company. Shouting (excitedly) a date and then having a couple seconds go by doesn’t inspire too much confidence.