Stitching (for segmented scans)


the recently added Negative Film tool helped turning RawTherapee into a powerful tool for those of us using digital cameras to scan film.
Thank you very much!

To get better resolution, I’m used to rotate the (scanning) camera vertically (long side of sensor = short side of film frame) and shooting 3 pics for each frame.

It would be great to have a way to stitch together “slices” of film frames inside RawTherapee. :slight_smile:

Most stitching software is overkill for this task, since it’s mainly aimed to panoramic photos (rotating camera, parallax correction etc.).

What do you think about it? Anyone interested?


Hi Fernando, I don’t know of any way to do this within RT, but I’ve done quite a bit of this using Hugin with medium and large-format negatives and transparencies. The key is that you need to do this in mosaic mode, where the camera doesn’t rotate, but rather stays in the same plane as the film. Any other projection, such as cylindrical or spherical and it gets really messed up. I did a video tutorial on this last year if you’re interested. You can do more than one row as well.

That said, with my own experiments, I don’t see any advantage in detail by doing this for 35mm film if you’re using a 24 mp or greater camera. Even fine-grain film such as Kodachrome or Fujichrome Provia seem to pretty much top of useful resolution at around 3500 ppi and 24 mp is 4000x6000. For medium and large-format film I’ve used up to 6 shots (36 mp Nikon D800) and stitched them together for really high resolution.


Hi Trodoon,
yes it would be great to have your video tutorial, thanks!
I was humbly suggesting to add a planar-stitching functionality in a future RawTherapee version, but it’s probably too small a niche of potential users.

I disagree with your assessment about film resolution (I have various samples with real detail in excess of 100 lp/mm), but to each his own. :slight_smile:

This is not strictly correct, since in a Bayermatrix only 1/3 of the pixels in the output image are measured which determine the physical resolution. 2/3 of the pixels are interpolated. To calculate the resolution of the detector, only the G-band pixels are relevant, since they give the highest spacial resolution. For a 45 Megapixel camera you end up with about 4000 x 6000 pixels for the G-band, corresponding to 4200ppi. This calculation does, however, not include the effect of the optics of the camera used for the “scanning”.

Erich Baier (2009) in his book “Analog fotografieren, digital verarbeiten” compares images of scanned slides. The image scanned with a drum scanner at 6300ppi is considerably better than the scan with a Nikon CoolScan 9000 at 4000ppi! So I would conclude that a 24Megapixel digital camera would not exploit the full potential of a high-resolution slide.


1 Like

That’s my experience, too.
I own a drum scanner (11’000 nominal ppi), a Nikon SuperCoolscan 8000 (4000) and a Minolta Scan Elite (5400); as I said, I have various samples (including resolution charts) which show real details at 100 lp/mm or more; I can clearly see that in some cases, the finest details are not resolved by the Nikon.
Since I’m trying to replace my old and quirky scanners with a full frame mirrorless dedicated to film scan, I would love to have X-Y (or even X-only) stitching within RawTherapee, thus the topic. :smile:

Fernando, what camera/lens combo do you plan to use to photograph greater than 1:1 on a full frame camera? I know the Laowa macro lenses go to 2:1, which would work, but not most others.

I owned the Scan Elite 5400, but it finally died. Also had the Minolta Scan Multi Pro (4800 ppi) but sold it when I started using a DSLR with macro lens and compared the results. I’ve also had numerous images of mine drum scanned by service bureaus for commercial use, so I’ve been able get decent comparisons between various scanners. So much, of course, depends on the scanner operator and the software. Many of these older film scanners, such as the Minoltas and Nikons, rely on older software, or Vuescan, which simply doesn’t offer the same control as current raw software such as RawTherapee. For me this is a huge factor.

When I did my tests on 24 vs 36 mp, I selected very sharp 35mm images on Fujichrome Velvia and Provia 100, with fine detail and compared them side by side on the computer screen at the same magnification. The differences were negligible if present at all and I’d have a lot of difficulty determining which camera was used for each scan in a blind test. So much depends on the software, including the sharpening.

I also did some tests on scanning medium-format film using a Nikon D800 and a D810 to see what difference the optical low-pass filter makes. In these tests I found any difference to be negligible. I recognize that photographing real-world scenes, as opposed to film, would show a difference, as is evident by samples in Dpreview.

That said, I should note that I’m doing most of my 35mm scanning, both for my own work and for other pro photographers, with a full-frame D800 and Nikkor 60mm f2.8 G micro lens. At 1:1 (or very close to it as I want a bit of wiggle room for focus) it still shows a bit of the slide mount, which helps to centre the slide and ensures I have the whole image area. With the D800 I can just crop this out after and still have plenty of resolution.

Fernando, which full-frame mirrorless are you looking at? I have a project coming up where I’ll have a choice of using either a Nikon D850 or the mirrorless Z7 for scanning historical film in medium and large-format negatives and transparencies. Haven’t yet decided which one I’ll go for. I think the results would be just about the same.

Troodon, if your setup if enough for your needs, more power to you: not trying to “sell” my needs to you.
I need more resolution because, as I said, some details on my originals need a scanning system with at least 100-120 lp/mm of real (not CFA-interpolated) resolving power (but I have BW shots with details in excess of 140 lp/mm, so the more the better), and my old drum scanner won’t last long.

