Created
January 21, 2024 21:43
-
-
Save berberman/3dc7901237bbcb4724349ebc04d59872 to your computer and use it in GitHub Desktop.
PJSK sticker to Telegram sticker
This file contains hidden or 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
| #! /usr/bin/env -S NIXPKGS_ALLOW_UNFREE=1 nix-shell | |
| #! nix-shell -i runghc -p "haskellPackages.ghcWithPackages (p: with p; [ shake ])" imagemagick steam-run | |
| module Main where | |
| import Development.Shake | |
| import Development.Shake.FilePath | |
| main :: IO () | |
| main = shake shakeOptions $ do | |
| action $ do | |
| files <- liftIO $ getDirectoryFilesIO "." ["*.png"] | |
| need ["result/resized" </> takeBaseName f <.> "png" | f <- files] | |
| "result/*.png" %> \out -> do | |
| let src = takeBaseName out <.> "png" | |
| need [src] | |
| cmd_ | |
| Shell | |
| "steam-run" | |
| "waifu2x-ncnn-vulkan-20220728-ubuntu/waifu2x-ncnn-vulkan" | |
| "-i" | |
| (show src) | |
| "-o" | |
| (show out) | |
| "-n" | |
| "2" | |
| "-s" | |
| "2" | |
| "result/resized/*.png" %> \out -> do | |
| let src = "result" </> takeBaseName out <.> "png" | |
| need [src] | |
| cmd_ Shell "convert" (show src) "-resize \"512>\"" (show out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment