Zerene subframe scaling

A forum to ask questions, post setups, and generally discuss anything having to do with photomacrography and photomicroscopy.

Moderators: ChrisR, Chris S., Pau, rjlittlefield

Beatsy
Posts: 1648
Joined: Fri Jul 05, 2013 3:10 am
Location: Malvern, UK

Zerene subframe scaling

Post by Beatsy »

When scaling is enabled, will Zerene ever upscale individual images to align them, or is it always downscaling? Thanks.

Edit: supplementary question. If I stack highest-quality jpegs and save the result as a 16-bit TIFF, is it a true 16-bits. That is, are there (potentially) 65536 different intensity values for each colour, or are there only 256 quantised ones (i.e 0,1,2,3,4 in the jpg becomes 0,256,512,768,1024 in the TIFF)? If the former, what's the source of the extra "in-between" values? Perhaps from sub-pixel sampling when aligning and scaling? Thanks again.

rjlittlefield
Site Admin
Posts: 20987
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Re: Zerene subframe scaling

Post by rjlittlefield »

Beatsy wrote:When scaling is enabled, will Zerene ever upscale individual images to align them, or is it always downscaling?
Upscaling is the normal action. By default, Zerene Stacker starts at the "narrow" end of the stack, the end having the smaller field of view. To make other frames align with that, they get cropped to the same field of view and then expanded to the same pixel dimensions, so you get more pixels covering the same area.

But if you want it to go the other way, downscaling a smaller field of view to match a larger one, then you can force that by un-selecting Options > Preferences > Alignment > "Automatic order", and if necessary, manually putting the wide end first with File > "Re-order input frames" > "Reverse order" (formerly just File > "Reverse order").
If I stack highest-quality jpegs and save the result as a 16-bit TIFF, is it a true 16-bits. That is, are there (potentially) 65536 different intensity values for each colour, or are there only 256 quantised ones (i.e 0,1,2,3,4 in the jpg becomes 0,256,512,768,1024 in the TIFF)? If the former, what's the source of the extra "in-between" values? Perhaps from sub-pixel sampling when aligning and scaling?
Yes, potentially all values. The in-between values can come from sub-pixel sampling, from brightness adjustment, from weighted averaging on frame transitions in DMap, and from pyramid recombining in PMax. In-between values are actually pretty hard to prevent. You have to turn off brightness correction, turn off scaling, avoid PMax, and be lucky enough to avoid weighted averaging in the DMap.

--Rik

Beatsy
Posts: 1648
Joined: Fri Jul 05, 2013 3:10 am
Location: Malvern, UK

Post by Beatsy »

Thanks Rik. I do find this hard to get my head round. Since the camera is moving, then every frame is essentially at the same scale (in my mind). This is why I asked.

I'm interested because I'm finally getting true pixel-level resolution at low mags and thought up-sampling might affect sharpness (not resolution) more than down sampling. But only when pixel-peeping and not likely of any real consequence anyway - except perhaps for 100% crops.

The "true 16-bit" is good news. I was doing several quick stacks with jpg instead of the usual RAW and convert to TIFF. My jpg tests are usually double spaced and downsampled 50% for speed. I forgot to change the step size for one (for the first time ever) and ended up doing a "proper" stack using jpg source files. The end result was indistinguishable from RAW and TIFF! :shock:

I'm sure RAW is still best where there's huge dynamic range and shadows need pushing to get detail out. But I'll be using jpg with "well lit" subjects from here on in. The quality is so much better than I assumed it would be. Enormously faster without the import, convert and export step too. I can just stack straight from the camera memory card instead. My recent Speedwell post was done that way.

Beatsy
Posts: 1648
Joined: Fri Jul 05, 2013 3:10 am
Location: Malvern, UK

Post by Beatsy »

PS. I'm still confused. Should I start the stack from the furthest focus distance, or the nearest to get downsampling?

rjlittlefield
Site Admin
Posts: 20987
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

Beatsy wrote:PS. I'm still confused. Should I start the stack from the furthest focus distance, or the nearest to get downsampling?
That question is more subtle than you might guess. It depends on exactly what optics you're using and how you're doing the focus stepping.

In "Tutorial #2: Using a Macro Lens on a DSLR", it is discussed that the wide end is either the front or the back, depending on whether focus is stepped by ring or by rail.

With most optics -- the ones that have normal perspective -- if you're focusing by rail then the wide end will be the front because that's the end where the lens is farthest from the subject.
I do find this hard to get my head round.
Yeah, me too, despite years of practice.
Since the camera is moving, then every frame is essentially at the same scale (in my mind).
Every frame is the same scale in its own plane of focus. But in every frame, the scale changes from front to back due to perspective. So when you step focus by moving the camera, you're changing the scale of every part of the subject.

To make the details line up properly, source frames need to be resized so that each part of the subject has the same scale in all frames. If you don't do that, then subject details cannot be lined up properly and you'll get smearing.

To get a better feel about what's going on, I suggest to process a stack, then use press-and-drag in the list of input files to "play" the stack as if it were a filmstrip. Do this with and without "Show as adjusted" checked, and think about the difference.

--Rik

Beatsy
Posts: 1648
Joined: Fri Jul 05, 2013 3:10 am
Location: Malvern, UK

Post by Beatsy »

Thanks again, I'll try your suggestions. As I said before, it probably doesn't make a blind bit of difference in the output, but I want to reassure myself that's actually the case - and understand it...

Lou Jost
Posts: 4528
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

These effects are why some people like telecentric lenses, whose FOV does not change as the lens moves up and down during stacking. It is actually very weird and unnatural to see it in action, but it eliminates the need for shrinking or stretching the frames of a stack, and so it could actually preserve pixel-level detail better.

naturepics43
Posts: 85
Joined: Mon May 11, 2015 9:21 pm
Location: Hocking County, Ohio , USA

Post by naturepics43 »

Beatsy wrote:Thanks again, I'll try your suggestions. As I said before, it probably doesn't make a blind bit of difference in the output, but I want to reassure myself that's actually the case - and understand it...

In a lot of cases it DOES make a big difference. From my experiences (which are limited), I found that if the stack is run from the last frame taken to the first frame taken, the finished image will be very close to the actual magnifaction that you used. If the stack is run from the first frame taken to the last frame taken, ( You get "streakies" on the edges ), the magnifaction of the finished image will be smaller than what was used. VERY important if you want the scale bars to be accurate. It's very easy to verify. Run a stack in both directions and compare the finished image sizes. Maybe this will help you determine which way is downsampling. That part also confuses me. Hope this helps.

rjlittlefield
Site Admin
Posts: 20987
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

naturepics43 wrote:VERY important if you want the scale bars to be accurate.
This may be phrasing it a bit harshly, but if processing front to back versus back to front has much effect on the accuracy of scale bars, then the scale bars are not to be trusted anyway.

That's because if the scales at front and back of the stack are different, to which depth does the indicated bar apply?

--Rik

Post Reply Previous topicNext topic