Skip to content

Instantly share code, notes, and snippets.

@jadeallenx
Created January 28, 2026 23:13
Show Gist options
  • Select an option

  • Save jadeallenx/eb5356ef3c7472c4e8ecf797c7ba3d7b to your computer and use it in GitHub Desktop.

Select an option

Save jadeallenx/eb5356ef3c7472c4e8ecf797c7ba3d7b to your computer and use it in GitHub Desktop.
$vips_exe_path = "C:\Users\${env:USERNAME}\Downloads\vips\vipsthumbnail.exe"
$output_path = $env:VIPS_OUTPUT_PATH ?? $null
$cli_opts = "--vips-info --linear --kernel=mks2021 --output-profile=srgb --size=752x"
$quality = 60
$q_str = "[Q=${quality}]"
Get-ChildItem -Filter *.png -Recurse | ForEach-Object {
$fn = $_.BaseName
$op_path = $output_path ?? $_.DirectoryName
$op_str = "--path={0}" -f (Join-Path $op_path "${fn}.avif${q_str}")
$cli = "${vips_exe_path} ${op_str} ${cli_opts}"
Write-Debug "$cli"
Invoke-Command $cli
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment