libretro / common-shaders

Collection of commonly used Cg shaders. These shaders are usable by either HLSL and/or Cg runtime compilers. The cg2glsl script will translate most of these into GLSL shaders.
http://www.libretro.com
1.03k stars 250 forks source link

Feature Request: Scaling image files #166

Open Mirrorman95 opened 2 years ago

Mirrorman95 commented 2 years ago

ScaleFX and its variants are really good looking filters, but they can only be used inside of certain emulators. I have plenty of pixel art which I want to test it on, but unlike xBRZ, which came with the ScalerTest program to upscale images outside of emulation, the ScaleFX shaders do not. They seem to only be available in the RetroArch-exclusive file formats that all these common-shaders use. If there is any way someone could write a basic program, or RetroArch feature, to allow someone to run the shaders on regular images and export the results, I would appreciate. If this is the wrong place to request such a thing, please direct me to the right place to do so.

hizzlekizzle commented 2 years ago

this is possible in RetroArch, which can load image files directly. There are also command line switches to apply a given shader preset, take a screenshot and then close after X frames. So, with some minimal scripting, you can indeed bulk process images.

Here is the bat file I've used to do this in the past (this looks for png files in a directory called 'process' and then dumps the screenshots into another directory called 'processed'):

@echo off
FOR %%A IN (process\*.png) DO .\retroarch.exe --verbose -c retroarch.cfg %%A --max-frames 100 --max-frames-ss --max-frames-ss-path ".\processed\%%A"