From 5ec7541e786c19b358fed4e52a9017867895458a Mon Sep 17 00:00:00 2001 From: LemonNexus Date: Wed, 11 Feb 2026 17:35:21 +0000 Subject: [PATCH] feat: add "No Upscaling" option to TGA converter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New option: "❌ No Upscaling" - keeps original icon size, just centers on canvas - Useful when you want the icon at original resolution on a larger canvas - Tooltip updated to explain all options - When "none" is selected, upscale parameter becomes False --- modules/tga_converter.py | 8 ++++++-- ui/tga_converter_dialog.py | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/tga_converter.py b/modules/tga_converter.py index 26841d2..549c889 100644 --- a/modules/tga_converter.py +++ b/modules/tga_converter.py @@ -312,7 +312,9 @@ class TGAConverter: # Apply canvas sizing if requested if canvas_size: - image = self._apply_canvas(image, canvas_size, upscale, upscale_method) + # upscale=True unless method is 'none' + do_upscale = upscale and upscale_method != 'none' + image = self._apply_canvas(image, canvas_size, do_upscale, upscale_method) # Determine output path and format if output_name is None: @@ -347,7 +349,9 @@ class TGAConverter: # Apply canvas sizing if requested if canvas_size: - image = self._apply_canvas(image, canvas_size, upscale, upscale_method) + # upscale=True unless method is 'none' + do_upscale = upscale and upscale_method != 'none' + image = self._apply_canvas(image, canvas_size, do_upscale, upscale_method) # Determine output path and format if output_name is None: diff --git a/ui/tga_converter_dialog.py b/ui/tga_converter_dialog.py index 567d333..9b6ffca 100644 --- a/ui/tga_converter_dialog.py +++ b/ui/tga_converter_dialog.py @@ -254,6 +254,7 @@ class TGAConverterDialog(QDialog): canvas_layout.addWidget(QLabel("Upscale:")) self.upscale_method_combo = QComboBox() + self.upscale_method_combo.addItem("❌ No Upscaling", "none") self.upscale_method_combo.addItem("Sharp Pixels (NEAREST)", "nearest") self.upscale_method_combo.addItem("Smooth (HQ4x-style)", "hq4x") self.upscale_method_combo.addItem("Photorealistic (LANCZOS)", "lanczos") @@ -263,6 +264,7 @@ class TGAConverterDialog(QDialog): self.upscale_method_combo.addItem("🤖 AI Enhanced (Real-ESRGAN)", "ai") self.upscale_method_combo.setToolTip( + "None: Keep original size, just center on canvas\n" "NEAREST: Sharp pixel edges (best for pixel art)\n" "HQ4x: Smooth but keeps details (best for game icons)\n" "LANCZOS: Very smooth (best for photos)\n"