RSS Home New Gadgets

Posts Tagged ‘ step-by-step

Punch Up a Photo in Under 60 Seconds [Step By Step] 21 October 2008 at 7:15 pm by admin


Using a couple of basic tools in Photoshop and other image editing programs, you can take a flat image and make it pop with just a little bit of effort and no experience in the finer arts of exposure and color correction. With a little practice, you can get some quick and dirty work done in just seconds that will make your presentation, blog, or social network profile pictures look a lot better online. Even cellphone snapshots can be made presentable while your instant noodles soften. Here’s how:

This bulldog is quite cute, but the flat contrast, dead colors, blur and noise aren’t doing it’s already comically bemused mug any favors. Let’s see if we can’t create a profile picture that will get the pack on Dogster howling. While for the purposes of this demonstration I’ll be using Photoshop, the same work can be done in GIMP, Paint.NET and other full-featured image editing software applications.

Love Your Curves

Select Image > Adjustments > Curves from the Photoshop drop-down menus. Welcome to the most awesome digital image editing tool known to human (and bulldog) kind.
See the three eye-dropper icons near the bottom? Our first chore is to select the first one to set the black point of the image. The goal is click on the darkest portion of the image in order to set the low threshhold for detail. The point you select and everything darker will become true black. I selected a corner of shadow in the top-left of the image.
Next, we use the middle eye-dropper to set the gray point. It doesn’t matter how dark or light the point is — just that it’s supposed to be a neutral gray tone. This can quickly remove a color-cast, which often occur when a camera set to indoor light is used outdoors or vice-versa. If a gray object has a reddish tinge, for instance, this feature will make it color-neutral and shift the colors in the rest of the image accordingly. I selected a bit of what’s supposed to be white wall near the top of the image.Finally, we use the last eye-dropper to set the white point. This is pretty much the opposite of setting the black point. Click on the brightest portion of the image, in this case, the highlight on our furry friend’s cheek.
Now our simple black diagonal line has been joined by red, green and blue friends. These represent how the eye-droppers adjusted the red, green and blue parts of the image. Behind them, the gray shape is called a “histogram,” and shows the distribution of tones in the image. What we want to do is make sure the range of tones in the final photo equals the possible range of a digital image. So we grab those little sliders at the bottom and adjust the dark and light points to match where the colored lines first meet the bottom and the top of the graph, respectively.
Now that the image is as color-correct as you can expect after twenty seconds of fiddling, we’ll want to bump up the contrast. Why should you hate Brightness and Contrast? Because it would preserve all the image data in the shadows and highlights that our histogram promises is there. So instead we’ll create an “s-curve” to pump up the contrast. First, select a point midway along the black diagonal line. Just click to select — don’t move it.
Now we’ll select another point halfway between the midpoint and the highlight, or three-quarters of the way up the line. This we’ll move very slightly up and to the left.
Add a point on the other side of the mid-point, and move it a little down and to the right. The more extreme your “s” the more contrast you’ll perceive. (Inversely, if you have a u-shaped histogram with lots of color information in the dark and light areas, you can reduce contrast by pointing the “s” in the other direction.)

Unsharp Mask is Your New BFF

There are two problems with this image, and we can fix one but not the other — namely, it’s a little blurry thanks to the cheap plastic iPhone lens, and it’s “noisy” (the spattering of grainy color throughout) because of the cheap iPhone image capture chip and heavy doses of JPEG compression. Sharpening increases the contrast between a range of pixels, which can make the image clearer but also brings out the noise. Normally you might just try Filters > Sharpen > Sharpen or Filters > Sharpen > Sharpen More and eyeball it, but this calls for a little finesse. Since I’ll be reducing the image size quite a bit, I’m going to go for sharp and a little noisy, and use Filters > Sharpen > Unsharp Mask to massage it. Amount sets how much additional contrast is desired, radius determines the are sampled around each pixel, and threshold sets how different two tones need to be before the filter kicks in. Futz with these for a few seconds until you like what you see — I’d say my adjustment is about medium-to-light sharpening.

Don’t Be an Image Size Queen

While you want to start with the highest-resolution image with the least amount of compression you can, and do all your adjustments and filters at that size, you don’t want to choke up someone’s screen real estate and bandwidth with a huge image. And nothing smooths over the bumps in a photo’s personality like a trip to the shrink. Select Image > Adjustments > Image Size and re-size it to something appropriate (in this case, I re-sized to 247 pixels wide by 300 pixels tall for the before-and-after images at the top).

Compress Your File Into Skinny Jeans

