Modern camera sensors deliver very high resolution images, often 40-60 megapixels, and sometimes even higher. So, digital zooming, that is cropping images to make the subject larger, is increasingly popular. The cropped image usually has plenty of pixels, so is still of high resolution.
But, if you take an image captured with a 400mm telephoto lens, and crop it, what is the ‘effective focal length’ of the cropped image? That is, what focal length lens would you have needed to capture that image directly, without cropping?
That might seem a rather arcane piece of information to want, but it was important to me!
So, I turned to Claude, the Anthropic LLM, to help me build an app with which I could calculate it whenever I wanted to post a cropped image.
I used vibe coding, which was described in an earlier post about a Solar Alignment Calculator. In essence, it enables someone to describe an application they would like to create, using a natural language prompt, and have the LLM produce all the necessary code to make it.

Keith’s prompt
I would like to create a new app, to help me with my photography. When I crop an image in Lightroom, I would like to know the effective focal length of the resultant image. As an example, if I am editing an image taken at 400mm on a camera with a full-frame, 3×2 sensor, and I crop it so that I reduce the vertical dimension from 4000 pixels to 3500 pixels, what is the effective focal length of that cropped image? I assume the app would need to have input fields for sensor format, lens focal length, and image vertical dimension in pixels. The output would be an effective focal length. Can you build this app for me?
Claude’s response
Now let me think through the math first, then build the app.
The logic: when you crop an image, you're essentially zooming in. If the original vertical dimension is V_orig pixels and you crop to V_crop pixels, the crop factor is V_orig / V_crop. The effective focal length is original_focal_length × crop_factor.
For your example: 400mm × (4000/3500) = 400 × 1.143 = 457mm effective focal length.
Created a file, read a file
Created a file, read a file
The app is ready! It comes pre-loaded with your example (400mm, full-frame 3:2, 4000→3500px), which correctly outputs 457.1mm.
A screen shot of the app

Keith’s observations
It turns out that this is a very straightforward calculation, which could easily be done using a desktop calculator. However, having a personalized calculator for this specific task is very convenient, and I use it often.
It has been especially useful for a moon photography project on which I am working. Although I am using a telephoto lens plus 2x teleconverter, I still need to crop the resulting image in order to achieve a reasonable close-up of the moon’s surface. I can now assign an effective focal length to each of these images.
The rest of Claude’s response
Here's what the app includes:
Inputs:
- Sensor Format — a dropdown with common formats (Full Frame, APS-C variants, Medium Format, Micro Four Thirds, 1-inch), plus a “Custom” option where you can enter your own sensor dimensions in mm
- Lens Focal Length — in mm
- Original Vertical (px) — the full image height from your camera
- Cropped Vertical (px) — the height after your Lightroom crop
Output:
- Effective Focal Length in mm, with the crop multiplier shown
- A breakdown strip showing the pixel crop factor, sensor diagonal, and the 35mm equivalent focal length (which also accounts for your sensor’s crop factor relative to full frame)
The core formula is simply: Effective FL = Original FL × (Original px height ÷ Cropped px height). This works because cropping pixels is optically equivalent to using a longer lens — you're just using a smaller portion of the image circle.


Leave a Reply