Coder Social home page Coder Social logo

mareklibor / pixelposh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dabeastnet/pixelposh

0.0 0.0 0.0 684 KB

PixelPoSH is a PowerShell script designed for generating random backgrounds.

License: GNU General Public License v3.0

PowerShell 100.00%

pixelposh's Introduction

Header (Generated with PixelPoSH)

PixelPoSH

PixelPoSH is a PowerShell module that generates customizable graphical backgrounds using System.Drawing in .NET. This tool allows users to create images with various graphical patterns like bubbles, concentric circles, stripes, and squares. It's perfect for quickly generating backgrounds for desktops, websites, or any project that could use a splash of color and creativity.

Features

  • Generate images with specified width and height.
  • Choose between multiple patterns: bubbles, concentric circles, stripes, and squares.
  • Add optional text to the image: this can be colored and you can specify textsize.
  • Save images to a specified path in PNG format.
  • colormind.io API integration for fetching color palettes.

Prerequisites

Before you use PixelPoSH, make sure to have PowerShell and the System.Drawing assembly loaded on your machine. This module is built on .NET and requires proper setup to function.

Installation

Download the PixelPoSH script or clone this repository to your local machine:

git clone https://github.com/dabeastnet/PixelPoSH.git

Import the module into your PowerShell session:

Import-Module ./path/to/PixelPoSH.psm1

Usage

To generate an image, you can use the New-RandomImage function with its parameters. By default, the script randomly selects one of the 4 modes: Bubble, Circle, Stripe, Square. For each mode you define yourself, it will randomly select one of the modes.

Color Palettes

The script uses the colormind.io API to fetch a random color palette. If the API is not available (for example for offline use), It will select one of the 100 included color palettes.

If you wish to update these palettes, simply run Get-StaticPalettes.ps1. This will generate a textfile at c:\temp\B64 encoded palette.txt. Use the contents of this file to update the B64 string in the PixelPoSH.psm1 file in the Get-ColorPalette subfunction.:

    function Get-ColorPalette {
...
    
        #Static list of 100 palettes
        #region B64
        $B64Palettes = "[BASE 64 ENCODED PALETTES GO HERE]" 
        #endregion B64
...
    
    }#Get-ColorPalette

Examples

Below you can find some examples:

Example images

Please see the EXAMPLES.md for some example output.

Parameters

The following are the available parameters, with it's default values:

        [int]$ImageWidth = 800,
        [int]$ImageHeight = 600,
        [string]$Path = "C:\temp\Background.png",
        [string]$Text = $null,
        [int]$TextSize = 40,                     
        [String]$TextColor = "#FFFFFF",  
        [switch]$Bubble,
        [switch]$Circle,
        [switch]$Stripe,
        [switch]$Square

Generate an image with default settings

This command creates an 800x600 image with a randomly selected pattern and saves it to C:\temp\Background.png.

New-RandomImage

Create a 1920x1080 image with a square pattern and custom text

New-RandomImage -ImageWidth 1920 -ImageHeight 1080 -Path "C:\temp\test.png" -Text "Sample Text" -Square

Generate an image with a bubble or square pattern

New-RandomImage -Bubble -Square

Create a 800x600 image with a multiline, colored custom text in size 60

New-RandomImage -Text "LOLOLOL`nPixelPoSH is 9001`nLOLOLOL" -TextSize 60 -TextColor "#AAFFFF"
# The (backtic) `n is used as a newline indicator

Multiline text

Advanced text

Here is an example to display machinename, IP and uptime on the image.

#Fetch the info
$IP = (Get-NetIPConfiguration | Where-Object { $_.IPv4DefaultGateway -ne $null -and $_.NetAdapter.Status -eq 'Up' }).IPv4Address.IPAddress
$Uptime = (get-date) - (gcim Win32_OperatingSystem).LastBootUpTime
$FormattedUptime = "{0} days, {1} hours, {2} minutes" -f $Uptime.Days, $Uptime.Hours, $Uptime.Minutes, $Uptime.Seconds

#Generate the image in a yellow text
New-RandomImage -Text "$env:COMPUTERNAME`nIP Address: $IP`nUptime: $FormattedUptime" -TextSize 30 -TextColor "#FFF500"

Multiline text

Contributing

Contributions to PixelPoSH are welcome! Please feel free to submit pull requests or create issues for bugs and feature suggestions on our GitHub repository.

License

This project is licensed under the GNU General Public License v3.0 - see the COPYING file for more details.

pixelposh's People

Contributors

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