Monday, September 6 2021

Back to BBEdit

I’ve used BBEdit for years. I think I started with version 4 sometime in college. I’m sure I used ‘borrowed’ copies until I started grad school, when I purchased my own copy circa 2001. I learned Python in it, wrote both my undergraduate thesis and my graduate dissertation, both in LaTeX, which I also learned with BBEdit. Once OS X killed Eudora, I moved to Bare Bone’s Mailsmith email client, which shares a lot of DNA with BBEdit. I eventually moved on from Mailsmith due to the rise of IMAP (and really, iPhones), and I settled on mutt. This sounds like a digression, but I wrote some scripts to use BBEdit as my editor for mutt. I lived in BBEdit.

Around 2011,1 with me doing lots of Python scripting/analysis (and using mutt for email) I started to take a closer look at Vim. My sloppy coding had me going to the arrow keys all the time for corrections, and it was bothering my wrist. I bit the bullet, learned Vim and all of its weirdness, and switched over. I was also using one laptop for both personal and work stuff, so I had plenty of time to tinker. After leaving that job, I got stuck on Windows computers for about 8 years at work, so I just soldiered on with Vim.

I still bought every version of BBEdit that came out, as it was useful to have around for certain things, as well as to support a good Mac software developer.

BBEdit 14

Fastforward to this year, and I’m finally back on a Mac at work. Even better, BBEdit is approved for install on our computers. Which leads me to the release of BBEdit 14.

I bought v14 like I always do and started to play around with it. The Notes feature is cool. And not surprisingly, BBEdit has advanced a lot since I’ve used it daily. While I was well accustomed to the scripting and filtering features, the Open File by Name and Go->Commands features bring some of the fuzzy file finder-ness and keyboard centric navigation I’m used to from Vim. The new LSP integration is also very cool. And wow, has the Preview in BBEdit function gained functionality.

I’m doing less coding and website stuff, both personally and professionally, and more ‘knowledge management’. I still prefer to mostly work in plain text (Markdown to be specific) and am allergic to using our prescribed note taking tool, OneNote. OneNote isn’t bad, but I can’t have my stuff locked up into some cloud only format. I have some cobbled together thing with Vimwiki which works okay, but BBEdit’s Projects seem to be better suited for me for project-oriented work. One BBEdit project per… project, and I can easily cross link things if I choose. The attachment script for dropped images–super cool. Now I can drag an image into a Markdown file, and get Markdown formatted image code. Very nice.

BBEdit still lacks in some departments. I really wish the user configurable syntax coloring and code folding were more capable, and as strange as vimscript is, AppleScript is no walk in the park. That being said, I’ve grown a bit tired of some aspects of Vim. It is an incredibly capable and extensible editor, and the modal nature of it is really great for modifying and navigating text without a mouse. But the mouse support obviously takes a back seat. At the same time, I don’t live in a text editor as much as I used to, and the care and feeding of a custom Vim setup takes effort. As a result, some of my Vim setup is a little creaky and needs attention that I can’t give it. The Vim community is great with lots of amazing integrations available, but they become abandonware too frequently. For example, I’ve used no less than 4 fuzzy file finder implementations in Vim in the last 8 years, yet BBEdit’s is pretty good and professionally maintained.

I do wish the BBEdit community was a little more vibrant. Even if it had the equivalent of just one tpope, I would be much happier. Is there someone I can pay to write a BBEdit version of speeddating.vim?


  1. Around BBEdit v10. ↩︎


Sunday, March 7 2021

Color film scan processing

This post is a big update to topics discussed in Inverting raw scans and Thoughts on color negative scanning. For B&W, see the companion article B&W film scan processing.

I no longer scan with my Nikon Coolscan V. I now use a Sony A7rII on a copy stand to make ‘camera’ scans.

For processing the resulting photos, I use Adobe Camera Raw (ACR) and Photoshop (PS). My PS actions are available here.1

Disclaimer: Color is hard to get right. I have had good results using the following process with my camera (Sony A7rII), Adobe’s ‘standard’ profile for that camera, my light pad2, and Kodak film. Your results may vary. A low CRI light source could deliver sub par results, as could other cameras. Maybe I just lucked out that my camera is well profiled and delivers good color.

Step 1 - ACR

Starting image in ACR

Starting image in ACR with no adjustments.

Bring your image into ACR. White balance on the film base. This step is crucial and is 99% of the solution to the dreaded ‘removing the orange mask’ problem. A RAW developer is needed here. It can be done without, but many photo tools do not operate in linear color space. RAW developers are one common tool that does; we use that to our advantage. This step can be done with something like dcraw, but I use PS and ACR, and prefer to work with a GUI.

image in ACR

White balanced on the selection at the top between the sprocket holes.

I do enable optics corrections in ACR: distortion and vignetting. I found this gives better scans, particularly getting rid of the orange vignette one might get on a processed image. For reference, I can see a difference when shooting with the Sony FE 90mm f/2.8 Macro lens at f/5.6 or f/8.

You can invert the image in ACR as well using the curves tool. From my experimentation, it unfortunately does make a difference. I find colors to be more realistic and less ‘electric’ if done in PS. I saw similar behavior when converting images with dcraw and various settings. I say this is unfortunate because it would be appealing to invert in ACR and generate previews based on that so one didn’t have to look at a bunch of orange images in a browser. You can still do this as an extra step and just undo it for actual conversion.

Lastly, make sure the ‘Adobe Color’ profile is selected. While I can’t speak for cameras other than the Sony A7rII, ‘Adobe Color’ gives much more accurate colors in the final conversion. I was struggling mightily with a few images where I could not get a yellow correct, when I finally realized for that I had somehow left the profile to ‘Camera Standard’, which presumably is some punched-up Sony thing.

Adobe Monochrome profile

Step 2 - PS - 1st pass

Now it’s time for actions. Run the ‘Color neg process’ action to start.

List of Photoshop actions

A levels dialog will pop up immediately for some user input, associated with the ‘Levels - basic contrast’ layer which will be explained below. I usually set the highlight slider to slightly above clipping: move the slider while holding down the Option key on macOS until clipping occurs, and then back off a bit. A similar thing can be done with shadows, though depending on how much I inadvertently underexposed, I might need to leave the shadows pretty light. Then set the midtone slider until things look about right. All of these adjustments can be changed later.

Initial contrast adjustment

Initial contrast adjustment dialog.

Looking for highlight clipping with contrast adjustment

Looking for where the highlihgts clip while adjusting contrast.

Final basic contrast adjustment

Final contrast adjustment dialog.

There are a bunch of layers that the ‘Color neg process’ action makes:

Layers created by the Basic contrast adjust action
  1. ‘Invert’: Inverts the image.

  2. ‘Auto curves’: Sets the endpoints of the curves using ‘Find dark/light colors’ with 0.01% clipping on the darks and 0% clipping on the highlights. I usually have a layer mask on this layer to block out included film borders. This layer sometimes needs adjustment depending on the color content of the image.

  3. ‘Levels - basic contrast’: Discussed above. Basic black/white clipping, with a contrast adjustment. Does what it says - the first order contrast adjustment.

  4. ‘Curves - white balance’: By default, does nothing. IF after adjustments on lower layers (‘Auto curves’ in particular), the image needs a white balance adjustment (shot in the wrong color temperature light, etc.), go to this layer, click on the gray point eyedropper, and go click around your image on neutral tones. Curves can also be adjust by hand. Be wary of anything that produces big changes in the curves, as it might be an indication that the endpoints set on the ‘Auto curves’ layer are wrong.

    White balance gray point eyedropper

    White balancing - the gray point eyedropper is highlighted in orange.

  5. ‘Curves - contrast tweak’: Slight S-shaped curve to adjust contrast. This layer can be faded out: you can hit the number keys (1 through 0) to adjust the layer opacity from 10% to 100%, varying the overall contrast. Note, this layer is set to ‘Luminosity’ blending. If you want, change the blend mode to ‘Normal’ and this layer will also affect color saturation. As this layer is mostly a highlights targeted adjustment, I prefer ‘Luminosity’.

  6. ‘Color Balance’: By default, this layer is disabled. Enable it to apply a bit of ‘warming’ to the image. Adjust sliders to taste, or opacity with the number keys, but I’ve found +15 red/cyan and -15 yellow/blue works pretty well for most images.

