r/usefulscripts • u/MadBoyEvo • Jan 03 '23
[PowerShell] Image manipulation, image resizing, image combination, QR codes, Bar codes, Charts and more
I have been inactive a little on Reddit in the last few months, but it's because I've lots of different projects that take time to make and polish correctly. By the end of the year, I've finally managed to release my PowerShell module that tries to solve people's most common needs when dealing with PowerShell images (aka pictures).
The module is called ImagePlayground here's a short list of features it currently has:
Resize Images (Resize-Image)
Convert Images between formats (ConvertTo-Image)
Combine Images (Merge-Image)
Create three types of charts (Bar, Line, Pie) in their basic form
Get Image Exif Data
Set Image Exif Data
Remove Image Exif Data
Add a watermark as a text or an image
Manipulate image
By changing the background color,
Making it black and white,
Adding bokeh blur,
Changing brightness and contrast
Cropping
Flipping
Applying Gaussian Blur or Sharpening
Making it GrayScale
Applying Hue
Making it OilPaint
Making it Pixelate
Making it look like an old Polaroid
Resize
Rotate
Rotate and Flip
Saturate
Create QR codes
Standard QR Code
WiFi QR Code
Contact QR Code
Reading QR codes
Reading Barcodes
Create Barcodes
It works on Windows, macOS, and Linux, except for Charts, which have some dependencies that are a bit harder to solve now.
I've prepared a short blog post showing how to use it, and what are the features and results:
As always, sources are available on GitHub:
- https://github.com/EvotecIT/ImagePlayground
The module has an MIT license. If you have any issues, feature requests, or ideas feel free to open an issue on Github, or if you know how to improve things - PR would be welcome :-)
To give you some ideas on how to work with it
To create a QR code:
New-ImageQRCode -Content 'https://evotec.xyz' -FilePath "$PSScriptRoot\Samples\QRCode.png"To create an Image Chart:
New-ImageChart {
New-ImageChartBar -Value 5 -Label "C#"
New-ImageChartBar -Value 12 -Label "C++"
New-ImageChartBar -Value 10 -Label "PowerShell"
} -Show -FilePath $PSScriptRoot\Samples\ChartsBar1.pngThe rest is on GitHub/blog post. I hope you enjoy this one as much as I do!
2
2
u/PythonTech Jan 03 '23
This looks awesome, I was working with imagemagick to do resizing through the command line but I'd much rather have it be a PS module.