Heic windows 10 powershell

ConvertTo-Jpeg

A PowerShell script that converts RAW (and other) image files to the widely-supported JPEG format

Overview

Many cameras — and many phones — save photos in a custom file format.
Known as RAW images, these files contain richer information than the widely-supported JPEG format allows, but they are not as widely supported by tools.
To easily view, edit, or share pictures, it can be handy to convert RAW images to the JPEG format.

ConvertTo-Jpeg.ps1 is a PowerShell script that uses the Windows.Graphics.Imaging API to create a JPEG-encoded copy of each image that is passed to it.
(The original file is not modified.)

Related

  • ConvertTo-Heic.ps1: A PowerShell script that converts image files to the efficient HEIC format

Examples

Converting Files

Passing parameters:

PS C:\T> .\ConvertTo-Jpeg.ps1 C:\T\Pictures\IMG_1234.HEIC C:\T\Pictures\IMG_5678.HEIC
C:\T\Pictures\IMG_1234.HEIC -> IMG_1234.HEIC.jpg
C:\T\Pictures\IMG_5678.HEIC -> IMG_5678.HEIC.jpg

Pipeline via dir:

PS C:\T> dir C:\T\Pictures | .\ConvertTo-Jpeg.ps1
C:\T\Pictures\IMG_1234.HEIC -> IMG_1234.HEIC.jpg
C:\T\Pictures\IMG_5678.HEIC -> IMG_5678.HEIC.jpg
C:\T\Pictures\Kitten.jpg [Already JPEG]
C:\T\Pictures\Notes.txt [Unsupported]

Pipeline via Get-ChildItem:

PS C:\T> Get-ChildItem C:\T\Pictures -Filter *.HEIC | .\ConvertTo-Jpeg.ps1
C:\T\Pictures\IMG_1234.HEIC -> IMG_1234.HEIC.jpg
C:\T\Pictures\IMG_5678.HEIC -> IMG_5678.HEIC.jpg

Renaming Files

Sometimes files have the wrong extension.
To rename JPEG-encoded files that don’t have the standard .jpg extension, use the -FixExtensionIfJpeg
switch (alias -f).
(The => in the output indicates that the file was renamed vs. converted.)

PS C:\T> dir C:\T\Pictures\*.HEIC | .\ConvertTo-Jpeg.ps1 -FixExtensionIfJpeg
C:\T\Pictures\IMG_1234 (Edited).HEIC => IMG_1234 (Edited).jpg
C:\T\Pictures\IMG_1234.HEIC -> IMG_1234.HEIC.jpg

Removing existing extensions

To remove the existing extension of a file, use the -RemoveOriginalExtension switch (alias -r).

PS C:\T> dir C:\T\Pictures\*.HEIC | .\ConvertTo-Jpeg.ps1 -RemoveOriginalExtension
C:\T\Pictures\IMG_1234.HEIC -> IMG_1234.jpg
C:\T\Pictures\IMG_5678.HEIC -> IMG_5678.jpg

Formats

Decoder Extensions
BMP Decoder .BMP .DIB .RLE
CUR Decoder .CUR
DDS Decoder .DDS
DNG Decoder .DNG
GIF Decoder .GIF
ICO Decoder .ICO .ICON
JPEG Decoder .EXIF .JFIF .JPE .JPEG .JPG
Microsoft Camera Raw Decoder .ARW .CR2 .CRW .DNG .ERF .KDC .MRW .NEF .NRW .ORF .PEF .RAF .RAW .RW2 .RWL .SR2 .SRW
Microsoft HEIF Decoder .AVCI .AVCS .HEIC .HEICS .HEIF .HEIFS
Microsoft Webp Decoder .WEBP
PNG Decoder .PNG
TIFF Decoder .TIF .TIFF
WMPhoto Decoder .JXR .WDP

HEIC/HEIF

Windows 10’s April 2018 Update (version 1803) added support for HEIC/HEIF images to the Windows.Graphics.Imaging API.
ConvertTo-Jpeg.ps1 uses the new decoder automatically if it’s available.
To enable the decoder, install the Microsoft HEIF and HEVC Media Extensions bundle (or else both of HEVC Video Extensions and HEIF Image Extensions).
Once done, the built-in Photos app (and other programs that use the Windows.Graphics.Imaging API) will be able to open HEIC/HEIF images.

WEBP