NOTE: If you are working with images with no borders, you might want to remove the mask making steps completely (the ‘Play action “90% mask…"’ in the ‘Color neg process’ action). If you are working on images with large borders, non-35mm formats, or anything where this mask is the wrong shape, run ‘Color neg process - borders’ with appropriate modifications. ‘Color neg process - borders’ should properly recognize landscape and portrait orientation and provide a large enough border mask for most purposes.

Next up is the ‘Dust Bust’ action. This makes a ‘Dust Bust’ layer right above the background layer and activates the healing brush. Change the size of the brush with the ‘{’ and ‘}’ keys, zoom into 100% (Command-Option-0 on macOS), and brush out your dust. Sometimes you might want to go over a spot twice if the healing brush result is a little funky looking. I’ve also found that long light scratches are sometimes best spotted out in segments rather than with one long brush stroke (I seem to have more of these on commercially processed C-41 than home processed B&W). When you are done, go back to full view (Command-0).

Dust Bust layer

You want to do the dust spotting before any fancy layers with luminosity masks or anything. The reason is the luminosity mask will contain the dust if its not spotted out, and when you then spot it out afterwards, the tonal values will be different for the dust than the surrounding areas.

Step 3 - PS - 2nd pass

Now you have a basic image. This is the equivalent of a test print in my mind. I’m not a master printer (nor a master photographer), so most of the time for my snapshots, I’m done.

The basic curves adjustment performed in ‘Auto curves’ doesn’t always catch everything. I have had issues with Ektar, images with a natural strong color cast, images with really bright highlights, etc. One trick I use is the ‘Highlight check’ action. What this does is add a temporary curves layer above the ‘Curves - contrast tweak’ layer, cranks up the gamma, and then puts you back on the ‘Auto curves’ layer. It highlights the highlights. If your highlights have the right natural color, then no real adjustments are needed. If they are off (too blue, too red, etc.) then go to the appropriate color channel on the ‘Auto curves’ layer and move the white point slider for that channel to neutralize the color cast. Depending on the image, you might need to adjust all three channels white points. You might also need to adjust the midtone slider on the ‘highlight check’ layer to appropriately accent the range that needs to be adjusted. When you are done, run the ‘Highlight check - remove’ action to delete the ‘highlight check’ layer, or do it manually. I have had a few images where this actually did not make the image better, so undo is your friend here.

Checking the highlights

Example of good highlight color balance of the extreme highlights.

Red tinted highlights

Example of red tint in the extreme highlights. Curtains in upper left are white and illuminated by sunlight.

Corrected highlights

Example of corrected highlight color balance. Red channel white point was moved from 220 to 228

Beyond color correction tweaks, sometimes the contrast isn’t quite what you like. Some extra tweaks with an additional curves layer can be performed. Admittingly, after years of using only curves with various complex blending modes and masks (still useful), I’ve come around to PS’s ‘dumb’ adjustment layers, like Brightness/Contrast, Exposure, and Color Balance. To that end, the ‘Brightness Boost’ action does just that by adding a Brightness/Contrast layer to the top of the stack with a brightness boost. Adjust to taste.

Final processed image

Final processed image.

There’s a lot more to color correcting images in PS that is far outside of the scope of this post. LAB color mode adjustments, luminosity layers, etc. A few quick links:

  • Alex Burke: A nice tutorial about negative scanning and post processing. The section about luminosity masks is very informative.
  • Luminosity Masks: Detailed tutorial on sophisticated adjustments using luminosity masks.
  • Photoshop LAB Color by Dan Margulis. Years ago I read this book and it was a great way to learn an interesting approach to image correction and to learn a bunch of tricks. Seems like it is out of print and very expensive now. I have the 1st edition which is much cheaper used.

That’s basically it! I do have some helper actions to do things like save out a full sized jpg file for sharing online and as a ‘print’. Another useful action is the one that downsizes the image (50% in my case) and saves as a TIFF file with all layers included. If I ever want to re-edit the image, I can open up the RAW file from ACR and the TIFF file, and copy over all of the adjustment layers. If I do this, I would have to recreate the dust spotting layer as it the wrong size (probably some way to upscale and use that too). I do this as once I am done with an image, I usually don’t need the full size work file–the jpeg is enough. And I don’t particularly want the GIANT files that a full-sized TIFF file would be (300+ MB). Of course, if I was working on my masterpiece, I’d probably save the full PS file, but let’s be honest about the quality of my pictures.

Good luck and let me know if you run into any issues.


  1. These are not the actual actions I use, but ‘cleaned up’ versions. I do not use PS or make actions for a living, so often they are a bit disorganized. If these actions are useful, great! If not, I can attempt to help you out but can’t promise anything. ↩︎

  2. Kaiser Slimlite Plano 5000K, CRI 95. ↩︎


Saturday, March 6 2021

B&W film scan processing

This post is somewhat of an update to Scanning B&W negatives with Vuescan. For color negatives, see the companion article Color film scan processing.

I no longer scan with my Nikon Coolscan V. I now use a Sony A7rII on a copy stand to make ‘camera’ scans.

For processing the resulting photos, I use Adobe Camera Raw (ACR) and Photoshop (PS). My PS actions are available here.1

Step 1 - ACR

Bring your image into ACR. White balance on the film base. While this is probably not necessary for B&W film, it doesn’t hurt.

image in ACR

White balanced on the selection on the right of the image.

I do enable optics corrections in ACR: distortion and vignetting. I found this gives better scans, particularly for color negatives.

You can invert the image in ACR as well using the curves tool. From my experimentation, it makes no difference if you do it in ACR or PS. I do it in ACR as I can then export a downsized version of every image with no other corrections as jpegs for use in Photo Mechanic or other photo browsers.

Inverting with curves

Inverting with curves.

Lastly, make sure the ‘Adobe Monochrome’ profile is selected. This will make your image a true grayscale image, which makes file sizes easier and guarantees no adjustments will give the image a tint.

Create a custom camera profile
Adobe Monochrome profile

I personally make a Camera Profile in ACR with the ‘Adobe Monochrome’ profile selected and the curves inversion saved so I can just set this new Camera Profile for all my images. To access the profile creation dialog, Option-click on the three dots icon at the right side of the ACR interface (or search for ‘adobe camera raw create a custom profile').

Settings with custom profile

With the custom profile selected, the curves tool is no longer inverted.

Step 2 - PS - 1st pass

Now it’s time for actions. Run the ‘Invert’ action if inversion wasn’t performed in ACR. Then run the ‘Basic contrast adjust’ action.

List of Photoshop actions

Before I explain what this action does, I should say that PS work on grayscale images is very flexible - there are many ways to do the same thing. Sometimes I do adjustments that could be done in one step in multiple steps because it is easier to conceptualize what I am doing. That being said, you can do 90% of needed adjustments in a single curves layer if you felt like it.

There are three layers that the ‘Basic contrast adjust’ action makes:

Layers created by the Basic contrast adjust action
  1. ‘Levels - Basic contrast’: This levels adjustment is just a midpoint change to get the image contrast better for the following steps. I don’t think there is anything magic here, it just makes the following step easier. Nominally, I am changing the gamma of the image to 1.45. Is this the right value because CI value of negatives are in the 0.5–0.7 range and 1.45 is the reciprocal? I don’t know.
  2. ‘Curves - contrast tweak’: This is an S-shaped curve to boost midtone contrast and provide some compression in the highlights and shadows. I like it. If you don’t, disable it. Better yet, when this layer is selected, you can hit the number keys (1 through 0) to adjust the layer opacity from 10% to 100%, varying the overall contrast. Some images require more detailed adjustments, but for the type of images I take and want, this really works most of the time.
  3. ‘Levels - total range’: This layer auto sets the total range of the image to the darkest and lightest pixels. Adjust the sliders on the levels panel to taste. I often move the midpoint a little bit, or sometimes the black point slider.

The ‘Levels - total range’ layer contains a layer mask (the thumbnail with the red X through it in the layer palette) that is set up for landscape images with film borders. You don’t want the film border affecting your levels calculation. The action creates the mask, runs the calculation and then disables the mask. If you want to rerun an auto calculation, Shift-click the X’d-out mask to re-enable it, run Auto (Option-clicking Auto brings up the options dialog window), then Shift-click the mask to disable it again.

NOTE: If you are working with images with no borders, you might want to remove the mask making steps completely (the ‘Play action “90% mask…"’ in the ‘Basic contrast adjust’ action). If you are working on images with large borders, non-35mm formats, or anything where this mask is the wrong shape, run ‘Basic contrast adjust - borders’ with appropriate modifications. ‘Basic contrast adjust - borders’ should properly recognize landscape and portrait orientation and provide a large enough border mask for most purposes.

It should be noted that with some images, particularly very overexposed or underexposed images, sometimes I go to the ‘Levels - Basic contrast’ layer and adjust the midpoint slider from the 1.45 value; it looks more natural that way.

Next up is the ‘Dust Bust’ action. This makes a ‘Dust Bust’ layer right above the background layer and activates the healing brush. Change the size of the brush with the ‘{’ and ‘}’ keys, zoom into 100% (Command-Option-0 on macOS), and brush out your dust. Sometimes you might want to go over a spot twice if the healing brush result is a little funky looking. When you are done, go back to full view (Command-0).

Dust Bust layer

You want to do the dust spotting before any fancy layers with luminosity masks or anything. The reason is the luminosity mask will contain the dust if its not spotted out, and when you then spot it out afterwards, the tonal values will be different for the dust than the surrounding areas.

Step 3 - PS - 2nd pass

Now you have a basic image. This is the equivalent of a test print in my mind. I’m not a master printer (nor a master photographer), so most of the time for my snapshots, I’m done.

If your image needs more attention, I use a few more generic actions. ‘Exposure hi/lo’ and ‘Luminosity layers’ do similar things in different manners. Both create a highlight and shadow layer, with a luminosity mask for the highlight layer, and an inverse luminosity mask for the shadow layer. The ‘Exposure hi/lo’ action creates Exposure layers. I find it is useful to go in and adjust the ‘Gamma Correction’ of those two Exposure layers to address highlights or shadows in a global fashion. The ‘Luminosity layers’ creates two curves layers (highlights and shadows) with appropriate curves to boost the highlights or shadows respectively. You can use the same number key trick on all of these layers to adjust the amount up or down (1–0 keys to set the amount to 10–100%).

And who could leave out dodging and burning? The ‘Dodge/Burn’ action creates a layer on the very top where you can use the Dodge and Burn tools to… dodge and burn the image (Shift-O to toggle between Dodge, Burn, and Sponge tools). There are other good ways to accomplish similar things, like painting on a layer mask of an Exposure adjustment layer set to +/- 0.5–2 stops. Really at this point, you can get pretty targeted with your adjustments and it gets ‘personal’. This is just a starting point.

Final image

That’s basically it! I do have some helper actions to do things like save out a full sized jpg file for sharing online and as a ‘print’. Another useful action is the one that downsizes the image (50% in my case) and saves as a TIFF file with all layers included. If I ever want to re-edit the image, I can open up the RAW file from ACR and the TIFF file, and copy over all of the adjustment layers. If I do this, I would have to recreate the dust spotting layer as it the wrong size (probably some way to upscale and use that too). I do this as once I am done with an image, I usually don’t need the full size work file–the jpeg is enough. And I don’t particularly want the GIANT files that a full-sized TIFF file would be (130+ MB). And it’s even worse with color images! Of course, if I was working on my masterpiece, I’d probably save the full PS file, but let’s be honest about the quality of my pictures.

Good luck and let me know if you run into any issues.


  1. These are not the actual actions I use, but ‘cleaned up’ versions. I do not use PS or make actions for a living, so often they are a bit disorganized. If these actions are useful, great! If not, I can attempt to help you out but can’t promise anything. ↩︎


archives