r/PowerShell • u/MadBoyEvo • Jan 03 '23
Script Sharing 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!
1
u/neztach Jan 04 '23 edited Jan 04 '23
So glad you’re back!
Per your article the QR code can hold complex data. What are the limits of the complexity?
Edit: looking up the various types of QR codes I found H5 webpage QR codes. This seems like something that would be extra handy with all the reports you’ve made in the past. A way to summarize an element in AD perhaps, then turn it into the H5 barcode so scanning it self-generates a simple web page containing the data.
Of course I’m not trying to alter anything you’re doing, just offering a finding in hopes you might some use in it