Skip to content

Instantly share code, notes, and snippets.

@YUKI2eN3e
Created July 23, 2023 01:54
Show Gist options
  • Select an option

  • Save YUKI2eN3e/4aa4f3f48b62adfd065157d43a2a1a28 to your computer and use it in GitHub Desktop.

Select an option

Save YUKI2eN3e/4aa4f3f48b62adfd065157d43a2a1a28 to your computer and use it in GitHub Desktop.
@ECHO OFF
REM You need to first install https://github.com/pnappa/CLImage
IF "%~1"=="" GOTO HELP
FOR /F "usebackq tokens=2* delims=: " %%W IN (`mode con ^| findstr Columns`) DO SET CONSOLE_WIDTH=%%W
SET /a modulo=%CONSOLE_WIDTH% %% 2
IF NOT [%module%] == [0] (
GOTO ODD_WIDTH
)
:RUN
climage "%~1" --unicode --truecolor --cols %CONSOLE_WIDTH%
GOTO END
:ODD_WIDTH
SET /a "CONSOLE_WIDTH=%CONSOLE_WIDTH%-1"
GOTO RUN
:HELP
ECHO Usage: header.cmd image_file
GOTO END
:END
@YUKI2eN3e
Copy link
Author

Just a silly little script to display an image across the width of your terminal.
(Use Windows Terminal not plain Command Prompt.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment