Last active
March 23, 2023 16:58
-
-
Save cletusw/648076667040699f9ec148b322e76a4e to your computer and use it in GitHub Desktop.
Windows batch script that prepares (pre-multiplies) an image file for use as an overlay on an ATEM video switcher (see https://www.youtube.com/watch?v=N2vLs9i0bA0 and https://stackoverflow.com/questions/6591361/method-for-converting-pngs-to-premultiplied-alpha#comment74190171_27177752 ). Requires ImageMagick: https://imagemagick.org/script/downl…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem Source: https://gist.github.com/cletusw/648076667040699f9ec148b322e76a4e | |
if "%~1"=="" goto :usage | |
if not "%~2"=="" goto :usage | |
set "OUTPATH=%~dp1processed\" | |
if not exist "%OUTPATH%" ( | |
mkdir "%OUTPATH%" | |
) | |
set "OUT=%OUTPATH%%~n1_processed%~x1" | |
magick "%~1" -background black -alpha Remove "%~1" -compose Copy_Opacity -composite "%OUT%" && ( | |
echo Wrote %OUT% | |
) | |
goto :eof | |
:usage | |
echo Prepares (pre-multiplies) an image file for use as an overlay on an ATEM video switcher | |
echo Usage: | |
echo. %0 image_file_with_transparency.png | |
echo. | |
:eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment