Archive: Photography
May 10, 2008
Reading EXIF data from images in Javascript

Jacob Seidelin figured out a way to obtain EXIF data from images in Javascript, allowing AJAX applications to pull information about the make and model of camera used, as well as any aperture, focal length, or description information that may have been tagged to an image by the camera or a photo editor.
The exif.js javascript library scans through all IMG tags in your HTML document, looking for the custom exif="true" parameter to be set. The DOM image object doesn't contain the necessary raw image data, so XMLHttpRequest is used to fetch the image data. In Safari and Firefox, the responseText property contains the binary image data. This isn't available in IE, however, but Jacob was able to put together a VBScript alternative that is still able to pull the data from the response.
From your code, pulling the EXIF data for an image becomes as simple as this:
var theimg = document.getElementById("imageid");
alert("Image Make: " + EXIF.getTag(theimg, "Make") + "\nImage Model: " + EXIF.getTag(theimg, "Model"));
How cool is that? I expect we'll see this in every ajax photo gallery soon.
Reading EXIF data with Javascript
Posted by Jason Striegel |
May 10, 2008 08:52 PM
Ajax, Photography |
Permalink
| Comments (1)
| TrackBack
| Digg It
| Tag w/del.icio.us
May 6, 2008
Using the Canon Hacker's Development Kit

Lifehacker's Adam Pash put together a nice overview for using CDHK, the firmware enhancement toolkit for consumer-grade Canon point and shoot cameras. With CHDK and a compatible Canon device, you can capture images in RAW format, display live RGB histograms while shooting, and even write custom UBASIC scripts to take time-lapse photos or capture lightning strikes. It does all this while running from an SDCard, so it doesn't require permanent modification to the camera's firmware.
Turn Your Point-and-Shoot into a Super-Camera
Canon Hacker's Development Kit WIki
UBASIC Script Programming
Posted by Jason Striegel |
May 6, 2008 08:23 PM
Photography |
Permalink
| Comments (0)
| TrackBack
| Digg It
| Tag w/del.icio.us
March 18, 2008
Paper cameras - old and new

In 1970's Communist Czechoslovakia, the state-run magazine ABCs for Young Technicians and Natural Scientists published a cut-out paper camera called the Dirkon. Looking very much like an old Nikon, the little camera is essentially a simple pin hole design, dressed up to look like its SLR cousin.
Fast forward to 2000's Capitalist USA and you'll find the ReadyMech Cameras which were recently released by adver-warehouse Corbis. Retaining much of the Dirkon cool factor, but looking nothing like a contemporary SLR or digital, there are a number of bizarrely awesome models to choose from.
Whether you dig the ReadyMechs or the classic Dirkon, making the cameras is as simple as printing out a PDF on heavy-weight paper, and following some simple instructions to cut, fold and tape the camera together. To use the camera, you assemble the package around a standard roll of ISO200 35MM film, wind between shots, and pull a little tab aside to expose the film for 10 seconds or so, depending on how bright the lighting is. Getting a clear photo is all about holding still (or setting the camera on a solid surface during exposure).
The Dirkon Paper Camera
ReadyMech Cameras
Posted by Jason Striegel |
Mar 18, 2008 08:29 PM
Photography |
Permalink
| Comments (0)
| TrackBack
| Digg It
| Tag w/del.icio.us
March 12, 2008
CNC hologram

I posted earlier this week about abrasion holography, a hologram technique that uses a network of simple arc shaped scratches to encode a visible, 3D hologram into a chunk of plastic. Carl was the first to comment on exactly what was on a number of peoples minds:
This is just crying out for someone to generate complex pictures using CNC.
Like many great ideas, someone has already worked this one out! William Beaty was kind enough to write back with a link:
The scratches need to be be almost perfectly smooth with no jaggies at all. Normal CNC doesn't work, but a couple months ago Evan at homeshopmachinist.net found that "drag engraving" does reduce the jaggies enough.
The photo above is Evan's cube, engraved on blackened copper. The top image is what you see in normal diffuse lighting. The bottom is one perspective of the hologram when viewed head-on under a point-source light. Evan writes:
The way this type of hologram is generated is to start with a 2d representation of the subject (the cube in this case). Then an arc is drawn using a point on the visible vertices and edges of the shape. A set of closely spaced points along all visible edges is then used to provide the anchor points for the radii of the arcs. The reason the image isn't perfect appearing is because of slight inaccuracies in the placement of the arcs (my fault) and some waviness in the copper plate which is only 26 gauge material.
There are a lot of creative possibilities with this one. First person to engrave a HACKS hologram on a copper business card wins a standing ovation.
Synthetic Holograms With a CNC Mill - Link
DIY Hand-Drawn Holograms - Link
Posted by Jason Striegel |
Mar 12, 2008 08:51 PM
Photography, Science |
Permalink
| Comments (0)
| TrackBack
| Digg It
| Tag w/del.icio.us
March 8, 2008
DIY hand-drawn holograms

Typically the creation of a hologram involves lasers and various other expensive equipment and materials. William J. Beaty figured out a low-tech way to create your own holograms using a simple abrasion technique that requires only a compass and a chunk of plastic. He came across the idea while walking through a parking lot, noticing strange hand prints that seemed to float above or deep inside the surface of polished car hoods.
The images were naturally-occurring holograms. The owner of the car had obviously polished the hood with a dirty mit, and the millions of particles of grit in the mit traced out millions of nearly-parallel scratches in the black paint. The particular hand motion had created a geometry of abrasion patterns which turn out to be nearly identical to the interference patterns which make up those embossed-foil Benton whitelight [holograms].
So how do you make one? All you need is a spanner (compass with 2 needles) and a chunk of hard plastic such as Lexan. For simple flat shapes, you just draw the reference shape below where you want the hologram to appear. Set the diameter of the spanner to an inch or two, put one of the points on the shape and score a small arc across the plastic. You then repeat this process for a bunch of other points on the shape, leaving a number of small arc shaped scratches. When you observe the scratches in the light, you'll see a hologram of the shape that appears to float beneath the surface of the plastic.
The image above, from William's site, is actually a stereo photo of one of his holograms. You can cross your eyes to see the effect. The cube that reflects from the scratches appears different based on the angle you view it.
The depth of the hologram is related to the width of the spanner, so you can actually create three dimensional holograms using the same technique. William's FAQs have more details on doing this, as well as hints for creating opaque shapes that have other objects hidden behind them which are only viewable from certain angles.
Abrasion Holography - Link
Posted by Jason Striegel |
Mar 8, 2008 07:42 PM
Mind, Photography, Science |
Permalink
| Comments (6)
| TrackBack
| Digg It
| Tag w/del.icio.us
February 28, 2008
Detecting forged photos algorithmically

John Graham-Cumming posted an automated tool for detecting "Clone Tool" Photoshop forgeries. Photojournalism ethics issues (LInk, Link) aside, John had some ulterior motives:
I was motivated to work on this program by greed (or at least my never-ending love of having a little flutter on things). Best of the Best runs spot-the-ball competitions in airports to win very expensive cars. But they also run the same competition online. That meant I could get my hands on the actual image used... could I process it to discover where the ball had been removed? (In reality, this isn't the right way to win because the actual ball position is not governed by where it actually was, but where a judge thinks it was).Would it be cheating if I could? Apparently not, the competition rules say I should use my skill and judgment in determining the ball position. Surely, skill covers my programming ability.
So, I went looking for tampering algorithms and eventually came across Detection of Copy-Move Forgery in Digital Images written by Jessica Fridrich at SUNY Binghamton. The paper describes an algorithm for detecting just the sort of changes I thought I was looking for.
Essentially the algorithm cuts the image into a bunch of 16x16 chunks and runs each chunk through a discrete cosine transform. The DCTed chunks are compressed and sorted, and the algorithm looks for multiple matching chunks that were shifted the same direction and distance, highlighting the source image if a large number of matches are found.
Another blogger, jjwiseman, released a speed optimization for John's code, which he successfully used on the infamous Adnan Hajj Reuters images. While the algorithm is able to detect this style of manipulation, it's noted that it has a habit of returning false positives in images with a blurry background.
That said, it'd be pretty interesting to run this through a big database of news photos and see what turns up.
Detection of Copy-Move Forgery in Digital Images - Link (PDF)
John Graham-Cumming's Clone Tool Detector - Link
Protecting Journalistic Integrity Algorithmically (jjwiseman's update) - Link
Posted by Jason Striegel |
Feb 28, 2008 09:11 PM
Cryptography, Government, Math, Photography |
Permalink
| Comments (0)
| TrackBack
| Digg It
| Tag w/del.icio.us
January 30, 2008
UV photography on the cheap

There's an easy way to make a UV pass filter for your camera. It just takes a $5 incandescent black light, a large bottle cap and some duct tape.
For years I've wanted to mess around with UV photography. Unfortunately, all the websites on DIY UV seem to assume an infinite amount of money and access to specialized equipment on my part. There are two things that I don't like, when someone tells me I HAVE to spend a lot of money (quartz lenses starting at $3000) or that i need specialized equipment (Wratten 18A filters, not cheap either).So I set out to do it my way, and here's my $5 solution to UV wavelength photography.
It's not completely void of visual artifacts, especially at the edges of the photo, but that's what the crop tool is for. As long as you're creative, which you are, you can make it work for you and get really nice results. Save the 3000 bucks for that trip to Europe... you know, where you can exchange it for about 2000 Euro.
Photography in the Ultraviolet spectrum - Link
Posted by Jason Striegel |
Jan 30, 2008 08:54 PM
Photography |
Permalink
| Comments (4)
| TrackBack
| Digg It
| Tag w/del.icio.us
January 29, 2008
Remove shake and motion blur from photos

It's a real drag when you think you've taken a great picture, only to load it up in photoshop and discover that your hands weren't as steady as you thought they were. Depending on the magnitude of your error, chances are you can correct most small camera bumps or pans using a deconvolution filter. The particular technique used depends on which package you use, but they are all built around manipulating the image in the frequency domain to reduce the photo's linear blurring.
Nathan Willis dissected three applications for removing the effects of camera movement from your photos. Two of them, Refocus and Iterative Refocus, are open source Gimp plugins. The third, Unshake, is a closed source Java application that is capable of producing high-quality results with little user effort (though your CPU will be hurting for a minute or two).
If you watch the movies, you have probably seen the impossibly accurate "computer enhancement" hand-waving that turns a blurry mess into a crystal clear mug shot or license plate for the hero to chase. Real-world image enhancement is not that good, but you may still be surprised at the level of quality a good Fast Fourier Transform and deconvolution can produce.All three of these applications produce admirable results. Refocus is the fastest, and subjectively Unshake produces the cleanest results. It is unfortunate that among the three alternatives, one is not free software and the other two lack active maintainership. But since the math is well understood, maybe someone will pick up where the other programmers left off, and bring even better refocusing technology to the image editors of tomorrow.
The above photo is from the Unshake site. It seems to work well for predominately straight-line blurs over the range of 8 pixels or less. I haven't tried the two Gimp plugins, but I have a feeling the Iterative Refocus package could produce the best results given enough tweaking of the setting.
It's all Fast Fourier Transforms and way over my head, but it works (and frankly, if it was good enough for the Hubble, it's good enough for me).
Unshaking and refocusing your photos - Link
Unshake - Link
Refocus - Link
Iterative Refocus - Link
Posted by Jason Striegel |
Jan 29, 2008 08:51 PM
Lifehacker, Photography |
Permalink
| Comments (1)
| TrackBack
| Digg It
| Tag w/del.icio.us
December 29, 2007
Laser projector

Instructables user echo_anomie posted a nifty howto for creating a very simple portable laser projector. With a bright enough laser, you can project an image across long outdoor distances and there's never any need to adjust focus.
When it's all assembled, you just drop photo slides in the path of the beam and they are projected wherever you have the thing aimed. It'd be interesting to try this with some kind of LCD in place of the slide. This should let you project eerie green videos on skyscrapers around town.
Laser Image Projector - [via] Link
Posted by Jason Striegel |
Dec 29, 2007 10:00 AM
Electronics, Hardware, Photography |
Permalink
| Comments (1)
| TrackBack
| Digg It
| Tag w/del.icio.us
December 19, 2007
HOWTO - HDR photography in Gimp or Photoshop

High Dynamic Range (HDR) photography is the process of taking several images at different shutter speeds and combining them into a single photo that contains no washed out or underexposed areas. The result is a surreal, almost too perfectly lit photograph that contains a high level of detail throughout the image.
Photoshop has a built-in HDR photo merging tool which produces some incredible results without too much effort. The image above, from Ryan McGinnis' excellent Photoshop HDR tutorial, is pretty surreal. It reminds me of a high-res rendering from a video game.
If you're using the GIMP, you can get similar results by carefully masking and merging layers, or you can download and use the exposure-blend plugin which will simplify the process a little. Below are links to both processes - you can see which works best for you.
Whatever package you use, the important thing is to use a solid tripod and only adjust the shutter speed between shots. For the best results, you'll also want to set your camera to RAW mode.
How to Create Professional HDR Images in Photoshop - Link
HDR photos with the GIMP - Link
Using the GIMP exposure-blend plugin - Link
Posted by Jason Striegel |
Dec 19, 2007 09:00 PM
Photography |
Permalink
| Comments (0)
| TrackBack
| Digg It
| Tag w/del.icio.us
November 21, 2007
Peephole fisheye lens

Dave Nance used an ordinary door peephole fitted to a lens cap to produce some whimsical looking images like the one above. Depending on the optics used in the peephole (many are made of plastic) and whether you choose to use a tripod to compensate for the decreased amount of light, you can really end up with a lot of strange aberrations and large regions of the photo that are quite out of focus. Then again, that's sort of the point:
Still, there is something about the way these images look that speaks to me. Perhaps it has to do with the fact that my eyes are slowly going to hell. Without my glasses, the world that I see is no longer as sharp as it was when I was younger. Beyond that, the blurring, streaks, flares, and distorted textures, all create a kind of surreal feeling. When combined with the linear distortion caused by the "fisheye" effect of the lens, it can make these images seem like snapshots out of a dream.
You can experiment with this or other lens-glued-to-lenscap arrangements and see what you like. You'll just need to focus your camera as close as possible ("macro" mode), and then use the adjustments on the external lens to bring things into focus. Most of these setups are pretty touchy and let in very little light, so for best results you'll really want to use a tripod and a remote shutter.
Faux Fisheye With a Door Peephole - Link
Posted by Jason Striegel |
Nov 21, 2007 09:22 PM
Photography |
Permalink
| Comments (0)
| TrackBack
| Digg It
| Tag w/del.icio.us
October 23, 2007
Secret Photoshop shortcuts

WebDesignerWall has a big list of undocumented Photoshop shortcuts that you might find useful. Most notable are scroll wheel zooming by holding down Cmd+Opt, scroll wheel document panning by holding Cmd (or Cmd+Ctrl to toggle between left/right and up/down) and, my new favorite, moving a selection by holding the spacebar while dragging. The latter lets you reposition the top-left location of the marquee while you are still making it, which is about as useful as it comes when you are trying to select something to the exact pixel.
Photoshop Secret Shortcuts - Link
Posted by Jason Striegel |
Oct 23, 2007 07:42 PM
Photography |
Permalink
| Comments (0)
| TrackBack
| Digg It
| Tag w/del.icio.us
October 7, 2007
Recycle a mouse into a camera shutter release

Using an old mouse and a 3/32" stereo jack, Dave Schlier hacked together a nice little shutter release for many Pentax and Canon cameras. One mouse button is used to trigger the half-pressed autofocus mode, and the other triggers the shutter to take a photo.
It will work on Pentax and some Cannon cameras that use a 2.5mm (3/32") stereo monopug that use the middle and inner pins as separate contacts and the outer (large) pin as common.Supplies: 3/32" stereo jack (solder connections), 3 or 4 wire cable (I used phone wire), old 2-button mouse.
It's a fun way to make use of an old mouse. With the right connector and some slight adjustments, you should be able to adjust this to work with any camera that uses this type of remote shutter release.
Mouse remote shutter release - [via] Link
Posted by Jason Striegel |
Oct 7, 2007 09:56 PM
Electronics, Photography |
Permalink
| Comments (0)
| TrackBack
| Digg It
| Tag w/del.icio.us
September 25, 2007
Using the Wii Remote to correct perspective in digital photos

Daniel M. German found a way to automate perspective correction and projection adjustments for his wide angle photography. He does this by using a Wiimote to record the pitch and roll of the camera at the time a photo is taken. This information can then be fed directly into panotools, instead of manually entering control lines and processing the images to calculate these tilt values after the fact.
I modified an open source DarwiinRemote to record inclination. It happens that if you keep the WiiR in a stationary state, its three accelerometers can be used as two inclinometers. Fortunately most of the time, when one takes a handheld photo, one keeps the camera steady. Steady enough to read the inclination of the WiiR.I also modified the driver to record the reading from the accelometers, the estimated inclinations, and the timestamp. I would then use the timestamp to match the images from the camera to the readings from the WiiR.
This is a cool idea. I would not be surprized to find high end cameras internally recording and stamping this information into photographs in the near future. A lot of consumer cameras already support panoramic stitching, so with digital accelerometers and tilt sensors being as cheap as they are, why not internally support adjustments like perspective correction or projection remapping?
Using the Wii Remote to correct perspective - Link
Posted by Jason Striegel |
Sep 25, 2007 07:28 PM
Electronics, Gaming, Photography |
Permalink
| Comments (0)
| TrackBack
| Digg It
| Tag w/del.icio.us
September 18, 2007
Open Source Seam Carving

For those of you who didn't catch our previous post about seam carving, it's a smart image resizing algorithm, invented by Dr. Ariel Shamir and Dr. Shai Avidan. Where you would normally have to choose between cropping or squeezing/stretching an image to change its aspect ratio, the seam carving method will attempt to find horizontal or vertical paths within the image that can be removed without altering "important" parts of the image, such as people or other objects that would look funny if squished.
There are now a couple of open source Actionscript implementations as well as a GIMP plugin that enable you to "liquid rescale" your photos.
I'm thinking that with a few simple tweaks, you could hack one of the Flash versions load a user-specified JPG or PNG and provide an interface for adjusting the image. It'd just be a simple matter of doing a screen capture to pull the result back into the image editor of your choice.
There's also a Photoshop plugin that claims to do this, but it's closed source, unavailable for macs, and the test version doesn't work for images larger than 640x480. To that I say, "Phtfphpht," but I've included a link in case you are interested. To be fair, it's probably cool... I'm just more excited to see the open source versions surfacing.
References:
GIMP Liquid Rescale (lqr) plugin - Link
Content-aware image resizing in Actionscript (Joa Ebert's original source) - Link
Seam carving in Actionscript (Mario Klingemann's optimizations) - Link
Pictual: Photoshop plugin for smart resizing - Link
Seam carving: content-aware image resizing - Link
Posted by Jason Striegel |
Sep 18, 2007 08:32 PM
Flash, Photography |
Permalink
| Comments (2)
| TrackBack
| Digg It
| Tag w/del.icio.us
Bloggers
Welcome to the Hacks Blog!
Categories
- Ajax
- Amazon
- AppleTV
- Astronomy
- BlackBerry
- Blogging
- Body
- Cars
- Cryptography
- Data
- Design
- Education
- Electronics
- Energy
- Events
- Excel
- Excerpts
- Firefox
- Flash
- Flickr
- Flying Things
- Food
- Gaming
- Gmail
- Google Earth
- Google Maps
- Government
- Greasemonkey
- Hacks Series
- Hackszine Podcast
- Halo
- Hardware
- Home
- Home Theater
- iPhone
- iPod
- IRC
- iTunes
- Java
- Kindle
- Knoppix
- Language
- LEGO
- Life
- Lifehacker
- Linux
- Linux Desktop
- Linux Multimedia
- Linux Server
- Mac
- Mapping
- Math
- Microsoft Office
- Mind
- Mind Performance
- Mobile Phones
- Music
- MySpace
- MySQL
- NetFlix
- Network Security
- olpc
- OpenOffice
- Outdoor
- Parenting
- PCs
- PDAs
- Perl
- Philosophy
- Photography
- PHP
- Pleo
- Podcast
- Podcasting
- Productivity
- PSP
- Retro Computing
- Retro Gaming
- Science
- Screencasts
- Shopping
- Skype
- Smart Home
- Software Engineering
- Sports
- SQL
- Statistics
- Survival
- TiVo
- Transportation
- Travel
- Ubuntu
- Video
- Virtualization
- Visual Studio
- VoIP
- Web
- Web Site Measurement
- Windows
- Windows Server
- Wireless
- Word
- World
- Xbox
- Yahoo!
- YouTube
Archives
Recent Posts
- Reading EXIF data from images in Javascript
- Processing.js - visualization library for Javascript
- DIY multi-touch on OS X
- Radio controlled lawn mower
- Using the Canon Hacker's Development Kit
- Cornell University's student microcontroller projects - Spring08
- Videos from past DEFCONs
- Update the hacker map
- HOWTO - embed fonts from a SWF into a Flex app
- Server-side Google Analytics
www.flickr.com
|





Recent comments