working with flash and cutting background illumination - Script Writing - CHDK Forum  

working with flash and cutting background illumination

  • 2 Replies
  • 1618 Views
working with flash and cutting background illumination
« on: 24 / July / 2012, 10:40:30 »
Advertisements
I am new to script writing and I am thinking of writing a script which shoot two consecutive photos of people with background

the first photo is to have proper exposure for the background, no flash is fired.

the second photo is to minimize the background illumination, and with the flash firing, it should well lit the people.

I believe the first photo can rely on the auto exposure of the camera. and for the second photo, it should be using the lowest ISO and highest shutter speed, adding ND filter if needed.

reading the script language, I do not see any command to set a flash mode, only seeing the get_flash_mode. Should I first get the current flash mode and then use some click command to change the flash mode?

and in order to set the ISO and shutter speed, what should I use? now I can only change it manually in CHDK manual.

My purpose of doing this 2 photos is to blend them in post processing, so that I can change the white balance of both photos and choose how much flash light to blend with the environmental illumination, so RAW is prefered.

I am using IXUS 115 HS.

thanks for you time reading


Re: working with flash and cutting background illumination
« Reply #1 on: 24 / July / 2012, 12:03:00 »
reading the script language, I do not see any command to set a flash mode, only seeing the get_flash_mode. Should I first get the current flash mode and then use some click command to change the flash mode?
You can set the flash mode by writing to the appropriate propcase values with this command :
http://chdk.wikia.com/wiki/CHDK_scripting#set_prop_.2F_get_prop

Your camera uses propset4 and the various values are described here : 
http://chdk.wikia.com/wiki/PropertyCase#Digic_IV_.26_Digic_V_.28propset4.29

Propcase 143 for example will let you control the off/on/auto modes of the flash.

Quote
and in order to set the ISO and shutter speed, what should I use? now I can only change it manually in CHDK manual.
You probably need to read up in the APEX96 methods used in CHDK :
http://en.wikipedia.org/wiki/APEX_system#
http://dougkerr.net/Pumpkin/articles/APEX.pdf

The commands you need are :

set ISO :  http://chdk.wikia.com/wiki/CHDK_scripting#get_sv96
set Shutter :  http://chdk.wikia.com/wiki/CHDK_scripting#set_tv96_direct

As you are new to scripting,  work at it a little bit at a time. Try very simple scripts to test each function by itself to make sure you understand it.  Feel free to post your little scripts here as you go if there is something you don't understand or need help with (use the Insert Code button in the toolbar above the edit box  - the one with the # symbol - to keep things tidy)

This page can be handy too :

http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page#All_Scripting_Functions
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1271
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: working with flash and cutting background illumination
« Reply #2 on: 24 / July / 2012, 14:13:26 »
Here is an examble for building the function 'set_flash_mode':
Code: (lua) [Select]
-- 0=Auto, 1=On, 2=Off
function set_flash_mode(n)
    if get_propset() == 1 then
        set_prop(16,n)
    else
        set_prop(143,n)
    end
end

msl
CHDK-DE:  CHDK-DE links

 

Related Topics