Powershell: Get Image Size 📜

By Xah Lee. Date: . Last updated: .
# 2024-11-22

# get image width and height

# Load the System.Drawing assembly
Add-Type -AssemblyName System.Drawing;

$image = [System.Drawing.Image]::FromFile("c:/Users/xah/web/xahlee_info/kbd/ikeypad/svalboard_2024-02-25_156-s33-s250.jpg")

Write-Output "$($image.Width) $($image.Height)"

# Dispose of the image to free resources
# $image.Dispose()

Get Image Width Height