If the default support for WebP images is missing or incomplete, consider installing the Microsoft Webp Image Extensions.
As above, the built-in Photos app is a great way to verify support for WEBP images.

We show you how to view a .heic file with the native Photos app, install and uninstall the HEIC extension, and use CopyTrans to convert HEIC format files.

Table of Contents:

At this point, those reading this article will likely be all too familiar with HEIC files. Apple’s image format of choice is designed to replace the humble .jpeg, but things begin to break down when trying to open a .heic file on a Windows 10 PC. Not to worry, we’re going to show you how to open HEIC files or convert to JPG, but first, we’ll talk a little about the format itself.

What is a HEIC file and why can’t I open it?

HEIC is the container for Apple’s Hight Efficiency Image Format (HEIF). It uses more modern and advanced compression methods to allow for better image quality than JPG in a smaller file size. It’s based on the HEVC (High Efficiency Video Compression) that newer iPhones and now various other file sharing sites now utilize.

On the surface, then, HEIC sounds like a no-brainer, but the problem with any new format is adoption and competition. Due to lack of adoption, iPhones automatically convert .heic files to .jpg when sharing them with Android or Windows users, but when transferred directly from the phone or via cloud storage they’re often unopenable by default.

Instead of thumbnails, Windows 10 users will see a default image icon and will be unable to open them. Thankfully, the Windows 10 April 2018 update made it easier to open HEIC format images by linking to a HEIC extension, which we’ll show you how to get now.

Windows 10 - File Explorer - HEIC Image Files without Thumbnails

How to Open a HEIC File Natively via the Windows 10 HEIC Extension

When you try to open a HEIC file in Windows 10, Microsoft may inform you that you need to install codecs from the Windows Store to proceed. This isn’t strictly true, as you can use PowerShell (as shown below), but it is the easiest method.

  1. Get the HEIF Image Extension
     

    You can find the HEIF Image Extension download here on the Microsoft Store. Click “Get” and wait for it to download and install.

    Windows 10 - Store App - HEIF Image Extensions

  2. Check your HEIF image thumbnails
     

    Head back to the folder with your HEIC file and you should see that its image thumbnail now appears in File Explorer and also in its preview pane.

    Windows 10 - File Explorer - HEIC Image Files with Thumbnails and Preview

  3. Open a HEIC file with File Explorer
     

    You can now double-click any HEIC format file in File Explorer to open it as you would any other image. It will use the Photos app to do so.

    Windows 10 - File Explorer - HEIC Image File in Photos App

How to Uninstall the HEIF Image Extension

If your HEIC file viewer is causing issues or you want to install a third-party software, you can uninstall it via PowerShell.

  1. Open PowerShell as an admin
     

    Press “Windows + X” to open the context menu and choose “Windows PowerShell (Admin)”.

    Windows 10 - Open PowerShell (Admin)

  2. Search for the HEIF extension
     

    Check that the HEIF image extension is installed and get its package name with:

    Get-AppxPackage *HEIF* -allusers

    Note down its name and continue to the next step.

    Windows 10 - Powershell admin - check if HEIF Image Extension installed

  3. Remove the HEIC file viewer with PowerShell
     

    Type the following command and press “Enter” to remove your HEIC image extension.

    Get-AppxPackage -allusers *HEIFImageExtension* | Remove-AppxPackage

    The -allusers flag removes it for everyone on the PC.

    Windows 10 - Powershell admin - uninstall HEIF Image Extension

  4. OR automatically remove the HEIC viewer in Windows via CopyTransHEIC for Windows
     

    Alternatively, run the CopyTrans HEIC installer from its official website to remove the extension without any commands. We’ll be showing you how to install and use the third-party software in the next section.

    Windows 10 - Remove HEIF Image Extension with Copytrans installer

How to Convert HEIC to JPG with CopyTrans

Though Windows 10’s HEIC extension lets you view HEIC files painlessly, that’s only part of the struggle. What if you receive an image in the HEIC format on Windows and need to send it to other Windows users? It’s not ideal to ask them to install the extension each time, so the ability to convert HEIC to JPG in Windows 10 can be very useful.

There are a few tools to do this, including a simple webpage, but our testing has found the CopyTrans tool to be the most efficient due to its right-click context menu. It also lets you view HEIC files, replacing the Windows extension.

  1. Download and Install CopyTrans HEIC for Windows
     

    If you haven’t already, grab CopyTrans HEIC for Windows from the official site by pressing the big blue “Download” button. Double-click the .exe file to start the installer and follow its instructions to install the program.

    Windows 10 - Install CopyTrans HEIC for Windows

  2. How to convert HEIC to JPG with CopyTrans
     

    Now that CopyTrans is installed, the thumbnails of all your HEIC format images should show in File Explorer, but you’ll have to take additional action if you want to convert HEIC to JPG in Windows 10. Thankfully, you can simply select them, right-click, and choose “Convert to JPEG with CopyTrans” to initiate the process.

    Windows 10 - File Explorer

  3. Check your folder for converted files
     

    After a short period, you should see two files for each image in your folder, one larger image with the JPEG extension, and a smaller one that’s HEIC. You can keep both around or delete the original if you wish.

    Windows 10 - HEIC files and bigger converted JPG versions

How to Convert HEIC to JPG, PNG, GIF, PSD and Other Formats with Windows, macOS or on the Web

Last Updated on November 8, 2024 12:58 pm CET

Ryan Maskellhttps://ryanmaskell.co.uk

Ryan has had a passion for gaming and technology since early childhood. Fusing the skills from his Creative Writing and Publishing degree with profound technical knowledge, he enjoys covering news about Microsoft. As an avid writer, he is also working on his debut novel.

  • Стаж: 8 лет 3 месяца
  • Сообщений: 3991
  • Репутация:127[+] [-]


Столкнулся с необходимостью посмотреть картинку .HEIC
Всё, что я прочитал на просторах, мне решительно не понравилось. Решил написать инструкцию (Windows 10/11):

  • Зайти на сайт https://store.rg-adguard.net/
  • Найти по ProductID два расширения:
    9N4WGH0Z6VHQ — Microsoft.HEVCVideoExtension
    9PMMSR1CGPWG — Microsoft.HEIFImageExtension
    скачать файлы *-х64-*.appx (для платформы х64) и переименовать в HEVC.appx и HEIC.appx
  • Выполнить от Админа:

    DISM.EXE /Online /Add-ProvisionedAppxPackage /PackagePath:HEVC.appx /SkipLicense
    DISM.EXE /Online /Add-ProvisionedAppxPackage /PackagePath:HEIC.appx /SkipLicense

Образцы изображений для проверки можно взять здесь: https://filesamples.com/formats/heic
Проверить правильность установки: powershell -> Get-AppxPackage
В списке должны быть:
    Microsoft.HEIFImageExtension
    Microsoft.HEVCVideoExtension

Для тех, кому всё это сложно, сваял готовый комплект:
СкачатьАльтернативный компонент для декодирования HEIC: https://github.com/prsyahmi/wic_heic/

Последний раз редактировалось: Ander_73 (2022-11-05 09:14), всего редактировалось 1 раз

Отправлено: 16-Авг-2022 17:02
(спустя 1 час 38 минут)

    dimo70

  • Стаж: 7 лет 5 месяцев
  • Сообщений: 3795
  • Репутация:27[+] [-]
  • Откуда: BG


Ander_73, я тоже встречался недавно с этим проблемом.
Плохо что MS Store должен работать. Вот я удалил MS Apps и не срабатывает.

_________________
Подпись отключена за нарушение правил форума

Отправлено: 16-Авг-2022 17:39
(спустя 36 минут)

    Gvint64

  • Стаж: 5 лет
  • Сообщений: 621
  • Репутация:72[+] [-]


Ander_73, Ltsc — всё устанавливается — Paint картинку открывает.

Отправлено: 16-Авг-2022 17:44
(спустя 4 минуты)

    Ander_73

  • Стаж: 8 лет 3 месяца
  • Сообщений: 3991
  • Репутация:127[+] [-]


96444

Paint картинку открывает.

Я последнее время ставлю FastStone. Он себя ассоциирует сразу, а вот при открытии требует указанные в первой мессаге расширения. После их установки уже открывает без капризов.
Ну, и любой софт, по идее, уже должен без вопросов открывать.

Отправлено: 16-Авг-2022 17:48
(спустя 3 минуты)

    Gvint64

  • Стаж: 5 лет
  • Сообщений: 621
  • Репутация:72[+] [-]


Ander_73, Ну вроде Paint как бы штатная прога — а так да FastStone с большими возможностями.

