Coder Social home page Coder Social logo

oledid-forks / convertto-jpeg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidanson/convertto-jpeg

0.0 1.0 0.0 7 KB

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

License: MIT License

PowerShell 100.00%

convertto-jpeg's Introduction

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. (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

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.

convertto-jpeg's People

Contributors

davidanson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.