Pages

qPixelHunter 1.0


Download

qPixelHunter 1.0 is a color picker written for PyQt4 and Python 2.7. It runs on Linux and any other supported platforms.

About

 

I was a bit disappointed that on Linux there was no color picker that I liked. Gcolor2 is too basic. Gpick is too weird. Most of the times I used ColorPic 4.1 in Wine but since my Lubuntu Utopic Unicorn 14.10 is running on a USB stick, Wine doesn't seem to be a very good solution, either. Besides, sometimes I use Povray to make graphics and ColorPic 4.1 has no RGB float format. I had to divide everything by 255 and that was annoying, too. I needed something simple to quickly fire up, find the right pixel and get its color. That's why I created qPixelHunter 1.0.

Features

  1. Color code support:
  • Float rgb for Povray code.
  • Decimal RGB (Red, Green and Blue) for CSS.
  • Hexadecimal for XHTML and HTML.
  1. Magnifier to pick the exact pixel.
  2. Automatic palettes generator.
  3. Creating and editing new and picked colors.
  4. Notes for commenting.
  5. Saving picked colors and palettes into a file.
  6. Exporting to HTML and CSV.

 

Installation

 

qPixelHunter 1.0 doesn't need an installation but requires pyqt4 and pyqtgraph modules as dependencies. Install pyqt4 and pyqtgraph, unpack qpixelhunter1.0.tar.gz, change directory and run from the terminal:
~$: ./qpixelhunter.py    or
~$: python qpixelhunter.py  
If dependencies are met qPixelHunter 1.0 will start right away. If not, install required packages.

Download

 

Ubuntu and Debian

sudo apt-get install python-qt4 python-pyqtgraph

ArchLinux


On ArchLinux default Python 3 is incompatible with Python 2 scripts but Python 2.7 is also installed. It's executable is /usr/bin/python2.7.
sudo pacman -S python2-pyqt4
packer python2-pyqtgraph 
Open file qpixelhunter.py in a text editor and change Lines 1 and 10 to look like this:

Change from:
1.   #!/usr/bin/python to #!/usr/bin/python2.7
10.  python='python'to python='/usr/bin/python2.7'

Path to the executable is required by the zoom.py module. Zoom is a separated program that won't start from within qPixelHunter 1.0 otherwise. By default qPixelHunter 1.0 assumes that python is in the system path variable and doesn't make a fuss about it, but if you have a weird name for its executable or a weird location for its installation, you'd better do some editing the way I told.


Windows XP


On a 32-bit Windows you will need Python 2.7, Qt4, PyQt4, PyQtGraph and since Zoom uses Cairo module for drawing palettes, GTK-2 Runtime as well. The easiest way to get almost everything is to install WinPython.

  1. Download WinPython-32bit-2.7.6.4.exe from here, double-click it to unpack and move to a preferable location. Then run WinPython Control Panel.exe and register the installation. Go to the Menu Advanced and click register installation.
  2. Download pyqtgraph-0.9.8.win32.exe from here and install it by double-clicking or via WinPython Control Panel.
  3. Install gtk2-runtime-2.24.10-2012-10-10-ash.exe from here.
  4. Make sure that System Path is OK.
  1. Right-click My Computer, and then click Properties.
  2. Click the Advanced tab.
  3. Click Environment variables.
  4. In System variables scroll down to Path and press Edit.

WinPython's path should look like this:

C:\WINPYTHON-32BIT-2.7.6.4\PYTHON-2.7.6;C:\WINPYTHON-32BIT-2.7.6.4\PYTHON-2.7.6\DLLs;C:\WINPYTHON-32BIT-2.7.6.4\PYTHON-2.7.6\LIB;C:\WINPYTHON-32BIT-2.7.6.4\PYTHON-2.7.6\LIB\LIB-TK

GTK2-Runtime 's path should look like this:

C:\Program Files\GTK2-Runtime\bin

  1.  Download pycairo-1.8.10.win32-py2.7.msi here and install it choosing Python from registry (it should be the one from the WinPython installation).
  2. Reboot if needed.

Usage


Start qPixelHunter 1.0. Place it in the corner of the screen.

G key - (and Grab button) activates the Grabber.
G key - second time picks the color and generates a palette where the color is divided by saturation and the picked one is outlined.
F key - (and Edit menu > Cancel Grab) deactivates the Grabber. It takes a Snapshot but doesn't extract the color of the pixel.
N key - (and Edit menu > New Color) adds a new color.

The color rectangles in the Color Column are actually Color Buttons. Clicking on them will bring a color dialog where you can modify the color values.

View menu provides various formats: RGB floats, RGB decimal and Hex. The formats are also accessible from the context menu by right clicking in the Color Column.

Copy (Ctrl+C, Edit menu > Copy or right click > Copy) copies to clipboard values of selected colors.

Delete (Edit menu > Delete, Del key or right click > Delete) deletes lines in the Color Column. By default 1000 slots are available. I think it's more than enough but if you feel like increasing or reducing their amount run the make_lines.py script in the qpixelhunter directory. There you can specify the exact amount of colors you want to keep.

Tools menu provides Palette operations.
  1. Rip Snapshot extracts pixels colors from the taken Snapshot.
  2. Random generates random colors.
  3. Pastel is like Random but colors are saturated.
  4. Gradient 1 makes a gradient with extracted from the Snapshot colors.
  5. Gradient 2 is like Gradient 1 only colors are filtered and 50% desaturated.
  6. Gradient 3 makes a gradient with selected colors from the Color Column.
  7. Extract Colors put colors from the snapshot line by line to the Color Column.
  8. Zoom (Z key) enlarges an image from the Palette panel.

In actuality Zoom doesn't zoom anything but redraws values at a bigger dimension. qPixelHunter 1.0 uses Cairo that provides scalable vector graphic capabilities that preserves an impression while keeping the expression and pixel grid doesn't distort. qPixelHunter 1.0 calls zoom.py script which remakes the Palette. If your Python installation doesn't have python executable in the System Path, Zoom won't work. In this case you have to edit the script. Open the qpixelhunter.py file in a text editor and change Lines 1 and 10 to look somewhat like this, depending on your Python location:

Change from:
1.   #!/usr/bin/python to #!/usr/bin/python2.7
10.  python='python' to python='/usr/bin/python2.7' 
See also ArchLinux Installation Section.


You can save zoomed Palette at 480x480 size. However, if you Export Palette (Export menu > Save Palette) it will be saved at 1000x1000 size.

File menu provides common file operation.

That's basically it. If you find any bugs let me know with the description of the steps you did. Thanks for your time and consideration.



GNU General Public License
Copyright © 2014