I’m currently using an Apo-Rodagon D2X as my scanning lens in my current setup; it’s a copy lens optimized for 2:1, but works really well between 1:1 and 2.5:1 at f/6.7.
As a “scanning camera”, I’m looking at Sony A7RIII or IV.
The Panasonic S1R is very tempting too, because of its excellent implementation of sensor-shift HR mode; but, since I’m working on a custom scanner (with a FF mirrorless at its heart) with a friend, open-source remote control is also important. S1R seems lacking in this departement, since it’s not fully supported by GPhoto2 apparently.

All that said, I still hope that maybe one day I could have planar stitching support in RawTherapee to ease up my workflow… hopes are cheap!

1 Like

It seems to me that having stitching in RT would be a large amount of work that is 100% redundant with Hugin.

I disagree. Lens distortion and vignetting alone will present potential issues for mosaic mode stitching. While RT has built-in model-based profiles for most lenses out there, there’s enough potential error in the profiles that you’ll need the fine tuning that Hugin’s optimizer provides. (Plus as far as the final blending of the remapped images, enblend is highly powerful.)

In short, adding stitching to RT to meet your needs would require pretty much pulling in half of Hugin’s capabilities.

(However, one valid point is that right now the tool from @rom9 does not handle images that have already been demosaiced. Fixing this is on his TODO list I believe.)


Ah, good point about distorsion and vignetting calling for Hugin optimizer. :frowning:

Yep, confirmed, i’ve just started hacking something toghether, will keep you posted :wink:

I agree that Hugin is the right tool for this job, i did it once for a slide using this tutorial, it worked perfectly:

bringing the same functionality inside RT would be impractical to say the least.
On the other hand, once the film negative tool supports non-raw files, the entire process could be quite streamlined:

  1. Convert the negative RAW files to negative TIFFs (without any editing except camera color profile and very basic stuff; can be scripted using rawtherapee-cli)
  2. Stitch the negative using Hugin (i’m sure this can mostly be automated via hugin project files)
  3. Open the resulting TIFF in RT, enable the film negative tool and edit as needed.

So the only manual tweaking would be in step 3.


Thanks. I always like to hear other approaches and ideas on this topic, especially when the needs are different from mine.

Cameras with really high resolution such as the Fujifilm GFX 100, or pixel shift bodies, have intrigued me as well, mainly for scanning medium and large-format film.

I usually ask myself what is the largest that this shot is likely to be reproduced and scan accordingly. Clients will sometimes need them larger, and then I’ll scan in sections and stitch with Hugin. The largest scans I’ve been commissioned to do were for wall prints that needed to be printed at around 3.5 metres wide from large-format B&W negatives dating back to 1939. For these I used the D800 and took 6 shots (2 rows of 3 images), processed the negative images in RawTherapee and stitched them in Hugin. The largest prints I’ve done commercially (other than billboards, which are really not high res) were for murals in a corporate office around 8 metres wide. These were real scenes, not scans, and were up to 84 images stitched (3 rows of 28).

Fernando, I’m curious, is your film all 35mm, or do you use larger formats? What is the subject matter?

If anyone is interested, I made a video tutorial on stitching scanned negatives for a workshop I gave on DSLR scanning. It’s for a more recent version of Hugin than the Souceforge tutorial mentioned by Rom9 above. It’s about 16 mb.


@rom9 ,
so your advice is to convert to negative TIFF first, and only at the last step using your Negative Tool?
I mean, instead of converting the raw files to positive TIFF straight away and as the last step stitching with Hugin?

Thanks for your support!

in theory, that should be the fastest workflow since you would do all your fine tuning in the last step, working on the whole picture. The first two steps should be quite straightforward and not require any manual retouching later.
Anyway this is just a thought, we’ll have to try it and test it as soon as non-raw negative support is ready. Stay tuned :wink:

1 Like

I also use the same method of stitching several photos with 6x6 negatives. But I also sometimes hdr-bracket the tiles to get the most out of the film.

Here I have some issues with RT how to HDR merge and stitch bracketed negatives. It seems that when using the film negative tool the image is somehow normalized and all three exposure bracketed images come out with similar exposure after being converted to “positive”. And since film negative is only available in RAW I cannot HDR merge and stitch them in negative.

I have also tried to HDR merge and stitch i Lightroom which is quite straightforward, but the resulting dng is then very strange in RT and I cannot use film-negative for dng either (And working with negatives in Lightroom is quite difficult since all controls are inverted so I really would like to use RT for this task).

I think the ideal workflow is to do raw processing in RT on each frame, using the film negative tool, then export to tiff, then stitching in Hugin. Set a fixed parameter based for the film negative tool, and then copy paste the processing profile to the other photo segments.

I have no interest whatsoever in a Rawtherapee raw panorama feature, as stitching exported tiffs has always worked for me, and I don’t want to have to load half of Hugin each time I open Rawtherapee.

Hi Jonas, thanks for testing! Yes, the current version of the film negative tool always applies auto-scaling to the channels, so that ranges are “centered” on the median value.
There is already a “stable multipliers” feature implemented in this PR, but unfortunately it had some bugs and i didn’t make it in time for inclusion in the 5.8 release.
With that feature, you will have a new “Film base color” button, that will let you pick the color of a spot of clear (unexposed) film, and use that as a reference for channel scaling.

In your use-case of HDR-merging, you would have to pick the base color for only one of the images, and then copy/paste the same setting on the others.
Actually, though, i’m not sure that HDR-merging after inversion would work; since the process is non-linear, i suspect the output could have some color deviation :thinking:

In any case, i’m also working on adding non-raw file support which i hope to have ready for 5.9. That will make things much easier since you can HDR-merge the negative before inversion.

Completely agree :wink: