Forum Discussion
How do I convert iphone HEIC photos to JPEG on Windows 11?
The TiP (Totally in PowerShell) approach is the most native way to convert HEIC files to JPG on Windows 11 and Windows 10 because it doesn't rely on third-party software. Instead, it hooks directly into the Windows Imaging Component , the same engine Windows uses to generate thumbnails and power the Photos app.
How it works for heic to jpg conversion on Windows 11/10
This method uses a PowerShell loop to call the Windows Runtime (WinRT) APIs. Specifically, it uses the Windows.Graphics.Imaging namespace.
Important: This only works if you have the HEIF Image Extension and HEVC Video Extension installed from the Microsoft Store, as the script acts as a "remote control" for those codecs.
The Batch Script
You can copy and paste this into a PowerShell window (or save it as convert.ps1) to batch-convert an entire folder of images:
# 1. Load the necessary Windows Runtime assemblies
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asms = ("Windows.Storage", "Windows.Graphics", "Windows.Foundation")
foreach ($asm in $asms) {
[void][Windows.Security.Authentication.Web.WebAuthenticationBroker, $asm, ContentType=WindowsRuntime]
}
# 2. Set your source folder
$path = "C:\Users\YourName\Pictures\HEIC_Exports"
$files = Get-ChildItem -Path $path -Filter *.heic
foreach ($file in $files) {
$inputPath = $file.FullName
$outputPath = [System.IO.Path]::ChangeExtension($inputPath, ".jpg")
# Use the .NET Drawing library to save as JPEG
# This requires the HEIF/HEVC codecs to be active system-wide
try {
$img = [System.Drawing.Image]::FromFile($inputPath)
$img.Save($outputPath, [System.Drawing.Imaging.ImageFormat]::Jpeg)
$img.Dispose()
Write-Host "Successfully converted: $($file.Name)" -ForegroundColor Green
} catch {
Write-Host "Failed to convert $($file.Name). Ensure HEVC extensions are installed." -ForegroundColor Red
}
}If the script throws an error saying "Out of Memory", it's usually not a RAM issue. Make sure you've grabbed the HEVC Video Extensions from the Store to clear that up.