From 222d9ec4ad04bdab5ca2ebfb408bf4ced3add3dc Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 2 Oct 2026 11:09:02 +0000 Subject: [PATCH] fix(video): size linear DNG tiles to small frames Edge padding of 256-pixel tiles tripled the size of small sequence frames. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC --- src/Titano.Core/Video/Managed/ManagedSessions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Titano.Core/Video/Managed/ManagedSessions.cs b/src/Titano.Core/Video/Managed/ManagedSessions.cs index da797ac2..d46a8e5d 100644 --- a/src/Titano.Core/Video/Managed/ManagedSessions.cs +++ b/src/Titano.Core/Video/Managed/ManagedSessions.cs @@ -264,7 +264,8 @@ internal sealed class ImageSequenceSession : ManagedSession VideoCodec.JpegSequence => JpegEncoder.Encode(frame, JpegOptions(Settings.Quality)), VideoCodec.PngSequence => PngEncoder.Encode(frame, Settings.BitDepth == 16 ? 16 : 8, CompressionLevel.Optimal), VideoCodec.Tiff16Sequence => TiffWriter.Write(frame, new TiffWriteOptions { BitsPerSample = Settings.BitDepth == 8 ? 8 : 16 }), - VideoCodec.LinearDngSequence => LinearDngWriter.Write(frame), + // Tiles no larger than the frame: edge padding of a 256-pixel tile would dominate small outputs. + VideoCodec.LinearDngSequence => LinearDngWriter.Write(frame, new LinearDngOptions { TileSize = int.Clamp((int.Max(frame.Width, frame.Height) + 15) / 16 * 16, 16, 256) }), _ => throw new NotSupportedException($"{Settings.Codec} is not an image sequence"), }; }