Window Size offset in Tif files

122 views
Skip to first unread message

Claudio Rocha

unread,
Feb 24, 2025, 5:43:00 PM2/24/25
to hugin and other free panoramic software
After many years of using Hugin on a regular basis, I'm running into a problem with Version 2024.0.1.ead3af10a01a in Linux: 

The stitched images are saved as a tiff file, that when opened in Krita (or other image editors) shows the image displaced. The top left window of the image shows mostly an alpha channel, and somewhere to the bottom right the image starts to show but is not completely visible
Screenshot from 2025-02-24 12-42-30-1.png
The image has the correct dimensions in pixels, but the RGB part of the image seems to be embedded in a larger canvas.
When I enlarge the canvas on the paint program the RGB information of the stitched image shows:
Screenshot from 2025-02-24 12-44-32.png
I've been re-cropping and re-saving to correct the problem, but It seems to me that Hugin is doing something that is off, but that I have not found a way to prevent. I have many many images to go through, some of them quite large and I end up using a lot of time fixing something that seems preventable. Is there a setting I'm overlooking or is this some kind of bug?

Just for the record the image seems to be correctly cropped in Hugin's GL window:

Screenshot from 2025-02-24 14-17-52.png

I'm looking forward to reading your thoughts and maybe find a cure for this issue. 


Claudio Rocha

unread,
Feb 24, 2025, 8:21:25 PM2/24/25
to hugin and other free panoramic software
Upon further investigation using Tifftools (https://libtiff.gitlab.io/libtiff/tools/tiffset.html), the Tiff file in question is showing an offset in the XPosition and the YPosition tags. Using tiffset -s XPosition 0 and Yposition 0 resets the top edge of the RGB picture to the expected top left position.

That fixes the tiff file, but I would love to know where this Offset was coming from and, more importantly, how to prevent it from happening in future image stitching with Hugin. 

Bruno Postle

unread,
Feb 25, 2025, 2:15:17 AM2/25/25
to hugin and other free panoramic software
Hugin saves these tiff offsets because otherwise images with large amounts of empty space can be huge. You can turn off this behaviour with the 'cropped tiff' output setting.

-- 
Bruno

Claudio Rocha

unread,
Feb 25, 2025, 6:20:06 PM2/25/25
to hugin and other free panoramic software
Thanks Bruno for the Reply.
The offset makes sense explained like that.
My next question is where is the "cropped tiff" setting? Is it something that can only be accessed when rendering using the terminal? Can you show me an example on how to use it?

Thanks again for your help

Bruno Postle

unread,
Feb 26, 2025, 4:30:16 AM2/26/25
to hugin and other free panoramic software
For the current project, it's in the Expert Interface > Stitcher tab > Nona Options > Save cropped images.

To set this as a default for new projects, use File > Preferences > Programs > Nona

-- 
Bruno

On Tue, 25 Feb 2025, 23:20 Claudio Rocha wrote:
Thanks Bruno for the Reply.
The offset makes sense explained like that.
My next question is where is the "cropped tiff" setting? Is it something that can only be accessed when rendering using the terminal? Can you show me an example on how to use it?

On Monday, February 24, 2025 at 11:15:17 PM UTC-8 Bruno Postle wrote:
Hugin saves these tiff offsets because otherwise images with large amounts of empty space can be huge. You can turn off this behaviour with the 'cropped tiff' output setting.

Lukas Jirkovsky

unread,
Feb 26, 2025, 7:29:25 AM2/26/25
to hugi...@googlegroups.com
Hello Claudio

On Mon, 24 Feb 2025 at 23:43, Claudio Rocha <marmi...@gmail.com> wrote:
After many years of using Hugin on a regular basis, I'm running into a problem with Version 2024.0.1.ead3af10a01a in Linux: 

The stitched images are saved as a tiff file, that when opened in Krita (or other image editors) shows the image displaced. The top left window of the image shows mostly an alpha channel, and somewhere to the bottom right the image starts to show but is not completely visible

I'm convinced it's a bug in Krita, but there is a workaround in Krita:

* right click on the image layer -> "New layer from visible"
* select the "Visible" layer
* "Image" -> "Trim to current layer"
* delete the "Visible" layer

Lukas

David W. Jones

unread,
Feb 26, 2025, 2:15:30 PM2/26/25
to hugin-ptx
On 2/26/25 02:29, Lukas Jirkovsky wrote:
Hello Claudio

On Mon, 24 Feb 2025 at 23:43, Claudio Rocha <marmi...@gmail.com> wrote:
After many years of using Hugin on a regular basis, I'm running into a problem with Version 2024.0.1.ead3af10a01a in Linux: 

The stitched images are saved as a tiff file, that when opened in Krita (or other image editors) shows the image displaced. The top left window of the image shows mostly an alpha channel, and somewhere to the bottom right the image starts to show but is not completely visible

I'm convinced it's a bug in Krita,

Not a bug in Krita. GIMP does the same thing.

They're just doing what they're supposed to do, supporting standard TIFF features that have been around a long time.

-- 
David W. Jones
gnome...@gmail.com
wandering the landscape of god
http://dancingtreefrog.com
My password is the last 8 digits of π.

Claudio Rocha

unread,
Feb 26, 2025, 11:39:59 PM2/26/25
to hugin and other free panoramic software

Thanks so much!

Claudio Rocha

unread,
Feb 27, 2025, 12:40:00 AM2/27/25
to hugin and other free panoramic software
Thanks again for all your help. 

@Bruno, Setting Nona to Save cropped images or not makes no difference. Final output Tiffs are still coming out with an offset.
                Saving as EXR shows the same offset when opened in Krita as well.
                The only format that does not have offset is png

Lukas, Thanks for the tip for the workaround on Krita, it works. Maybe there is a way to do a script to automate the operation.... 

And GnomeNomad is correct: The issue is not with Krita, as it is reading the Xoffset and Yoffset tags that are indeed written on the Tiff file.

I'm stumped by this situation though. I've been using Hugin for many years and have processed a bunch panoramas succesfully and never ran into something like this. I would love to find a way to disable this offset feature. 

David W. Jones

unread,
Mar 3, 2025, 11:22:26 PM3/3/25
to hugi...@googlegroups.com
I think maybe it's related to transparency? I don't remember seeing it
often, but occasionally I've seen it in generated panoramas if I open
them in GIMP instead of the program I usually use, Luminance HDR. It
sort of looks like a transparency layer in GIMP.

Lukas Jirkovsky

unread,
Mar 4, 2025, 10:06:15 AM3/4/25
to hugi...@googlegroups.com
On Wed, 26 Feb 2025 at 20:15, David W. Jones <gnome...@gmail.com> wrote:
>
> On 2/26/25 02:29, Lukas Jirkovsky wrote:
>
>> I'm convinced it's a bug in Krita,
>
> Not a bug in Krita. GIMP does the same thing.
>
> They're just doing what they're supposed to do, supporting standard TIFF features that have been around a long time.

Applying the offset is correct, what I think is the bug is that Krita
doesn't scale the canvas accordingly. As a result the image can't be
simply cropped and you need to do the trick with an additional layer.
In fact I vaguely remember losing part of the image that was outside
the canvas after saving such tiff file.

Lukas

David W. Jones

unread,
Mar 4, 2025, 7:20:34 PM3/4/25
to hugi...@googlegroups.com
Sounds like a Krita bug. GIMP hasn't done that to me.
Reply all
Reply to author
Forward
0 new messages