Отправлено: 16-Авг-2022 17:51
(спустя 2 минуты)

    dimo70

  • Стаж: 7 лет 5 месяцев
  • Сообщений: 3795
  • Репутация:27[+] [-]
  • Откуда: BG


Ander_73, Gvint64, ковырялся в сети и вот чего нашел — ImageGlass.exe. Перепаковал, проверил, сразу открывает. Плюс что не нуждается майковского стора. У меня XNView не открывает.

_________________
Подпись отключена за нарушение правил форума

Отправлено: 17-Авг-2022 11:02
(спустя 17 часов)

    Ander_73

  • Стаж: 8 лет 3 месяца
  • Сообщений: 3991
  • Репутация:127[+] [-]


Попробовал интеграцию (вдруг Сергей спросит! )
Интеграция в установочный образ проходит успешно.
Интеграция в заливку капризничает: уже выполнен вход пользователя и поэтому фик вам…

Похоже, для Win11 это не надо. В моём 22621 эти расширения уже есть «искаропки».

Отправлено: 17-Авг-2022 19:40
(спустя 8 часов)

    dimo70

  • Стаж: 7 лет 5 месяцев
  • Сообщений: 3795
  • Репутация:27[+] [-]
  • Откуда: BG


22621 дома установил, на 10-ку уже не вернусь.

_________________
Подпись отключена за нарушение правил форума

Отправлено: 17-Авг-2022 21:31
(спустя 1 час 50 минут)

    Ander_73

  • Стаж: 8 лет 3 месяца
  • Сообщений: 3991
  • Репутация:127[+] [-]


Нашёл интересный, но неприятный момент: при первом открытии картинки ПК должен быть в Инете, иначе пишет: «Не могу открыть файл». То ли докачивает чего, то ли регистрирует кодек у БигБосса…

Отправлено: 17-Авг-2022 21:54
(спустя 23 минуты)

Отправлено: 17-Авг-2022 21:58
(спустя 4 минуты)

    Ander_73

  • Стаж: 8 лет 3 месяца
  • Сообщений: 3991
  • Репутация:127[+] [-]


JuraAD, какое отношение это всё имеет к моей теме? Я ставлю в систему стандартные кодеки МС, после чего любое приложение может оперировать файлами .heic

Есть отличное приложение https://www.copytrans.net/copytransheic/ но у меня не получилось автоматизировать установку. Плюс доп.мусор в контекстном меню и системе.

Отправлено: 18-Авг-2022 18:52
(спустя 20 часов)

    dimo70

  • Стаж: 7 лет 5 месяцев
  • Сообщений: 3795
  • Репутация:27[+] [-]
  • Откуда: BG


Ander_73, ImageGlass пробовал?

_________________
Подпись отключена за нарушение правил форума

Like most people, I take lots of photos.
Like many people, I save them in the highest-quality format (often RAW).
Like some people, I edit those pictures on a desktop computer.

Support for RAW images has gotten better over the years, but there are still many tools and programs that do not support these bespoke formats.
So it’s handy to have a quick and easy way to convert such photos into a widely-supported format like JPEG.
There are many tools to do so, but it’s hard to beat a command line script for simplicity and ease of use.

I didn’t know of one that met my criteria, so I wrote a PowerShell script:

ConvertTo-Jpeg
A PowerShell script that converts RAW (and other) image files to the widely-supported JPEG format

Notes:

  • This script uses the Windows.Graphics.Imaging API to decode and encode.
    That API supports a variety of file formats and when new formats are added to the list, they are automatically recognized by the script.
    Because the underlying implementation is maintained by the Windows team, it is fast and secure.

    • As it happens, support for a new format showed up in the days since I wrote this script: Windows 10’s April 2018 Update added support for HEIC/HEIF images such as those created by iPhones running iOS 11.
  • The Windows.Graphics.Imaging API is intended for use by Universal Windows Platform (UWP) applications, but I am using it from PowerShell.
    This is unfortunately harder than it should be, but allowed me to release a single script file which anybody can read and audit.

    • Transparency is not a goal for everyone, but it’s important to me — especially in today’s environment where malware is so prevalent.
      I don’t trust random code on the Internet, so I prefer to use — and create — open implementations when possible.
  • The choice of PowerShell had some drawbacks.
    For one, it is not a language I work with often, so I spent more time looking things up than I normally do.
    For another, it’s clear that interoperating with UWP APIs is not a core scenario for PowerShell.
    In particular, calling asynchronous methods is tricky, and I did a lot of searching before I found a solution I liked: Using WinRT’s IAsyncOperation in PowerShell.
  • There are some obvious improvements that could be made, but I deliberately started simple and will add features if/when the need arises.

HEIC (High-Efficiency Image Container) is a modern image format commonly used by Apple devices to save space without compromising image quality. However, not all Windows applications and devices natively support HEIC files, making it necessary to convert them to a more universally compatible format like JPG.

This guide covers various methods for converting HEIC to JPG on Windows, including built-in features, online tools, and free software solutions.


  1. Compatibility: JPG files are widely supported across platforms and applications.
  2. Ease of Sharing: Ensure your images can be opened on all devices without additional software.
  3. Editing and Printing: Many editing tools and printers work better with JPG files.

Method 1: Using the Photos App on Windows

Windows 10 and 11 support HEIC files with the optional HEIF Image Extensions.

Step 1: Install HEIF and HEVC Extensions

  1. Open the Microsoft Store.
  2. Search for HEIF Image Extensions and HEVC Video Extensions.
  3. Install these extensions to enable HEIC support in Windows.

Step 2: Convert HEIC to JPG in the Photos App

  1. Open the HEIC file in the Photos app.
  2. Click the menu (three dots) at the top-right corner.
  3. Select Save As and choose JPG as the file format.
  4. Save the file in your desired location.

Several websites allow you to upload HEIC files and convert them to JPG without installing software.

Recommended Online Tools

  1. HEICtoJPG.com:
    – Visit HEICtoJPG.com.
    – Drag and drop your HEIC files into the converter.
    – Download the converted JPG files.
  2. CloudConvert:
    – Visit CloudConvert.
    – Upload your HEIC files, select JPG as the output format, and start the conversion.

Note: Be cautious about uploading sensitive images to online services.


Method 3: Use Free Software

If you prefer offline solutions, use free software for batch conversions.

IrfanView

  1. Download IrfanView: Visit IrfanView’s official website and install the software.
  2. Install Plugins: Download the IrfanView plugin pack for extended file format support.
  3. Convert HEIC to JPG:
    – Open the HEIC file in IrfanView.
    – Go to File > Save As and select JPG as the format.
    – Save the file.

CopyTrans HEIC for Windows

  1. Download CopyTrans HEIC: Visit CopyTrans and install the plugin.
  2. Convert HEIC to JPG:
    – Right-click any HEIC file and select Convert to JPEG with CopyTrans.
    – The converted file will be saved in the same location.

Method 4: Using PowerShell

Advanced users can use PowerShell scripts to convert HEIC to JPG if ImageMagick is installed.

  1. Install ImageMagick:
    – Download ImageMagick from ImageMagick.org.
  2. Run the Conversion Command:
    powershell
    magick convert input.heic output.jpg
  3. Replace input.heic with the source file name and output.jpg with the desired output file name.

Comparison of Methods

Method Ease of Use Best For
Photos App Easy Quick single-file conversion
Online Tools Moderate Lightweight, no installation required
Free Software Easy Batch conversions and offline use
PowerShell + ImageMagick Advanced Automation and scripting

Pro Tips for Converting HEIC to JPG

  1. Batch Processing: Use tools like IrfanView or CopyTrans HEIC to convert multiple files at once.
  2. Preserve Quality: Adjust JPG quality settings in the converter to minimize compression artifacts.
  3. Backup Files: Keep a copy of your original HEIC files in case you need them later.

FAQs

Can I Convert HEIC to JPG Without Additional Software?

Yes, the Photos app on Windows can do this if you have the HEIF Image Extensions installed.

Does Converting HEIC to JPG Reduce Quality?

JPG is a compressed format, so there may be some loss of quality. Use high-quality conversion settings to minimize this.

Are Online Converters Safe?

Most reputable online converters are secure, but avoid uploading sensitive images to protect your privacy.


Conclusion

Converting HEIC to JPG on Windows is simple and can be done using built-in tools, online converters, or free software. Whether you need to convert a single file or process batches of images, there’s a solution for you.

Try these methods today and enjoy seamless compatibility with all your devices and applications!

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Syslog где лежит windows
  • Управление глазами windows 11
  • Kyocera ecosys p2335dn драйвер windows 7 x64
  • Пропала папка documents and settings в windows xp
  • Ошибка 80004005 windows 10 при копировании