Don’t be a bandwidth-hog with fatty files. Use File > Save For Web to let you set the compression level and preview both the image quality and the file size. By default, I usually set the JPEG compression level to 65 — which in this case means an image just a tad under 25 kilobytes, which shouldn’t bother broadband users. Et voila, our sweet puppy will soon be getting invitations to all the best purebred parties.

(Original image by Artur Bergman)


+ Integrate Launchy with Wget [Download Managers] By admin 10 October 2008 at 5:00 pm and have No Comments

Reader Justin writes in with a clever idea for quickly launching downloads with the popular command-line download manager, wget. His method: Make wget available to Launchy, then pass the URL of the file you want to download to wget through Launchy. Here’s how it works:

  1. Install Launchy.
  2. Download wget and copy the files from the unzipped folder to C:Windows.
  3. Create a shortcut to C:Windows/wget.exe and rename it dl.
  4. Place that shortcut in your Start menu. To configure wget to start minimized, right-click the shortcut, select Properties, and tick the checkbox next to Run minimized.
  5. Finally, to set the download directory, set the working directory (Start in) to your download folder of choice.
  6. Now simply rebuild your Launchy index, and voila!

To download a file with wget, just invoke Launchy, type ‘dl’ (though I actually stuck with wget), hit Tab, then paste the link. It works great, and it’s a really handy shortcut if you want to start a quick download. Not terribly familiar with wget but like this idea? Check out our previous guide to mastering wget. If the command line isn’t your cup of tea but you wouldn’t mind a little more flexibility with your downloads, take a quick look at the Hive Five Best Download Managers. Thanks Justin!


+ Block Ads on Your Jailbroken iPhone or iPod Touch [Step By Step] By admin 08 October 2008 at 12:05 pm and have No Comments

Whether you’re on Wi-Fi or an EDGE/3G cellular connection, many web pages would load up a heck of a lot faster on the iPhone’s Mobile Safari browser if you weren’t stuck waiting for “LOWER YOUR INTEREST RATES NOW” and the like to push through on Mobile Safari. If you’ve jailbroken your iPhone or iPod touch, however, there’s a none-too-hard hack you can make to block a good number of ads from slowing down your page loads. Here’s the step-by-step instructions for doing so:

  1. If you haven’t done so already, you’ll need to jailbreak your iPhone or iPod touch. We’ve previously posted guides for doing so in Windows with WinPwn, and with the PwnageTool on a Mac.
  2. Click the Cydia icon on your jailbroken device. Choose the “Search” function from the bottom, and type in “OpenSSH” (without the quotes) until you can see that package. Click it, choose “Confirm” in the upper-right to install, then re-start your device.
  3. Once your iPhone/touch reboots, head to Settings, then Wi-Fi, then click the arrow next to the Wi-Fi server you use at home. Write down the IP address. Head back to Settings, choose General, and set Auto-Lock to “Never” (for the time being).
  4. You’ll need an FTP client with SFTP (secure SSH connection over FTP) to connect and trade files with your device. Windows users should try the free FileZilla (which also comes in a no-install portable package), and Mac users’ best bet is Cyberduck.
  5. On your computer, download this replacement hosts.php file from the James is Bored site. Open your FTP client, set it to connect over an SFTP connection, and then put your iPhone/touch’s IP address in the “host” section. Your username and password (unless you changed them) are root and alpine, respectively. The connection may take a few minutes at first, and you may be asked to accept a host key; say yes to any prompts, and be prepared to try again if the connection fails at first.
  6. Navigate to to the /etc folder at your device’s root. Grab the hosts.php file you see there, and place it somewhere secure on your computer (i.e. somewhere it won’t get over-written with the James is Bored modified file). This can usually be done in a drag-and-drop fashion.
  7. Copy the modified hosts.php file to your device and replace the version there. Close your FTP client, and restart your iPhone or iPod touch.

You should start seeing blank spaces or compressed frames where ads used to be. This hack will still leave blank spaces where Flash-based ads would normally be, but display ads from a number of common ad servers should be blocked. If anything important gets blocked, you can easily re-copy your original hosts.php file back to your device.

I found a few sites—including the New York Times—where the ad-blocking just didn’t seem to work, likely because the ads are served through an in-house server. Other places, it worked liked a charm.

Got another method for scaling back ads on your iPhone? Have a better, compatible hosts file to replace the default with? Tell us about it in the comments.

Blocking Safari Ads [James is Bored]


+ Set Up Universal Ad Blocking Through Your Router [Step By Step] By admin 07 October 2008 at 6:15 pm and have No Comments

If you’ve turned your $60 router into a user-friendly super-router with open-source firmware Tomato, you already know that Tomato can boost your Wi-Fi signal, track bandwidth usage, and set Quality of Service rules with ease. But if you’re a big fan of Adblock Plus—the most popular Firefox extension among Lifehacker readers—you can save yourself an extension installation and universally block ads across your entire home network by adding a custom script to your Tomato firmware. Here’s how it works:

There are several ad-blocking scripts available that could work, but the one I’m using comes from this forum post. Thanks Tad!

Installation

1. Open the Tomato Admin Scripts interface
You’ll need to login with the user name and password you set in our instructions for installing Tomato. Once you’re logged in, make sure to click on the WAN Up tab.

2. Copy the ad-block script to Tomato
I’d recommend going directly to the source, since the author of the script updates it regularly in the top post. As of this writing, the script looks like this:

#!/bin/sh
## Adblock script [Version 2.1 | 08 July 2008 | 3778 bytes]
##
## Created by Adrian Jon Kriel: root-AT-extremecooling-DOT-org
##
## tomato WAN Up script
##
## 0 = disable
## 1 = enable
## (1) = default value
## optimising of dnsmasq, (1)
eval OPTDNSMASQ=”1″
## automatic updating, (1)
eval AUTOUPDATE=”1″
## MVPS HOSTS ~18,500 lines, 680 Kbyte, (1)
eval MVPSSOURCE=”1″
## pgl.yoyo.org ~2,200 lines, 68 Kbyte, (1)
eval PGLSOURCE=”1″
## hosts-file.net ~53,000 lines, 1.5 Mbyte, (0)
eval HSFSOURCE=”0″
## Hosts File Project ~102,000 lines, 3.0 Mbyte ***6+mb free memory***, (0)
eval HFPSOURCE=”0″
##
## varibles
## location of temp file, (/tmp/hosts)
eval GENFILE=”/tmp/hosts”
## redirect ip, (0.0.0.0)
eval REDIRECTIP=”0.0.0.0″
## sources
eval MVPSOURCEFILE=”http://www.mvps.org/winhelp2002/hosts.txt”
eval PGLSOURCEFILE=”http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts”
eval HSFSOURCEFILE=”http://www.it-mate.co.uk/downloads/hosts.txt”
eval HFPSOURCEFILE=”http://hostsfile.mine.nu/Hosts”

if ping -c 1 yahoo.com ; then

eval GOTSOURCE=”0″
echo “” > $GENFILE
## download
if [ "$MVPSSOURCE" = "1" ] ; then
if wget $MVPSOURCEFILE -O - >> $GENFILE ; then
logger ADBLOCK Downloaded $MVPSOURCEFILE
eval GOTSOURCE=”1″
else
logger ADBLOCK Failed $MVPSOURCEFILE
fi
fi
if [ "$PGLSOURCE" = "1" ] ; then
if wget $PGLSOURCEFILE -O - >> $GENFILE ; then
logger ADBLOCK Load $PGLSOURCEFILE
eval GOTSOURCE=”1″
else
logger ADBLOCK Fail $PGLSOURCEFILE
fi
fi
if [ "$HSFSOURCE" = "1" ] ; then
if wget $HSFSOURCEFILE -O - >> $GENFILE ; then
logger ADBLOCK load $HSFSOURCEFILE
eval GOTSOURCE=”1″
else
logger ADBLOCK Fail $HSFSOURCEFILE
fi
fi
if [ "$HFPSOURCE" = "1" ] ; then
if wget $HFPSOURCEFILE -O - >> $GENFILE ; then
logger ADBLOCK Load $HFPSOURCEFILE
eval GOTSOURCE=”1″
else
logger ADBLOCK Fail $HFPSOURCEFILE
fi
fi

if [ "$GOTSOURCE" = "1" ]; then
logger ADBLOCK Got Source Files
#FREE MEMORY!
service dnsmasq stop
killall -9 dnsmasq
logger ADBLOCK Ignor Fail Safe
##strip source file
sed -i -e ‘/^[0-9A-Za-z]/!d’ $GENFILE
sed -i -e ‘/%/d’ $GENFILE
sed -i -e ’s/[[:cntrl:][:blank:]]//g’ $GENFILE
sed -i -e ’s/^[ t]*//;s/[ t]*$//’ $GENFILE

