4.3 Exposure 41when you need lots of light: for example, when you want to shoot with anultrashort exposure time (section 4.3.5).By the way, if you enforce the manual flash but it doesn’t work, don’tblame the CHDK; you might just need to charge the battery.4.3.8 Using curvesCustom Curves are another option in the CHDK to control the outcome of ashot. Curves are applied after an image has been taken; they don’t influ-ence exposure settings such as aperture or sensor speed. They simplymodify the digital data delivered by the sensor before it’s packed into aJPEG file.This can make sense. The sensor delivers the image data with a finerdynamic granularity than a JPEG file is able to capture. Each pixel consistsof 10 or more bits, allowing the capture of at least 1024 levels of bright-ness. A JPEG file only transports 8 bits per pixel. Due to the logarithmicscaling of pixel values in JPEG format, the JPEG file does a good job onshadows but not so good a job on highlights. Therefore, burned-out high-lights are a common problem when shooting in JPEG.One solution is to shoot RAW (section 4.5). A RAW file delivers RAWsensor data—the complete information without any loss. Using a RAWconverter, you can properly compress the tonal range of the image to avoiddrowned shadows and burned-out highlights.Is there no solution for shooting JPEGs? In fact, the CHDK offers one.Curves can be used to do all kinds of tone mapping, including contrastcompression. The result can be a JPEG with detail in both highlights andshadows. Because curves are applied when mapping the RAW data ontoJPEG pixel values, they do not have any effect on RAW images. And becausethe CHDK can shoot RAW and JPEG simultaneously, you can have both acurve-modified JPEG and an untreated RAW file as a backup.The Enable curve entry in the Custom curves submenu offers the follow-ing options:f None. No curves are used for tone mapping.f Custom. The pixel values are mapped under the control of a customcurve. Such custom curves can be created with the help of a curve editor(see below). The curve definition file must be placed into the folderCHDK/CURVES/. The curve can then be loaded under menu entry Loadcurve profile… .f +1EV. A system-defined curve that increases shadow detail by onef-stop. Unlike the EV correction discussed in section 4.3.1, this optionwill not increase noise, open the aperture wider, or increase exposuretime. It will, however, reduce contrast.Figure 4-26The Custom curves submenu