Get-SpectreImage
Description
Displays an image in the console using CanvasImage or SixelImage if the terminal supports Sixel.
The image can be resized to a maximum width if desired.
Windows Terminal supports Sixel in the latest preview builds so it will be available in the production builds soon 🤞
See https://www.arewesixelyet.com/ for Sixel support status for your terminal.
Examples
Example 1
When Sixel is not supported the image will use the standard Canvas renderer which draws the image using character cells to represent the image.
Example 2
For Sixel images, the image returned by Get-SpectreImage
will render a new frame every time it’s drawn so if it’s an animated GIF it will appear animated if you render it repeatedly and move the cursor back to the same start position before each image output.
Parameters
ImagePath
The path to the image file to be displayed, as a local path or remote path using http/https.
Type | Required | Position | PipelineInput |
---|---|---|---|
[String] | false | 1 | false |
MaxWidth
The maximum width of the image. If not specified, the image will be displayed at its original size.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Int32] | false | 2 | false |
Format
The preferred format to use when rendering the image.
If not specified, the image will be rendered using Sixel if the terminal supports it, otherwise it will use Canvas.
Valid Values:
- Auto
- Sixel
- Canvas
Type | Required | Position | PipelineInput |
---|---|---|---|
[String] | false | 3 | false |