Skip to content

Python 3.12 application for scaling images using various algorithms

License

Notifications You must be signed in to change notification settings

MikiP98/MultiScaler-Plus

Repository files navigation

AutoUpscale

Universal app for scaling images

AutoUpscale is a universal app for scaling images. It can be used as a command line tool, a web GUI, or a console application.

Supported algorithms

  • Classical Algorithms (Up-scaling and downscaling):
    • Bicubic (Better than bilinear, less blur, more detail, higher contrast)
    • Bilinear (Second-simplest algorithm, most common and most blurry)
    • Nearest neighbor (Simplest algorithm, duplicates or keeps only the nearest pixel)
    • Area (Averages pixels into smaller ones) (Only down-scaling)
    • Lanczos (Better than bicubic, less blur, higher contrast)
  • AI-based Algorithms (Only up-scaling):
    • A2N
    • AWSRN-BAM
    • CARN
    • CARN-BAM
    • DRLN (recommended)
    • DRLN-BAM (recommended)
    • EDSR
    • EDSR-base
    • ESPCN
    • FSRCNN (normal and small)
    • HAN
    • LapSRN
    • MDSR
    • MDSR-BAM
    • MSRN
    • MSRN-BAM
    • PAN
    • PAN-BAM
    • RCAN-BAM,
    • RealESRGAN (improved ESRGAN) (recommended)
    • Anime4K (recommended)
    • HSDBTRE (hybrid of DRLN and RealESRGAN AIs) (recommended)
  • Edge Detection Algorithms (Only up-scaling):
    • hqx (edge detection algorithm, simple, not so great)
    • NEDI (New Edge-Directed Interpolation, can be better than hqx, but probably won't)
    • Super xBR (edge detection algorithm, based on xBR, more angles but more blur)
    • xBRZ (edge detection algorithm, based on xBR, better at preserving small details)
  • Smart Algorithms (Only up-scaling):
    • FSR (FidelityFX Super Resolution 1.1, made by AMD)
    • CAS (Contrast Adaptive Sharpening, made by AMD)

Installation:

  1. Make sure you have installed on your system:
    • Python 3.12
    • Node.js (16.0.0 or newer)
  2. Clone this repository
  3. Run the included install.bat script

Usage:

  • Command line tool:
    • Run the included run_console.bat script
    • Run the python script manually: python src/standalone.py
      • You can also pass arguments to the script. Add --help to see the list of available arguments
  • Web GUI (currently lacks some functionality):
    • Run the included run_webui.bat script

Examples:

Example - Wiki Shell:

Scaled down image (40px):

Wiki Example Shell - Small

Results of up-scaling the image (40px -> 160px):

Original Nearest Neighbour Bilinear Bicubic
Original Nearest Neighbour Bilinear Bicubic
Lanczos EDSR (CV2) ESPCN (CV2) FSRCNN (CV2)
Lanczos EDSR (CV2) ESPCN (CV2) FSRCNN (CV2)
FSRCNN-small (CV2) LapSRN (CV2) A2N (SI) AWSRN-BAM (SI)
FSRCNN-small (CV2) LapSRN (CV2) A2N (SI) AWSRN-BAM (SI)
CARN (SI) CARN-BAM (SI) DRLN (SI) DRLN-BAM (SI)
CARN (SI) CARN-BAM (SI) DRLN (SI) DRLN-BAM (SI)
EDSR (SI) EDSR-base (SI) HAN (SI) MDSR (SI)
EDSR (SI) EDSR-base (SI) HAN (SI) MDSR (SI)
MDSR-BAM (SI) MSRN (SI) MSRN-BAM (SI) PAN (SI)
MDSR-BAM (SI) MSRN (SI) MSRN-BAM (SI) PAN (SI)
PAN-BAM (SI) RCAN-BAM (SI) RealESRGAN Anime4K
PAN-BAM (SI) RCAN-BAM (SI) RealESRGAN Anime4K
HSDBTRE hqx NEDI (m = 4) Super xBR
HSDBTRE hqx NEDI <sup>(m = 4)</sup> Super xBR
xBRZ FSR CAS (sharpness = 0.5)
xBRZ FSR CAS <sup>(sharpness = 0.5)</sup>

Supported file formats:

Tested working:

  • Write:

    • PNG (Widely used, popular, lossless format)
    • QOI (A bit worse compression then PNG, but a lot lot faster to save and load)
    • WEBP (Comparable, lossless and lossy compression, to JPEG XL (a bit worse on average), but with better overall support)
    • JPEG XL (New advanced compression format, better lossless compression compared to PNG and better lossy compared to JPEG)
      (see this plugin for Windows Support)
    • Benchmark result (size, lower is better):
      • QOI: 790 448 B
      • PNG: 675 397 B
      • WEBP: 444 538 B
      • JPEG XL: 450 085 B
  • Read:

    • PNG (.png)
    • JPEG (.jpg, .jpeg)

Should work:

  • Read:
    • APNG (.apng, .png2)
    • BLP (.blp, .blp2, .tex)
    • BMP (.bmp, .rle)
    • CUR (.cur)
    • DCX (.dcx)
    • DDS (.dds, .dds2)
    • DIB (.dib, .dib2)
    • EMF (.emf)
    • EPS (.eps, .eps2, .epsf, .epsi)
    • FITS (.fits)
    • FLC (.flc)
    • FLI (.fli)
    • FPX (.fpx)
    • FTEX (.ftex)
    • GBR (.gbr)
    • GD (.gd)
    • GIF (.gif, .giff)
    • ICNS (.icns, .icon)
    • ICO (.ico, .cur)
    • IM (.im, .im2)
    • IMT (.imt)
    • IPTC (.iptc)
    • JPEG (.jpg, .jpeg, .jpe)
    • JPEG 2000 (.jp2, .j2k, .jpf, .jpx, .jpm, .j2c, .j2r, .jpx)
    • MCIDAS (.mcidas)
    • MIC (.mic)
    • MPO (.mpo)
    • MSP (.msp, .msp2)
    • NAA (.naa)
    • PCD (.pcd)
    • PCX (.pcx, .pcx2)
    • PFM (.pfm, .pfm2)
    • PIXAR (.pixar)
    • PNG (.png, .pns)
    • PPM (.ppm, .ppm2)
    • PSD (.psd)
    • QOI (.qoi)
    • SGI (.sgi, .rgb, .bw)
    • SPIDER (.spi, .spider2)
    • SUN (.sun)
    • TGA (.tga, .targa)
    • TIFF (.tif, .tiff, .tiff2)
    • WAL (.wal)
    • WMF (.wmf)
    • WebP (.webp, .webp2)
    • XBM (.xbm, .xbm2)
    • XPM (.xpm)

Roadmap:

  • Add Performance / Benchmarks section to the README
  • Add support for WEBP2 format (both reading and writing)
  • Add support for AVIF format (both reading and writing)
  • Optimize the code, adn remove unnecessary parts and duplicates
  • Rewrite and update the WebUI
  • Add support for Waifu2x and Supir AIs via Docker
  • Fix and improve standalone console application experience

Credits: