Created
May 22, 2024 15:38
-
-
Save icavalheiro/a427ca7a709c476d090bd2348ee1678d to your computer and use it in GitHub Desktop.
convert images in a folder to png (support most img formats)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SixLabors.ImageSharp; | |
using System.Threading.Tasks; | |
var imagesPath = @"/path/to/images/"; | |
var images = Directory.GetFiles(imagesPath); | |
Parallel.ForEach(images, imagePath => { | |
using var image = Image.Load(File.OpenRead(imagePath)); | |
image.SaveAsPng(imagePath + ".png"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment