Magic Lantern Forum

Using Magic Lantern => Tutorials and Creative Uses => Topic started by: garry23 on February 28, 2019, 08:08:04 PM

Title: Reflections on ML & CHDK
Post by: garry23 on February 28, 2019, 08:08:04 PM
I thought I would write a few words on my experiences related to CHDK, as Magic Lantern and CHDK are ‘close cousins’.

In particular, as a stills photographer, I wanted to flag up that some of the Canon P&S cameras are pretty good when you wish to travel light; and, therefore, having ML and CHDK, together, is a killer combination.

Yes, we have the (mirrorless) EOSM in our ML world, but this still needs lenses; and, when it comes to controlling focus, it suffers from the same limitations as other ML-EOS cameras, ie not being able to fully/robustly control focus position via Lua, compared to CHDK that is.

BTW this lack of (ML) focus control is why I wrote the DoF Bar script as a manual aid when focus stacking: that is, giving you more info than on the lens’ DoF scale.

So I decided a few months ago to reacquaint myself with the CHDK P&S options. I had previously dabbled in CHDK when I purchased a pocketable S95 some 8 years ago: a very small ‘footprint’, but, of course, a very small (12-bit output) sensor. I then moved on from a 50D to a 5D3 and three EOSMs (vis, IR and 645), got into ML-Lua and ‘forgot’ about CHDK.

So, as a present to myself last Christmas, I bought two second hand Canon P&S cameras, with the largest sensors I could. Namely the G7X (1” sensor) and the G1X (APS-C class sensor).

I wasn’t trying to emulate ML’s full functionality, eg Dual-ISO, but I did want to see how far I could push the G1X and G7X as ‘tripod-based’ travel cameras: and potentially see what CHDK could do beyond ML. I also wanted a movable LCD for my low-level photography :-)

I thus set about writing a Lua script in CHDK to do something that I have failed to do with the ML and my interchangeable lens EOS cameras. That is write a robust (auto) bracketing script that worked from close-up, ie ‘macro-like’, to landscape, and automatically handled exposure and focus bracketing together.

The result is a Landscape Bracketing Script I have published on the CHDK forum:

The script has the following functionality/features:
•   Seamless focus bracketing from the camera’s minimum focus to a blur-defined infinity, ie specified as a fraction of the default/assumed defocus CoC;
•   Focus brackets can have one of four overlap options: None, ie the focus brackets touch at a defocus blur of the camera’s CoC; 2/3 the CoC; half the CoC or at a diffraction aware blur that ensures the diffraction and defocus blur, taken in quadrature, equals the camera’s CoC. BTW the CHDK default CoC is the classic crop-adjusted from an assumed FF 30 microns;
•   The script allows the user to select one of several focus stacking options, ie: from the current focus to a delta (mm) distance, useful for close up photography; from the current focus to the blur defined infinity; from the camera’s min focus to the current focus; from the camera’s min focus to the blur defined infinity, ie a full focus coverage. The script automatically ‘finds’ the camera’s minimum focus;
•   Because focus stacking can result in many brackets, the script allows the user to identify a maximum number, ie as a warning. This can be switched off, ie max number of focus brackets = 0;
•   At each focus step the script also allows several exposure bracketing options, eg: two additional exposures at 1, 2 or 3EV and using a -/+, +/++ or -/-- logic; one additional bracket at an ISO 800 or ISO 1600, ie to capture a single ISOless-zone additional bracket, which may be useful if handholding (but note that many P&S camera can be assumed to be ISO invariant from the base ISO, unlike the EOS cameras); or a ‘zero-noise’ time bracket at +4Ev, ie to cover the shadows (but with increased blooming risk);
•   The user can select the blur-defined infinity where the focus bracketing will stop, ie at either CoC/2, CoC/3 or at CoC/4; which equates to 2H, 3H or 4H distances, where H is the hyperfocal distance (note an infinity blur of CoC/3 is about the limit, as going smaller than this means you risk pushing into the less than 2-sensel zone);
•   The script will, if requested, put a dark-frame bookend at the start and end of the focus-exposure bracket set. Useful in post to differentiate a bracketing set;
•   Finally, the script, if requested, will add a log entry in a log file, with the focus distance info for each focus.

As an example of what the script can do, I attach a few images that I took with my G7X.

( (

( (

( (

The cathedral examples were taken using the +/++ exposure option and by focusing on the nearest point of interest. The garlic head is a ZN example where I focused on the front of the head and specified a 30mm delta from there.

As to using the script: my personal preference for landscapes is to use the CHDK log-based histogram to ETTR for the highlights and use the +/++ exposure bracketing or the Zero-Noise one.

I’ll stop here as I think I’ve achieved what I wanted: that is alert the EOS/ML stills photographers out there, that there are some pretty good travel options in the CHDK world, eg the G7X and the G1X. That is as long as you are not looking for ML-specific ‘stuff’ such as Dual-ISO and RAW video; these are pretty good alternatives to, say, the EOSM.

As usual I welcome feedback, especially from others that have explored the Lua-based ‘cross over world’ between ML and CHDK.
Title: Re: Reflections on ML & CHDK
Post by: Ant123 on February 28, 2019, 09:44:59 PM
That is as long as you are not looking for ML-specific ‘stuff’ such as Dual-ISO

FRSP & Dual-ISO can be ( implemented on EOS-M[3,5,6,10,100] cameras runing CHDK(and maybe without CHDK).
Title: Re: Reflections on ML & CHDK
Post by: garry23 on February 28, 2019, 09:52:41 PM
I’m talking about Canon Powershot cameras ;-)
Title: Re: Reflections on ML & CHDK
Post by: ItsMeLenny on March 01, 2019, 04:41:34 AM
The first digital camera I actually bought (and I was quite late to the party of digital cameras in terms of owning one myself), was a canon and I made sure it was one that CHDK could run on.
It was in beta for this camera but worked perfectly fine at the time, back many versions ago. However when I tried raw it revealed how terrible the sensor in the camera was by showing the colours it actually captures compared to what it should be made available through the picture style.
Title: Re: Reflections on ML & CHDK
Post by: garry23 on March 01, 2019, 08:13:52 AM

Yes you are right. I think there are three 'families of cams'.

Cams that are true P&S cams out of the box, that have only JPEG output without CHDK, and have very small sensors, usually with fixed LCD screens. 

Then there is the G1X Powershot with 14 Raw output via an APS-C-like sensor and with an articulating LCD.

Then there is the G7X Powershot with 1" class sensor, albeit 12 bit ('ISOless') Raw, and an articulating LCD.

Bottom line: I only wrote the post to mention the Lua capability, eg good focus control, and of course flag up these cams as potential travel complements to their larger EOS cousins, eg integrated travel cams for photography.