A small image to color value listing utility.
Easily extract colors from a image. Options include to vary the amount of colors extracted, export to text or HTML, as well as saving selected colors into a palette that can also be exported.
- Please review "Common System Requirements" and "Critical System Requirements" sections below for basic and critical requirements to run this script successfully.
- Save the cImage.sh file to a directory.
- Make the cImage.sh script executable by running the following command in the same directory as the cImage.sh file:
chmod +x cImage.sh
- Extract colors from a image file.
- View the image file that is loaded for color extraction.
- Change the amount of colors extracted from a image file.
- Choose to extract all colors, or specifically light or dark colors.
- Sort extracted colors by hexadecimal or RGB values.
- Export extracted colors to a text file or HTML file.
- Save any color extracted to a color palette.
- Extract saved color palette to a text file or HTML file.
- Use image statistics in basic or detail views.
- Change theme to system provided or custom.
- Use the 'F1' key for documentation from any main window.
Opening the cImage script, the first item to do will be to load a image file. Click inside the field for "Image" and browse your local storage device for a image file. Once a image file is loaded, click on the "View" option to view the image loaded. Select the option for "Extract" to extract colors from the loaded image. Inside the "cImage Extract" window select options for the amount of colors to extract and select color frequency of "All Colors", "Light Colors" or "Dark Colors". Select "Extract Colors" to have a list of colors appear that have been extracted from the selected image. More details on options and selections are listed below.
When opening cImage, you will have the following options from the main menu:
- Image: Clicking inside this field will allow you to browse for a file to extract colors from.
- View: Opens the selected image for viewing.
- Extract: Options to extract color from the selected image. Extract in greater detail listed below in the section "Extract Colors".
- Results: Opens the results of the color extract window. This can only be opened if a color extract was performed.
- Palette: Opens the "cImage Palette" window showing colors selected and saved.
- Stats: Opens the basic image stats window that contains a option for viewing all image stats.
- Options: Options will allow you to select a theme for cImage.
- Exit: Closes all menus and windows related to the cImage script.
Views the selected image from the main menu. Options are as follows:
- Open Image: This option allows the user to select a different image to view and process.
- Close: Closes the image view window.
Provides options on extracting colors from the selected image:
- Number of Colors: Select or type in the amount of colors to be extracted from the selected image file. The larger the number, the more colors extracted from the image.
- Color Frequency: Select from "All Colors" to extract all colors from the image. The option "Light Colors" will only extract lighter colors from the selected image. The option for "Dark Colors" will only extract darker colors from the selected image.
- Close: Closes the color extraction window.
After choosing to extract colors from a image, a results window will appear with the following options:
- Double Click: A double click on listed color to save the color to the color palette. A message will apear stating that the selected color was saved to the color palette.
- Sort: Sort the color listing by double clicking on a column header by hexadecimal or RGB.
- Export as Text: Allows to export the extracted color listing to a text file on local storage device.
- Export as HTML: Allows to export the extracted color listing to a HTML file on local storage device.
- Close: Closes the "cImage Result" window.
Displays selected colors from the color extraction list window:
- Refresh: Updates the color palette window showing any changes.
- Export as HTML: Exports the color palette window to a HTML file that can be saved.
- Export as Text: Exports the color palette window to a text file that can be saved.
- Clear Palette: Clears the color palette window of all saved colors.
Displays basic image file statistics for reference. Options are as follows:
- All Stats: Opens a window showing all image statistics in detail.
- Close: Closes the file statistics window.
Displays detailed image file statistics for reference. Options are as follows:
- Save As: Save detailed image statistics as a text file on your local storage device.
- Edit Stats: Opens the detailed image statistics in default text editor for editing.
- Close: Closes the detailed file statistics window.
The "Theme" main menu option allows the user to change settings for the theme being used, as well as access to "Help" and "About" options:
- Load Theme: Allows the user to browse their system for a theme to use.
- Apply Loaded Theme: Applies the loaded theme. Once selected the Options window will close and re-open showing the theme selected in use.
- Mode: Select basic system theme available in the system for "Light Theme" or "Dark Theme". This default uses the "Breeze" theme package located in the "/usr/share/themes/" folder.
- Apply System Theme: Applies the Mode selected for either "Light Theme" or "Dark Theme". Once selected the Options window will close and re-open showing the theme selected in use.
- Browse Themes Folder: Browse the default themes folder "/usr/share/themes/".
- Help: Opens mRunner help documentation.
- About: Opens the about window showing script credits.
- Close: Closes the "Options" window.
- cImage can be ran from any directory.
- cImage uses the /tmp/ folder for temporary and .ini files.
- Use the 'F1' key for documentation from any main window.
- The temporary files "/tmp/cImagePalette.txt" and "/tmp/cImage-Export.txt" are not removed on exit to preserve color palette and HTML export.
Save the following as a file named "cImage.desktop" in creating a shortcut to this utility. Update the path for "Exec" to where the script is stored:
[Desktop Entry]
Name=cImage
GenericName=cImage
Comment=A small image to color value listing utiliy.
Exec=/PathToScript/cImage.sh
Type=Application
Icon=gtk-select-color
Terminal=false
Common shell commands found in most Linux installations are used to provide system functionalilty for this and other scripts shared from this profile. For thoroughness, these common shell commands are listed in alphabetical order with version and man page link for review: https://github.com/rweckert/cImage/blob/6bee84ee688c49c13131fcc7ca01f0926b80cd3b/README-Basic-Requirements.md
Packages listed below provide the core ingredients for graphic display and desired output that enables cImage deliver output and are critical for successful execution of the the script:
Package | Version | Notes |
---|---|---|
yad | 14.0+ (GTK+ 3.24.41) | A tool for developing graphical user interfaces in Linux and is used by this script to generate menus and dialog windows, is written by Victor Ananjevsky. Download: https://github.com/v1cont/yad Setup: Step by step instructions are available for either Linux or Microsoft Windows Subsystem for Linux (WSL) using a Debian base: https://github.com/rweckert/yad-14.0-Setup-From-Scratch |
convert | ImageMagick 6.9.12-98 | The convert-im6.q16 program is a member of the ImageMagick-ims6.q16 suite of tools. More information regarding this package can be found at: https://www.imagemagick.org/script/convert.php |
Script interface written by: Robert W. Eckert - rweckert@gmail.com Please feel free to email to submit bugs, changes or requests. This script comes with absolutely no warranty. See the link for the GNU General Public License, version 3 or later listed below for further details.
Project Page:
https://github.com/rweckert/cImage
Source File:
https://github.com/rweckert/cImage/blob/e3d411394b61fa4bb2371f546556f9923e48ea0f/cImage.sh
Documentation File:
https://github.com/rweckert/cImage/blob/e3d411394b61fa4bb2371f546556f9923e48ea0f/README.md
Project Screenshot:
https://github.com/rweckert/cImage/blob/e3d411394b61fa4bb2371f546556f9923e48ea0f/screenshot-cImage.jpg
GitHub Profile Page:
https://github.com/rweckert