Commit Graph

9 Commits

Author SHA1 Message Date
LemonNexus 8f7c7cb5a1 fix: TGA converter improvements
1. Auto-detection now uses rglob to find TGA files in ALL subfolders
   - Properly finds icons in version subfolders like 19.3.2.201024
   - Shows relative paths in the file list

2. Default settings changed:
   - Default canvas: 320x320 (index 5)
   - Default upscale: No Upscaling (first in list)

3. Added iconcache.dat parser module (icon_cache_parser.py)
   - Attempts to extract item names from binary cache file
   - Uses heuristics to find icon ID to name mappings
2026-02-11 17:39:49 +00:00
LemonNexus 5ec7541e78 feat: add "No Upscaling" option to TGA converter
- 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
2026-02-11 17:35:21 +00:00
LemonNexus 5374eba08f feat: add Real-ESRGAN AI upscaling support
- New module: modules/ai_upscaler.py
  - Real-ESRGAN integration for AI-powered upscaling
  - Designed specifically for low-res game textures/icons
  - 4x upscale factor with neural network enhancement
  - Falls back gracefully if model not available

- Updated TGA Converter UI:
  - New "AI Enhanced (Real-ESRGAN)" option in upscale dropdown
  - Only shown if Real-ESRGAN is installed
  - AI upscaling happens before canvas placement
  - Shows progress during AI model loading

Real-ESRGAN is much better than basic methods for rendered (non-pixel) icons!

To use AI upscaling:
1. pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
2. pip install realesrgan
3. Download RealESRGAN_x4plus.pth model
4. Select "AI Enhanced" in the UI
2026-02-11 17:32:40 +00:00
LemonNexus 0034cc9453 feat: add 3 upscale methods - Sharp Pixels, Smooth HQ4x-style, Photorealistic
- NEAREST: Sharp pixel edges (best for clean pixel art)
- HQ4x-style: Integer scale first, then smooth to target with edge enhancement
- LANCZOS: Very smooth (best for photorealistic textures)
- Added upscale method selector to UI
- Each method uses UnsharpMask for enhanced crispness
2026-02-11 17:25:00 +00:00
LemonNexus b666e40bfc feat: add canvas sizing with centered icons and upscale option
- Removed WebP support (PNG only now)
- Added canvas size selector: Original, 64x64, 128x128, 256x256, 280x280, 320x320, 512x512
- Icons are centered on transparent canvas
- Added 'Upscale small icons' checkbox to scale up small icons to better fill canvas
- Uses high-quality Lanczos resampling for upscaling
- Default canvas size: 320x320
2026-02-11 16:37:14 +00:00
LemonNexus ac334ac4a8 feat: add WebP output format support for TGA conversion
- Updated TGAConverter.convert_tga_to_png() to support 'webp' format
- High quality WebP encoding (quality=95, method=6)
- Added format selector in UI (PNG or WebP)
- Convert button text updates based on selected format
- WebP is better for web uploads: smaller files, better quality

WebP advantages:
- 25-35% smaller file size than PNG
- Better quality at same file size
- Alpha channel support
- Widely supported in modern browsers
2026-02-11 16:17:31 +00:00
LemonNexus 46e84b39e3 fix: pass selected cache path to conversion worker
- Worker now accepts cache_path parameter
- _start_conversion passes the selected path to worker
- Fixes 'Cache folder not found' error during conversion
2026-02-11 15:56:47 +00:00
LemonNexus 681b07688c fix: respect manually selected cache folder path
- _scan_cache now checks if manual path is set before auto-finding
- Fixes issue where browsing and selecting path was ignored
2026-02-11 15:54:29 +00:00
LemonNexus acca0d3491 feat: add TGA Icon Converter for game cache files
- New module: modules/tga_converter.py
  - Reads Truevision TGA format from game cache
  - Converts to PNG with proper color handling (BGR->RGB)
  - Auto-detects cache folder location
  - Batch conversion support
  - Handles alpha channels

- New dialog: ui/tga_converter_dialog.py
  - Visual interface for TGA conversion
  - Shows list of cached .tga files
  - Progress tracking during conversion
  - One-click convert all

- Added to Tools → Computer Vision → TGA Icon Converter (Ctrl+T)

This is much more efficient than extracting icons from screenshots!
The game already has the icons in cache as .tga files.
2026-02-11 15:37:14 +00:00