Simple Image Slideshow with jQuery and PHP

I really liked Jon Raasch’s jquery-powered slideshow, but integrating it into a page requires a bunch of steps:

  1. Add the jQuery library
  2. Add the slideshow javascript function
  3. Add the CSS with opacity and z-layer set properly
  4. Upload the images for the slideshow someplace
  5. Enumerate the images’ URLs that you want to cycle through

Adding images is tedious (you have to upload AND update the image list), and there’s no clean support for multiple slideshows per page. I wanted a process that made integration into other pages trivial.

I decided that an IFRAME to host the slideshow would keep jQuery and the slideshow CSS partitioned away from the rest of the embedding page, and would let adding slideshows to new pages have an easy-to-follow recipe, no matter what was already going on in the existing page. The IFRAME needed the template HTML, and if I used PHP, I could generate the image list for the slideshow automatically from the images that live in the same directory as the PHP script.

Continue reading

How to clean up photos of whiteboards with Gimp

beforeHere is a thumbnail of a picture of a whiteboarding session taken with my iPhone. It’s basically unreadable. I looked for a good recipe to clean this up in gimp, but the googles failed me.

After playing with a bunch of stuff with the gimp, here are the steps that I’ve found to work pretty well:

  1. Load the image in gimp
  2. Now for the magicks: Choose Filters >Edge Detect > Difference of Gaussians…diff-of-gauss
  3. Start with these settings. It doesn’t make it perfect, but it should make the lines stand out much better. Play around with the radius 1 and radius 2 values if you aren’t happy. Radius 1 needs to be bigger than Radius 2. Click OK.
  4. final-levels Return to  Colors > Levels… and move both the blackpoint and the midpoint to the right (to make the lines stand out) and the whitepoint to the left just a bit (to make the whiteboard white). Click OK.

Here’s the result:

after

Automatic panoramas with hugin and autopano

I’ve only been using hugin for an hour now, and I’m really impressed.

The mac binary doesn’t include the ability to automatically determine how images overlap, but it’s pretty easy to make that work, too.

First download the hugin binary. The Mac OS X port is here.

Then install the autopano binary.

First install MacPorts.

Then run:

sudo port selfupdate
sudo port install autopano-sift-c

I had a problem with cmake hanging during install. If port stalls for you, ctrl-c, then sudo port clean cmake ; sudo port install cmake ; sudo port install autopano-sift-c again.

Then tell Hugin where the binary is. Go to Hugin > Preferences… and click the “Autopano” tab, and make it look like this:

Close the preferences window, and the next time you use the “Assistant” tab and load images, you’ll see that the alignment is done for you automatically.

Here’s an example taken from Bryce Point in Bryce Canyon: (it’s also one of the banners).

50,000 photos in iPhoto on a shared laptop and external drive

I’ve got over 100GiB of photos (JPEG and RAW) taken over the years, and they don’t comfortably fit on a laptop. The laptop is also shared by everyone in my family, each with their own account, so what to do?

I found out that if you hold down the option key when you start iPhoto it asks for the location of your iPhoto Library — so that takes care of the first problem — just plug in a big external hard drive and you’re set.

There’s one glitch to having the photos on an external drive, though — Time Machine ignores exernal drives by default. Go into System Preferences… > Time Machine. Click “Options”. You’ll see your external drive in the “Do not back up:” list. Click the external drive holding your photos, then click the minus button.

The next problem is how to share the library with others. That’s described quite well by a Mac OS X Hint. Note that the following assumes you’ve named your external hard drive “Photos”.

Step 1: Enable ACLs:

sudo fsaclctl -p /Volumes/Photos -e

Step 2: Add the people that can use iPhoto. Replace “USERNAME” with the short login name of the people that you want to be able to use iPhoto:

sudo chmod +a "USERNAME allow read,write,delete,list,search,add_file,add_subdirectory,delete_child,file_inherit,directory_inherit" \
  /Volumes/Photos/iPhoto\ Library

Creating a group account, subscribing the users to that group, and letting group have read/write/execute to the directory should work, but the umask may not be 775. It’s something to check if this doesn’t keep working.

Photomatix HDR with single RAW images

We got to visit the Yosemite valley a couple weekends ago, and as I was gaping and smiling at all the grandeur, I tried RAW one more time.

When I got home, though, iPhoto’s conversion was disappointing:

I did some research and found Photomatix — and on the same RAW image, I couldn’t believe it was from the same input! It’s easy:

  1. Find the name of the RAW image (you can get the filename in iPhoto by hitting ⌘-i when the image is selected)
  2. File > Open File..., and type the name of the image into the search box. If you have a Canon camera, the file suffix will be .cr2
  3. click the “Details Enhancer” button:

HDR without a tripod! w00t!