I'm trying to tweak a CHDK script for my Canon PowerShot G12 to take pictures at a regular interval. The goal is to make smooth time lapse videos.
I've previously burned the sensor of a G11 because of an unexpected lighting change, and would like to prevent this from happening again. So now I'm looking for a way to either:

  • Adjust the exposure slowly over the span of several pictures, or
  • Detect a certain level of overexposure and abort the script

Here is what I have so far:

@title Timelapse photo fixed

@param m Interval (min) 
@default m 0 
@param s Interval (sec) 
@default s 5
@param h Number of takes (x100)
@default h 10 
@param x Initial delay (sec) 
@default x 10

set_raw 0

if t<100 then t=100

if i<100 then i=100

if x<5 then x=5
sleep 1000*x-2000

print "Pressing shutter halfway..."
press "shoot_half"
sleep 2000

for j=1 to t
    print "Taking photo",j,"of",t 
    click "shoot_full"
    press "shoot_half"
    print "   Waiting",m;":";s,"..."
    print " "
    sleep i
next j

release "shoot_half" 


(The shoot_half bits are there to prevent the exposure/focus from changing during a shoot; if there is a better way to do that I'd also love to about it.)

Where should I go from here?

  • \$\begingroup\$ I believe that if you adjust the exposure you will get a flickering movie. The second one should be doable with a simple IF statement: IF exposure > <desired number> then END. But as I don't know CHDK I can't help any further I'm afraid. \$\endgroup\$ Mar 30, 2011 at 14:02
  • \$\begingroup\$ @ElendilTheTall: That's why I would like to adjust the exposure a maximum of say one step per five pictures—to avoid very sudden changes—but that would require calculating an average target exposure, but that is a bit above of my BASIC skill level. \$\endgroup\$
    – oKtosiTe
    Mar 30, 2011 at 14:41
  • \$\begingroup\$ What are you making a movie of? \$\endgroup\$ Mar 30, 2011 at 14:55
  • 1
    \$\begingroup\$ Here's a few of my previous explorations. Anything that lends itself, basically. @ElendilTheTall \$\endgroup\$
    – oKtosiTe
    Mar 30, 2011 at 15:00
  • \$\begingroup\$ Hmmm. Well, I'd imagine for the sky shots any artificial tampering with the speed of transition in the light will look odd; you're probably better off just letting it look natural. \$\endgroup\$ Mar 30, 2011 at 15:08

1 Answer 1


These problems were encountered when trying to compensate from the bright sunlight to the dark of night for sunset and sunrise events. There've been a couple of "sunset" scripts created long ago to circumvent these problems, as well as trying to adjust for exposures when the light levels are far too low and the camera's own exposure meter can no longer function. Done by polling the data directly from the RAW sensor data when needed.

Look into these scripts on these two links:




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.