PyGtk Color - A couple of python scripts to select a color (for scripting usage)

Overview

PyGtk Color Selection Scripts

This repository contains two scripts to be used within a scripting project, to aquire a color value.

Both scripts

  • require python 3 and its gobject module to be installed.

  • can accept a starting color value in HTML, RGB or RGBA format (#FF00FF, rgb(255,0,255) or rgba(255,0,255,1)).

  • will ignore the transparency value of a RGBA color,

  • can accept an icon (full path to the icon file - parameter -i).

  • will print to stdout the value of the selected color in HTML format by default. RGB or RGBA output formats are also availabe (parameters -r and -a).

1. pygtk-color-chooser

The first script displays a Gtk color chooser window. Clicking the + button will open the color editor.

If the program xcolor (a lightweight color picker for X11) is installed, color picking functionality is enabled (an extra button is added to the window to this end).

The window can be localized (using the -t, -o and -c command line parameters and the LANG=xx_YY.UTF8 locale setting as shown in the image below).

pygtk-color-chooser.png

When a starting color is passed to the script, the color editor will load automatically, as shown in the image below.

pygtk-color-chooser-editor.png

As already stated, when xcolor is available a Pick a color button appears to provide the color picker functionality, as shown in the following animation.

pygtk-color-chooser-xcolor.gif

Finally, this is its help screen:

$ pygtk-color-chooser -h
usage: pygtk-color-chooser [-h] [-e] [-r] [-a] [-t TITLE] [-i ICON]
                           [-o OK_LABEL] [-c CANCEL_LABEL] [-p PICK_LABEL]
                           [color]

A Gtk Color Chooser to be used in scripts. It will print the selected color
value to stdout (will print nothing if Cancel is clicked) and terminate.

positional arguments:
  color                 Specify a default color. This can be in any of the
                        following formats: CSS name, HTML, RGB or RGBA. The
                        widget will automatically change to the color editor
                        view to display the color specified here. If the color
                        value is invalid, it will be ignored.

optional arguments:
  -h, --help            show this help message and exit
  -e, --editor          show the color editor only
  -r, --rgb             print color in rgb format instead of HTML
  -a, --rgba            print color in rgba format instead of HTML
  -t TITLE, --title TITLE
                        set window title
  -i ICON, --icon ICON  set window icon
  -o OK_LABEL, --ok-label OK_LABEL
                        set ok button label
  -c CANCEL_LABEL, --cancel-label CANCEL_LABEL
                        set cancel button label
  -p PICK_LABEL, --pick-label PICK_LABEL
                        set pick button label

2. pygtk-color-selector

The second script displays a Gtk color selector window along with a color picker widget. This is basically the main difference between the two scripts.

Another less significant difference is that the window cannot be manually localized.

The window can be seen in the following image.

pygtk-color-selector.png

Finally, this is its help screen:

$ pygtk-color-selector -h
usage: pygtk-color-selector [-h] [-r] [-a] [-i ICON] [color]

A Gtk Color Selector with Color Picker to be used in scripts. It will print
the selected color value to stdout (will print nothing if Cancel is clicked)
and terminate.

positional arguments:
  color                 Specify a default color. This can be in any of the
                        following formats: CSS name, HTML, RGB or RGBA. If the
                        color value is invalid, it will be ignored.

optional arguments:
  -h, --help            show this help message and exit
  -r, --rgb             print color in rgb format instead of HTML
  -a, --rgba            print color in rgba format instead of HTML
  -i ICON, --icon ICON  set window icon
Owner
Spiros Georgaras
Spiros Georgaras
Convert HDR photos taken by iPhone 12 (or later) to regular HDR images

heif-hdrgainmap-decode Convert HDR photos taken by iPhone 12 (or later) to regular HDR images. Installation First, make sure you have the following pa

Star Brilliant 5 Nov 13, 2022
Image manipulation package used for EpicBot.

Image manipulation package used for EpicBot.

Nirlep_5252_ 7 May 26, 2022
Extracts random colours from an image

EXTRACT COLOURS This repo contains all the project files. Project Description A Program that extracts 10 random colours from an image and saves the rg

David .K. Danso 3 Dec 13, 2021
An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C.

vizh An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C. Overview Her

Sy Brand 228 Dec 17, 2022
Multiparametric Image Analysis

Documentation The documentation is available on populse_mia's website here Installation From PyPI, for users By cloning the package, for developers Fr

Populse 9 Dec 14, 2022
A functional and efficient python implementation of the 3D version of Maxwell's equations

py-maxwell-fdfd Solving Maxwell's equations via A python implementation of the 3D curl-curl E-field equations. This code contains additional work to e

Nathan Zhao 12 Dec 11, 2022
Docbarcodes extracts 1D and 2D barcodes from scanned PDF documents or images. It can be used to automate extraction and processing of all kind of documents.

Intro Barcodes are being used in many documents or forms to enable machine reading capabilities and reduce manual processing effort. Simple 1D barcode

Arlind Nocaj 3 Jun 18, 2022
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 9.3k Dec 31, 2022
📷 Python package and CLI utility to create photo mosaics.

📷 Python package and CLI utility to create photo mosaics.

Loic Coyle 7 Oct 29, 2022
Conversion of Image, video, text into ASCII format

asciju Python package that converts image to ascii Free software: MIT license

Aju Tamang 11 Aug 22, 2022
Python-fu-cartoonify - GIMP plug-in to turn a photo into a cartoon.

python-fu-cartoonify GIMP plug-in to turn a photo into a cartoon. Preview Installation Copy python-fu-cartoonify.py into the plug-in folder listed und

Pascal Reitermann 6 Aug 05, 2022
Using P5.js, Processing and Python to create generative art

Experiments in Generative Art Using Python, Processing, and P5.js Quick Links Daily Sketches March 2021. | Gallery | Repo | Done using P5.js Genuary 2

Ram Narasimhan 33 Jul 06, 2022
A procedural Blender pipeline for photorealistic training image generation

BlenderProc2 A procedural Blender pipeline for photorealistic rendering. Documentation | Tutorials | Examples | ArXiv paper | Workshop paper Features

DLR-RM 1.8k Jan 02, 2023
Random collage/montage generator with drop-shadow

Random Collage Example Usage These are the sample input files in $PWD for the below examples: 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png 10

M B 1 Dec 07, 2021
Samila is a generative art generator written in Python

Samila is a generative art generator written in Python, Samila let's you create arts based on many thousand points. The position of every single point is calculated by a formula, which has random par

Sepand Haghighi 947 Dec 30, 2022
An executor that wraps 3D mesh models and encodes 3D content documents to d-dimension vector.

3D Mesh Encoder An Executor that receives Documents containing point sets data in its blob attribute, with shape (N, 3) and encodes it to embeddings o

Jina AI 11 Dec 14, 2022
Image-Viewer is a Windows image viewer based on Python 3.

Image-Viewer Hi! Image-Viewer is a Windows image viewer based on Python 3. Using You must download Image-Viewer.exe from the root of the repository. T

2 Apr 18, 2022
An API that renders HTML/CSS content to PNG using Chromium

html_png An API that renders HTML/CSS content to PNG using Chromium Disclaimer I am not responsible if you happen to make your own instance of this AP

10 Aug 08, 2022
NFT collection generator. Generates layered images

NFT collection generator Generates layered images, whole collections. Provides additional functionality. Repository includes three scripts generate.py

Gleb Gonchar 10 Nov 15, 2022
Typesheet is a tiny Python script for creating transparent PNG spritesheets from TrueType (.ttf) fonts.

typesheet typesheet is a tiny Python script for creating transparent PNG spritesheets from TrueType (.ttf) fonts. I made it because I couldn't find an

Grayson Chao 12 Dec 23, 2022