Nona downsizing and aliasing

210 views
Skip to first unread message

ChameleonScales

unread,
Nov 5, 2025, 6:38:42 AM11/5/25
to Hugin Google Group
Hi,
I've found very old threads about this subject but I think it's best I make a new one.

When downsizing an image significantly with nona, the interpolator doesn't behave the same as a similar interpolation from, say, GIMP or imagemagick :
comparison.gif

All of Nona's interpolation methods produce a result so close to "nearest neighbor" that the difference between them is nearly imperceptible.

Meanwhile, GIMP's cubic interpolation produces much cleaner anti-aliasing.

So I wonder if there's a bug in nona's code that can be resolved or if such an improvement would require a refactor.

Cheers

T. Modes

unread,
May 25, 2026, 4:27:56 AMMay 25
to hugin and other free panoramic software
Hi,

I tried to implement some kind of anti-aliasing. The code is currently in a separate branch named aa_interpolator.
Maybe you could test this branch and report back, if this improves the result for you?

Thomas

ChameleonScales

unread,
Sep 4, 2026, 9:29:48 AMSep 4
to hugi...@googlegroups.com
(sorry for the late reply. I forgot about this for a while.)

Thanks, this is great!

Here's are my results on the same test image:

Nona bicubic : Without anti alias vs. With anti alias:
no-aa vs aa.gif

GIMP vs. Nona with anti alias:
gimp vs nona-aa.gif

GIMP makes bright pixels dominate more than darker ones, which I assume is closer to how light works in photography (if you downscale an hdr picture and then convert to low dynamic range).

I'm noticing that imagemagick, while keeping the same brightness as nona, seems to produce even smoother anti-aliasing than GIMP.

This is GIMP vs. imagemagick (with default interpolation):
gimp vs magick.gif

And this is imagemagick vs. Nona with anti alias:
magick vs nona.gif
Here it's clearer that magick's anti-alias is smoother.

But I'm just nit-picking here.

All that said, this new anti aliasing for Nona is definitely enough and a big improvement for me.

In terms of the final implementation, I think it would be best to have an "Anti aliasing" checkbox in Nona's options which would apply to whichever interpolation you chose, rather than having one more item per interpolation mode in the dropdown menu.

But either way this is great. Thanks again

T. Modes

unread,
Sep 5, 2026, 1:00:02 PMSep 5
to hugin and other free panoramic software
Hi ChameleonScales,

chamele...@protonmail.com schrieb am Freitag, 4. September 2026 um 15:29:48 UTC+2:
Thanks, this is great!

Here's are my results on the same test image:

All that said, this new anti aliasing for Nona is definitely enough and a big improvement for me.

thanks for testing. So this can go into the next version? Or are there other issue to consider?

In terms of the final implementation, I think it would be best to have an "Anti aliasing" checkbox in Nona's options which would apply to whichever interpolation you chose, rather than having one more item per interpolation mode in the dropdown menu.

this was done for better backward compatibility with libpano. 

Thomas

Abrimaal

unread,
Sep 6, 2026, 6:21:33 PMSep 6
to hugin and other free panoramic software
Maybe not exactly related to that topic, but also about downsizing images.
It refers to searching for control points (especially in low light and blurry images)
1. Searching for control points (the selected mode, let's assume the standard CPfind)
2. if no CP found 
    Downsize images to 256 px*, 
    Save small images to Temp
    Search again for CP (CPfind is searching again for similar shapes and colors)
3. if still no CP found in an image (but the rest are connected by CPs)
    Exclude the unaligned image, 
    change projection to the selected**
    apply the selected optimizing, 
    Stitch panorama (from normal size images)
    Delete small images from Temp

* 256 px is an example. The images may be downsized gradually (half, half, half) but it will take more time
** projection refers mainly to the automatic stitching by the Assistant

In the current version, if one image is unaligned, the whole project fails. Projection is not set, Optimisation not performed.
The improvement (ignoring unaligned images) would make the work more successful .
What do you think about that?

ChameleonScales

unread,
Sep 7, 2026, 4:12:18 AMSep 7
to hugi...@googlegroups.com
Thanks Tmodes.
As far as I'm concerned this is good enough as it is.

To complete this test, here's a comparison between the 4 different Anti alias modes:
aa modes.gif

I also attached the individual png images.

@Abrimaal: This proposal looks unrelated to nona (cpfind doesn't operate on reprojected images)
test-bicubic-aa.png
test-nearest-aa.png
test-bilinear-aa.png
test-sinc256-aa.png

T. Modes

unread,
Sep 10, 2026, 12:41:09 PMSep 10
to hugin and other free panoramic software
chamele...@protonmail.com schrieb am Montag, 7. September 2026 um 10:12:18 UTC+2:
As far as I'm concerned this is good enough as it is.
Thanks for testing and feedback.
I merged the anti-alias branch into default branch. So it will be in the next release.

Thomas


ChameleonScales

unread,
Sep 14, 2026, 7:56:38 AMSep 14
to hugi...@googlegroups.com
Awesome, thank you!
Reply all
Reply to author
Forward
0 new messages