Sunday, June 27, 2010

NYC Fireworks - June'27, 2010

[Canon EOS 40D, F 16, 6.0 sec, ISO:100, 2010-6-27]

Today evening, I was surprised to see some fantastic fireworks from my window. The view was simply amazing. Normally, I would be prepared to shoot an event like this - I would have read what kind of lens settings I need, what effect a larger or a smaller aperture would have on the image. At the very least I would have chosen the location, setup my tripod etc ... But not today, I turned around and the magic had already started.

I had to quickly choose the window from my house, setup the tripod, put my Canon 24-70mm lens and had few seconds to think about the settings. I imagined these shots to be of longer duration(4 - 15 sec), given there is plenty of city light in the background, I did not want to over-expose the shot by opening the aperture wide. Since there is already plenty of light generated by the fireworks itself a smaller ISO number(100-200) is good enough to avoid extra noise in the picture.

[Canon EOS 40D, F 16, 6.0 sec, ISO:100, 2010-6-27]

[Canon EOS 40D, F 13, 6.0 sec, ISO:100, 2010-6-27]

 [Canon EOS 40D, F 13, 6.0 sec, ISO:200, 2010-6-27]

[Canon EOS 40D, F 13, 8.0 sec, ISO:200, 2010-6-27]

[Canon EOS 40D, F 13, 8.0 sec, ISO:200, 2010-6-27]

[Canon EOS 40D, F 16, 10.0 sec, ISO:200, 2010-6-27]

[Canon EOS 40D, F 16, 6.0 sec, ISO:100, 2010-6-27]

[Canon EOS 40D, F 16, 6.0 sec, ISO:100, 2010-6-27]

Had a good practice, learned what works. I am so looking forward to July 4th now. 

Push Pins


[Canon EOS 40D, F 2.8, 1/800.0, ISO:400, 2010-6-26]

Yesterday was the first time I tried out Macro Photography. Yesterday was also the first time I tried out product photography.  I made a lightbox at home using the method mentioned here. This works great, but you really need good light source, not having a consistent light setup at home - I decided to use the natural light. Overcast day actually helped the cause by eliminating any harsh shadows.
  
Equipment:
  1. Canon 40D
  2. Canon EF 100mm f/2.8 Macro USM Lens
  3. Tripod
  4. White Posterboard
Subject:

Translucent push pins. Approximate dimensions are  - 12mm base, 12mm steel pin and 6mm lower end diameter. 

The camera was set on Aperture priority with most of the pics on 2.8; It was a windy day - in the given light conditions, to get really sharp images I wanted to get the highest shutter speed possible. Moreover, least F-stop also offers a good play with Depth-of-field.

Lessons Learned

    1.  Highest shutter speed does not always get you a sharp picture. Have a good look at the above picture, most of the translucent part of red pin is in focus but the edge along with the steel pin is not as sharp as it could have been. Diffraction at lower f-stops come into play here. Lens sharpness varies with the Aperture. If you are interested to know more, this is a really good read. As a general rule, avoid using the  larger apertures (lower F-stop value) wherever you can. You can also read more about selecting the sharpest aperture for your lens here.                                                      

    2.  Let's talk a bit about DoF. Have a look at the following four pics:


Green Pin: Front Focus
Green Pin: Back focus
All Pins: F.2.8            
All Pins: F8        


Remember the dimensions of a pin. The first two pictures of green pin above are shot at 2.8. In the first picture of the green pin, I have tried to focus on the tip of the pin. See how the back portion is completely out of focus. You can see the same affect  in the second picture where the focus is on the back of the pin.

Let's move on the next two pics of all pins. The last picture is shot at F8, see how everything( back and front) are still in focus and it's as sharp as it could get, without any lens diffraction. 

    3.  Back button Auto-Focus - While trying to take these pictures, one of the hardest things was to get the lens AF working. It was just impossible to keep the focus on the tip of the pin. Most of the modern cameras have this nice feature called back-button AF. This was quite helpful to lock the focus and not let the camera try to focus again while taking the shot. You can configure the setting of this button using the custom settings function. More on this here.

    4.  Custom White balance - I did not really do this for this pictures, but realized later that the pictures could have been improved by letting the camera know what white is beforehand. This probably would have resulted in actual white background(real color of the poster board) on all the pictures, rather than shades of grey. 



The Canon 100mm 2.8 macro is a fantastic lens, it opens up a new world of photography. I would highly recommend to try it out, if you haven't already. Here are some more shots:











Saturday, June 12, 2010

Dream House


[Canon EOS 40D, F 5.6, 1/1000, ISO:200, 2008-8-9]


As I browse through many of my older pics, I have learned that wherever possible use a faster shutter speed, the chances of getting a picture that you will like because it's sharp are much higher that way.
Ofcourse, there's lot more that goes in to make a picture like-able, sharpness is just one aspect:)

This photograph shot at a place called Kehrsiten, Luzern. If you happen to be in Switzerland during summers, I would highly recommend the Luzern lake boat ride. 

Sunday, June 6, 2010

Picasaweb & Blogger

I started this blog to play around with Google Data APIspic-stream is auto-generated (almost) from my picasaweb pics.

I usually upload my full-size photographs to picasaweb, the script provided at the end of this blog uses Picasa Web Album data APIs to get the details of the pics and then publishes a smaller sized pic along with some of the EXIF data to blogger using Blogger APIs. A little more details:

Requirements:
  1.  Python 2.5
  2. gdata python client
  3. pyexif
You will need to enter some more details before you can use the code:
  • your gmail id
  • Run the script in a shell - it will prompt for your password
  • blog-id

This script creates a draft post so that you can make any changes you want before hitting the publish button.

I know you can do something similar directly from Picasa client too, but now you have the freedom to display whatever EXIF data you want in the format you want.

#!/usr/bin/python2.5

import gdata.photos.service
import gdata.media
import gdata.geo
import gdata.blogger.client
import gdata.client
import atom.data
import getopt
import getpass
import os
import sys
import time

from gdata import service

class PicasaData(object):

  def  __init__(self, username, pw):
    """ Initializes Picasa data."""
    self.picasa_client = gdata.photos.service.PhotosService()
    self.picasa_client.source = 'API'
    self.picasa_client.ssl = False
    self.picasa_client.email = username
    self.picasa_client.password = pw
    self.picasa_client.ProgrammaticLogin()
    self.photo_name = ''
  
  def GetAlbumName(self):
    """ Get the name of the picasa album""" 
    albums = self.picasa_client.GetUserFeed(user=self.picasa_client.email)
    i = 0
    albumidlist = []
    for album in albums.entry:
      i+=1
      albumidlist.append(album)
      print '%d  %s (%s)' % (i, album.title.text, album.numphotos.text)
     
    album_choice = int(raw_input('Choose Album Name:'))
    self.album = albumidlist[album_choice-1]
    #print 'You choose: %s' %(self.album.title.text)
    return self.album.title.text
        
  def GetPicName(self):
    """ Get the name of the pic for which details are required."""
    i = 0 
    photo_id_list = []
    photos = self.picasa_client.GetFeed(
        '/data/feed/api/user/%s/albumid/%s?kind=photo&imgmax=640u' % 
        (self.picasa_client.email, self.album.gphoto_id.text))
    
    for photo in photos.entry:
      i+=1
      photo_id_list.append(photo)
      print '%d %s:' %(i, photo.title.text)
      
    pic_choice = int(raw_input('Choose Pic Name:'))
    self.photo = photo_id_list[pic_choice-1]
    return self.photo.title.text
    

  def GetPicMetadata(self):
    """ Get Metadata for the chosen pic."""
    
    meta_data = {}
    if self.photo.exif.model:
      camera = self.photo.exif.model.text
    else:
      camera = 'unknown'
      
    src = self.photo.content.src
    first_thumbnail = self.photo.media.thumbnail[0].url
    second_thumbnail = self.photo.media.thumbnail[1].url
    third_thumbnail = self.photo.media.thumbnail[2].url
    distance = self.photo.exif.distance
    if self.photo.exif.exposure:
      exposure = 1/float(self.photo.exif.exposure.text)
    else:
      exposure = 'Unknown' 
    
    if self.photo.exif.focallength:
      focallength = self.photo.exif.focallength.text
    else:
      focallength = 'Unknown'
    
    if self.photo.exif.fstop:      
      aperture = self.photo.exif.fstop.text
    else:
      aperture = 'Unknown'
      
    if self.photo.exif.iso:
      iso = self.photo.exif.iso.text
    else:
      iso = 'Unknown'
      
    if self.photo.exif.time:
      t = float(self.photo.exif.time.text)/1000
      t = str("%s-%s-%s" %(time.gmtime(t).tm_year, time.gmtime(t).tm_mon, time.gmtime(t).tm_mday))
    else:
      t = 'Unknown'
      
    if self.photo.geo:
      location = str(self.photo.geo.Point.pos.text)
    else:
      location = 'Unknown'
    
    meta_data = {'Camera': camera,
                 'Source': src,
                 'Exposure': exposure,
                 'Focallength': focallength,
                 'Aperture': aperture,
                 'ISO': iso,
                 'Time': t,
                 'Coordinates': location}
    return meta_data             
    
class BloggerData:

  def __init__(self, username, pw):
    """Initialize blogger data."""
    
    self.blogger_client = gdata.blogger.client.BloggerClient()
    
    self.blogger_client.service = 'blogger'    
    self.blogger_client.source = 'python script'
    self.blogger_client.account_type = 'GOOGLE'
    self.blogger_client.server = 'www.blogger.com'
    self.blogger_client.email = username
    self.blogger_client.password = pw
    self.blogger_client.ClientLogin(username, pw, self.blogger_client.source)
    
    # Get the blog ID for the first blog.
    self.feed = self.blogger_client.get_blogs()
    self.blog_id = self.feed.entry[0].get_blog_id()
    
  def PrintUserBlogTitles(self):
    
    self.feed = self.blogger_client.get_blogs()  
 
    for entry in self.feed.entry:
      print '%s %s' %(entry.title.text, entry.get_blog_id())
      
  def CreatePost(self, title, content, is_draft):
    blog_id = 'XXX' # Put your blog-id here, it was a 20 digit number for me
    print 'Creating Draft %s' %(title)
    return self.blogger_client.add_post(blog_id, title, content, draft=is_draft)
  
def main():
  username = 'XXX' # Put you gmail id(without '@gmail.com') here
  pw = getpass.unix_getpass("Enter your password:")
  #pw = os.environ['PASSWD']
  
  run_picasa = PicasaData(username, pw)
  album_name = run_picasa.GetAlbumName()
  photo_name = run_picasa.GetPicName()
  meta_data = run_picasa.GetPicMetadata()
  
  blogger_title = photo_name
  blogger_content = """<center><img src="%s"></img></center><br>
                       <div style="text-align: center; font-family: 'Yanone Kaffeesatz';">                      
                       <i>
                          [%s, F %s, 1/%s, ISO:%s, %s]<br>
                          Coordinates: %s
                       </i></div>
                       """ %(meta_data['Source'],
                             meta_data['Camera'],
                             meta_data['Aperture'],
                             meta_data['Exposure'],
                             meta_data['ISO'],
                             meta_data['Time'],
                             meta_data['Coordinates'])
  
  run_blogger = BloggerData(username, pw)
  run_blogger.CreatePost(blogger_title, blogger_content, True)

if __name__ == '__main__':
  main()

Across Hudson


[Canon EOS 40D, F 4.0, 1.3s, ISO:100, 2010-2-12]
Coordinates: 40.726658 -74.034828



Perfect Models ! For a 1.3 sec shot, there's hardly any movement in pigeons. Perhaps the cold winter evening kept them still.