## dnsmasq, sanitize, optimised
sed -i -e ’s/[[:space:]]*[.*$//' $GENFILE
sed -i -e 's/[[:space:]]*].*$//’ $GENFILE
sed -i -e ‘/[[:space:]]*#.*$/ s/[[:space:]]*#.*$//’ $GENFILE
sed -i -e ‘/^$/d’ $GENFILE
sed -i -e ‘/127.0.0.1/ s/127.0.0.1//’ $GENFILE
sed -i -e ‘/^www[0-9]./ s/^www[0-9].//’ $GENFILE
sed -i -e ‘/^www./ s/^www.//’ $GENFILE
## remove duplicates (resource friendly)
cat $GENFILE | sort -u > $GENFILE.new
mv $GENFILE.new $GENFILE
## format
sed -i -e ’s|$|/’$REDIRECTIP’|’ $GENFILE
sed -i -e ’s|^|address=/|’ $GENFILE
## load values from dnsmasq config
cat /etc/dnsmasq.conf >> $GENFILE
## optimise dnsmasq
if [ "$OPTDNSMASQ" = "1" ] ; then
cat >> $GENFILE <<EOF
cache-size=2048
log-async=5
EOF
fi

## remove/whitelist websites
## removes 3 websites (aa.com, bb.com, cc.com)
## remove the # and edit the website urls.
sed -i -e ‘/aa.com/d’ $GENFILE
sed -i -e ‘/bb.com/d’ $GENFILE
sed -i -e ‘/cc.com/d’ $GENFILE

## apply blacklist
dnsmasq —conf-file=$GENFILE

## failsafe added
dnsmasq
logger ADBLOCK Ignor Fail Safe

## dev info
logger ADBLOCK Unique Hosts Blocked $(awk ‘END { print NR }’ $GENFILE)
else
logger ADBLOCK Error Not Downloaded
fi
else
logger ADBLOCK Error No Internet
fi
## remove the generated files
rm $GENFILE*
## automatic update
if [ "$AUTOUPDATE" = "1" ] ; then
## script exists
if [ -x /tmp/script_wanup.sh ] ; then
cru a UpdateAdlist “0 6,12,18,0 * * * /tmp/script_wanup.sh >/dev/null 2>&1″
fi
fi
## the end

You should paste the script into the blank text area in the WAN Up tab we navigated to above.

3. Save the script by clicking the Save button.

4. Reboot your router to enable the script.

That’s all there is to it. Next time you visit a web site, you should notice a conspicuous lack of ads. The same should be true from any computer, as long as its connected to your Tomato router.

There are some unfortunate bits and pieces about this method versus the Adblock extension that you might want to take into consideration before setting it up on your router. First, if you want to whitelist a site, you have to manually edit the script by changing the following section:

## remove/whitelist websites
## removes 3 websites (aa.com, bb.com, cc.com)
## remove the # and edit the website urls.
sed -i -e ‘/aa.com/d’ $GENFILE

…replacing aa.com with the site you wanted to whitelist. Keep in mind that whitelisting does not work for whitelisting all ads on a specific site—instead, if you’re having trouble opening a site you want to look at because it’s on a blacklist, whitelisting that site will let you access that one specific site. As someone who makes a living writing for an ad-supported web site, I normally encourage people to allow ads on sites they care about. Unfortunately the script doesn’t allow you to whitelist all ads on specific sites. (It may be possible, though, so if you know how to go about doing so, I’d love to hear it in the comments!)

I am aware that many of you rely on ad-blocking scripts or extensions to speed up your slow internet, (in fact, we’ve recommended that you do as much to survive a slow internet connection), and others of you just hate dealing with the eyesore that flashy ads can cause.

So while I still heartily encourage supporting sites you frequent, this simple script makes setting up a universal ad-block on your home network a breeze. If you’ve used a similar method to block ads across your network, let’s hear about it in the comments.


+ Create a Secret Data Stash with a Fake Phonejack [Weekend Project] By admin 05 October 2008 at 10:00 am and have No Comments

While not as grandiose as having your own secret bookshelf door, constructing a hidden USB data stash won’t take a whole weekend and involve a table saw. At the DIY website Instructables there is a step by step tutorial on hiding your data behind a phone jack plate. By wiring a USB cord to the phone plate and making a USB cord with a phone jack terminal at one end, you’ll be able to access your secret data stash. If you’re not up for a bit of wire splicing and soldering, check out our top 10 USB thumb drive tricks.

Hidden USB Storage [Instructables]


+ The 100-inch Rear Projection Television Upgrade [DIY] By admin 29 September 2008 at 5:10 pm and have No Comments

Owning a honking rear projection TV is an ever-increasing WASP social stigma, that is, unless it’s so freaking huge that neighbors admire it with the same jealous-of-waste gleam in their eye as your original Hummer. One modder takes us step by step through how he removed the screen of his “big screen” TV and swapped it with a 100-inch replacement. The end result is successful, even if his craftsmanship is a bit wobbly around the edges. But the catch? It looks like it now runs at lights-off brightness levels. You know, like a cheap projector or something… [BonMul via HackaDay]