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
Command line utility for converting images to seamless tiles

img2texture Command line utility for converting images to seamless tiles. The resulting tiles can be used as textures in games, compositing and 3D mod

Artёm IG 24 Dec 26, 2022
3D Reconstruction Software

Meshroom is a free, open-source 3D Reconstruction Software based on the AliceVision Photogrammetric Computer Vision framework. Learn more details abou

AliceVision 8.7k Jan 02, 2023
kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns

kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns. The library builds on the

pyxem 53 Dec 29, 2022
PyGram Instagram-like image filters.

PyGram Instagram-like image filters. Usage First, import the client: from filters import * Instanciate a filter and apply it: f = Nashville("image.jp

Ajay Kumar Nagaraj 102 Feb 21, 2022
Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.

django-image-cropping django-image-cropping is an app for cropping uploaded images via Django's admin backend using Jcrop. Screenshot: django-image-cr

Jonas und der Wolf GmbH 546 Jan 03, 2023
🎶😤 Generate an image indicating what you are listening to 😳

I'm Listening to This (song that I've sent you an image about detailing its metadata in a nifty way) Few lines describing your project. 📝 Table of Co

Connor B - Viibrant 4 Nov 03, 2021
ImageStrike是一款用于CTF中图片隐写的综合利用工具

🎈 简介 ImageStrike是一款使用PyQT5开发,用于CTF中图片隐写的综合利用工具

zR00t1 133 Dec 27, 2022
A ray tracing render implemented using Taichi language.

A ray tracing render implemented using Taichi language.

Mingrui Zhang 45 Oct 23, 2022
A simple programme for converting url into a qr code (.png file)

QrTk A simple lightweight programme for converting url into a qr code (.png file) Pre-Requisites Before installing the programme , you need to run the

Juss Patel 4 Nov 08, 2021
SALaD (Semi-Automatic Landslide Detection) is a landslide mapping system

SALaD (Semi-Automatic Landslide Detection) is a landslide mapping system. SALaD utilizes Object-based Image Analysis and Random Forest to map landslides.

NASA 14 Jan 04, 2023
image-processing exercises.

image_processing Assignment 21 Checkered Board Create a chess table using numpy and opencv. view: Color Correction Reverse black and white colors with

Benyamin Zojaji 25 Dec 15, 2022
MaryJane is a simple MJPEG server written in Python.

MaryJane is a simple MJPEG server written in Python.

bootrino 152 Dec 13, 2022
A Robust Avatar Generator with a huge number of templates

CoolAvatars Welcome to this repository of CoolAvatars. Using this project, you can generate cool avatars not only from the samples present in my image

RAVI PRAKASH 5 Oct 12, 2021
BeeRef — A Simple Reference Image Viewer

BeeRef — A Simple Reference Image Viewer BeeRef lets you quickly arrange your reference images and view them while you create. Its minimal interface i

Rebecca 245 Dec 25, 2022
HCaptcha solver using requests and an image recognition package!

HCaptcha solver using requests and an image recognition package! Report Bug · Request Feature Features Image recognition Requests base

dropout 6 Oct 22, 2021
Me cleaner - Tool for partial deblobbing of Intel ME/TXE firmware images

me_cleaner me_cleaner is a Python script able to modify an Intel ME firmware image with the final purpose of reducing its ability to interact with the

Nicola Corna 4.1k Jan 08, 2023
This script is for photographers to do timeslice with one click.

One Click TimeSlice Tool What is this for This is for photographers who want to create TimeSlice pictures without installing PS plugins. Before using

Xi Zhao 13 Sep 23, 2022
Image enhancing model for making a blurred image to be somehow clearer than before

This is a very small prject which helps in enhancing the images by taking a Input images. This project has many features like detcting the faces and enhaning the faces itself and also a feature which

3 Dec 03, 2021
The aim is to extract timeseries water level 2D information for any designed boundaries within the EasyGSH model domain

bct_file_generator_for_EasyGSH The aim is to extract timeseries water level 2D information for any designed boundaries within the EasyGSH model domain

Clayton Soares 1 Jul 08, 2022
A 3D structural engineering finite element library for Python.

An easy to use elastic 3D structural engineering finite element analysis library for Python.

Craig 220 Dec 27, 2022