pypalex


Namepypalex JSON
Version 2.1.1 PyPI version JSON
download
home_pagehttps://github.com/AlTimofeyev/pypalex
SummaryPython Palette Extractor: extracts color palettes from images into json / yaml files.
upload_time2024-07-09 21:42:18
maintainerNone
docs_urlNone
authorAl Timofeyev
requires_python>=3.6
licenseMIT
keywords python pypalex palex color-palette colorscheme extract-colorscheme extract-palette extractor
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align=center>PyPalEx</h1>

<h3 align=center>Python Palette Extractor</h3>

<p align=center>
  <a href="https://github.com/AlTimofeyev/pypalex/releases"><img src="https://img.shields.io/github/v/release/AlTimofeyev/pypalex.svg?colorA=151515&colorB=8C977D&style=for-the-badge"></a>
  <a href="https://github.com/AlTimofeyev/pypalex/stargazers"><img src="https://img.shields.io/github/stars/AlTimofeyev/pypalex?colorA=151515&colorB=D9BC8C&style=for-the-badge"></a>
  <a href="https://github.com/AlTimofeyev/pypalex/network/members"><img src="https://img.shields.io/github/forks/AlTimofeyev/pypalex?colorA=151515&colorB=8DA3B9&style=for-the-badge"></a>
  <a href="https://github.com/AlTimofeyev/pypalex/blob/main/LICENSE"><img src="https://img.shields.io/static/v1?label=license&message=MIT&color=B66467&labelColor=151515&style=for-the-badge"></a>
</p>

<img src="https://github.com/AlTimofeyev/pypalex/blob/main/Assets/README_EXAMPLE-tsujin_bohboh-Holiday.PNG" alt="Package Example with Background Image by tsujin_bohboh on Twitter" title="Package Example with Background Image by tsujin_bohboh on Twitter" align="center">

<p align="justify">
PyPalEx is a tool for extracting color palettes from images and storing them in JSON / YAML formated files. This tool is intended to be OS independent, for use by the tech community for developing their own custom theme managers or by artists who want to extract color palettes for their art from images, pictures or wallpapers they adore.
</p>

<br>
<br>

<h2 align=center>TABLE OF CONTENTS</h2>

- [**PyPalEx Archives**](#pypalex-archives)
  - [Wiki Homepage](#wiki-homepage)
  - [Palette Examples Archive](#wiki-palette-examples-archive)
  - [Code Documentation](#code-documentation)
  - [Configuration File](#configuration-file)
- [**Dependencies**](#dependencies)
  - [Environment Variables](#environment-variables)
- [**Installation**](#installation)
  - [PIP Install](#pip-install)
  - [Manual/Git Install](#manualgit-install)
- [**User Guide**](#user-guide)
  - [Disclosure](#disclosure)
  - [Options List](#options-list)
  - [Notes](#notes)
  - [Option Usage Examples](#option-usage-examples)
- [**Feedback**](#feedback)

<br>
<br>

<h2 align=center id="pypalex-archives">PYPALEX ARCHIVES</h2>

<h3 align=center>
  [<a href="https://github.com/AlTimofeyev/pypalex/wiki" id="wiki-homepage">Wiki Homepage</a>]
  [<a href="https://github.com/AlTimofeyev/pypalex/wiki/Archive-of-Palette-Examples" id="wiki-palette-examples-archive">Palette Examples Archive</a>]
  [<a href="https://github.com/AlTimofeyev/pypalex/blob/main/pypalex_code_documentation.pdf" id="code-documentation">Codebase Documentation</a>]
  [<a href="https://github.com/AlTimofeyev/pypalex/wiki/Configuration-File" id="configuration-file">Configuration File</a>]
</h3>

<br>

<h2 align=center id="dependencies">DEPENDENCIES</h2>

Aside from Python, the rest are Python packages that are installable with pip.
- `Python 3.6+`
- `Pillow (PIL) 9.0+`
    - For performing operations on images.
- `NumPy 1.21+`
    - To manage large amounts of image data.
- `filetype 1.0+`
    - To confirm filetypes are images file types.
- `PyYAML 5.4.1+`
    - To manage YAML file types.

### ENVIRONMENT VARIABLES
There are two optional environment variables that can be set by the user:
- `PYPALEX_CACHE_DIR`
- `PYPALEX_CONFIG_DIR`

By default, PyPalEx will try to store extracted color palettes into one of three locations:
- `PYPALEX_CONFIG_DIR` 
- `XDG_CONFIG_HOME/palex` 
- `$HOME/.config/palex`

By default, PyPalEx will first try to save extracted color palettes wherever `PYPALEX_CONFIG_DIR` points to in the user's system. If the user does not set the `PYPALEX_CONFIG_DIR` environment variable, then PyPalEx will default to saving extracted color palettes wherever `XDG_CONFIG_HOME/palex` points to in the user's system. And if the `XDG_CONFIG_HOME` environment variable is not set, then PyPalEx will default to saving extracted color palettes into `$HOME/.config/palex`.  
_This default output location is, of course, overriden if PyPalEx is used with the `-o --output` option._

<br>

<h2 align=center id="installation">INSTALLATION</h2>

### PIP INSTALL
#### **System-wide install (*`sudo`*)**
```sh
pip3 install pypalex
```

#### **User install (*No `sudo`*)**
```sh
pip3 install --user pypalex

# Add local 'pip' to PATH:
# (In your .bashrc, .zshrc etc)
export PATH="${PATH}:${HOME}/.local/bin/"
```

### MANUAL/GIT INSTALL
```sh
git clone https://github.com/AlTimofeyev/pypalex
cd pypalex
pip3 install --user .

# Add local 'pip' to PATH:
# (In your .bashrc, .zshrc etc)
export PATH="${PATH}:${HOME}/.local/bin/"
```

<br>

<h2 align=center id="user-guide">USER GUIDE</h2> 

### DISCLOSURE
- PyPalEx can only work on images that are in the RBG color space, so any images that you supply to PyPalEx that are not already in RGB will automatically be converted into RGB color space before the extraction process begins.
- PyPalEx takes about ~5 seconds on average to process an image and extract color palettes.
- When using PyPalEx on a directory of images, you can calculate the time it takes to process all the images by multiplying the number of images by 5 seconds.
  - Example: You have a directory of 20 images. So the time it will take to process all the images is  
  20 x 5 = ~100 seconds

<p align=justify>
Some images may take 2-3 seconds to be processed while other images may take 4-5 seconds to be processed. But the average wait time for an image to be processed and for color palettes to be extracted is about ~5 seconds.
</p>

### OPTIONS LIST
- `-f --files`
  - Specify the absolute file path(s).
  - If used with `-p --path` option, you only need to specify the relative file path(s).
- `-p --path`
  - Specify the path from where to use images.
  - Absolute path is preferred, but relative path can also be used.
- `-o --output`
  - Specify the output path where to store the JSON color palette.
- `--save-check`
  - Asks if the user wants to save the extracted color palettes.
- `--preview`
  - Shows a preview of the extracted color palettes before saving.
- `--preview-check`
  - Shows a preview of, and asks if the user wants to save, the extracted color palettes.
- `--pastel`
  - Converts all color types into pastel.
- `--pastel-light`
  - Converts light color type into pastel.
- `--pastel-normal`
  - Converts normal color type into pastel.
- `--pastel-dark`
  - Converts dark color type into pastel.
- `-r --raw-dump`
  - Saves the raw extracted colors without organizing them into color palettes.
- `-g --gen-config`
  - Generates a default configuration file.
- `-w --where`
  - Prints where the default output locations of the configuration file and extracted color palattes are located.
  - This option will also let you know if these locations exist or not, as they are optional.
- `-v --version`
  -  Prints the PyPalEx version.

### NOTES
- When using PyPalEx, the use of either `-f --files` and/or `-p --path` is a **MUST**. Without either, or both of, these two options being specified, PyPalEx will not work.
- PyPalEx will skip over any files that are not images.
- Please note that all the `--pastel` and `--sat_pref` options only affect the 6 base colors (red, green, yellow, blue, magenta, cyan) and do **NOT** affect the background, foreground, black, and white colors.
- Please note that the user can individually select which palette to convert to pastel (do not mistake palette for "color scheme/color theme"). For more details, please refer to the PyPalEx wiki homepage to identify which "color scheme/color theme" contains the palette you wish to convert to pastel.

### OPTION USAGE EXAMPLES
For usage examples of each of the options provided, please read the Wiki Homepage :  
[https://github.com/AlTimofeyev/pypalex/wiki#option-usage-examples](https://github.com/AlTimofeyev/pypalex/wiki#option-usage-examples)

<br>

<h2 align=center id="feedback">FEEDBACK</h2>

<p align=justify>
Any and all feedback is greatly appreciated and welcomed! On the PyPalEx GitHub repository, there is a <b><a href="https://github.com/AlTimofeyev/pypalex/discussions">Discussion</a></b> post that is available for each Release version of PyPalEx and open to everyone for any comments or feedback on the version of PyPalEx you are using.
</p>

[//]: # (Include Contributions Section Later)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/AlTimofeyev/pypalex",
    "name": "pypalex",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "python, pypalex, palex, color-palette, colorscheme, extract-colorscheme, extract-palette, extractor",
    "author": "Al Timofeyev",
    "author_email": "al.timofeyev@outlook.com",
    "download_url": "https://files.pythonhosted.org/packages/fa/64/268df43f044f4ff5ed4fa2e42d35ba2d7a451573e27cd98c69fa8ea4c5c0/pypalex-2.1.1.tar.gz",
    "platform": null,
    "description": "<h1 align=center>PyPalEx</h1>\n\n<h3 align=center>Python Palette Extractor</h3>\n\n<p align=center>\n  <a href=\"https://github.com/AlTimofeyev/pypalex/releases\"><img src=\"https://img.shields.io/github/v/release/AlTimofeyev/pypalex.svg?colorA=151515&colorB=8C977D&style=for-the-badge\"></a>\n  <a href=\"https://github.com/AlTimofeyev/pypalex/stargazers\"><img src=\"https://img.shields.io/github/stars/AlTimofeyev/pypalex?colorA=151515&colorB=D9BC8C&style=for-the-badge\"></a>\n  <a href=\"https://github.com/AlTimofeyev/pypalex/network/members\"><img src=\"https://img.shields.io/github/forks/AlTimofeyev/pypalex?colorA=151515&colorB=8DA3B9&style=for-the-badge\"></a>\n  <a href=\"https://github.com/AlTimofeyev/pypalex/blob/main/LICENSE\"><img src=\"https://img.shields.io/static/v1?label=license&message=MIT&color=B66467&labelColor=151515&style=for-the-badge\"></a>\n</p>\n\n<img src=\"https://github.com/AlTimofeyev/pypalex/blob/main/Assets/README_EXAMPLE-tsujin_bohboh-Holiday.PNG\" alt=\"Package Example with Background Image by tsujin_bohboh on Twitter\" title=\"Package Example with Background Image by tsujin_bohboh on Twitter\" align=\"center\">\n\n<p align=\"justify\">\nPyPalEx is a tool for extracting color palettes from images and storing them in JSON / YAML formated files. This tool is intended to be OS independent, for use by the tech community for developing their own custom theme managers or by artists who want to extract color palettes for their art from images, pictures or wallpapers they adore.\n</p>\n\n<br>\n<br>\n\n<h2 align=center>TABLE OF CONTENTS</h2>\n\n- [**PyPalEx Archives**](#pypalex-archives)\n  - [Wiki Homepage](#wiki-homepage)\n  - [Palette Examples Archive](#wiki-palette-examples-archive)\n  - [Code Documentation](#code-documentation)\n  - [Configuration File](#configuration-file)\n- [**Dependencies**](#dependencies)\n  - [Environment Variables](#environment-variables)\n- [**Installation**](#installation)\n  - [PIP Install](#pip-install)\n  - [Manual/Git Install](#manualgit-install)\n- [**User Guide**](#user-guide)\n  - [Disclosure](#disclosure)\n  - [Options List](#options-list)\n  - [Notes](#notes)\n  - [Option Usage Examples](#option-usage-examples)\n- [**Feedback**](#feedback)\n\n<br>\n<br>\n\n<h2 align=center id=\"pypalex-archives\">PYPALEX ARCHIVES</h2>\n\n<h3 align=center>\n  [<a href=\"https://github.com/AlTimofeyev/pypalex/wiki\" id=\"wiki-homepage\">Wiki Homepage</a>]\n  [<a href=\"https://github.com/AlTimofeyev/pypalex/wiki/Archive-of-Palette-Examples\" id=\"wiki-palette-examples-archive\">Palette Examples Archive</a>]\n  [<a href=\"https://github.com/AlTimofeyev/pypalex/blob/main/pypalex_code_documentation.pdf\" id=\"code-documentation\">Codebase Documentation</a>]\n  [<a href=\"https://github.com/AlTimofeyev/pypalex/wiki/Configuration-File\" id=\"configuration-file\">Configuration File</a>]\n</h3>\n\n<br>\n\n<h2 align=center id=\"dependencies\">DEPENDENCIES</h2>\n\nAside from Python, the rest are Python packages that are installable with pip.\n- `Python 3.6+`\n- `Pillow (PIL) 9.0+`\n    - For performing operations on images.\n- `NumPy 1.21+`\n    - To manage large amounts of image data.\n- `filetype 1.0+`\n    - To confirm filetypes are images file types.\n- `PyYAML 5.4.1+`\n    - To manage YAML file types.\n\n### ENVIRONMENT VARIABLES\nThere are two optional environment variables that can be set by the user:\n- `PYPALEX_CACHE_DIR`\n- `PYPALEX_CONFIG_DIR`\n\nBy default, PyPalEx will try to store extracted color palettes into one of three locations:\n- `PYPALEX_CONFIG_DIR` \n- `XDG_CONFIG_HOME/palex` \n- `$HOME/.config/palex`\n\nBy default, PyPalEx will first try to save extracted color palettes wherever `PYPALEX_CONFIG_DIR` points to in the user's system. If the user does not set the `PYPALEX_CONFIG_DIR` environment variable, then PyPalEx will default to saving extracted color palettes wherever `XDG_CONFIG_HOME/palex` points to in the user's system. And if the `XDG_CONFIG_HOME` environment variable is not set, then PyPalEx will default to saving extracted color palettes into `$HOME/.config/palex`.  \n_This default output location is, of course, overriden if PyPalEx is used with the `-o --output` option._\n\n<br>\n\n<h2 align=center id=\"installation\">INSTALLATION</h2>\n\n### PIP INSTALL\n#### **System-wide install (*`sudo`*)**\n```sh\npip3 install pypalex\n```\n\n#### **User install (*No `sudo`*)**\n```sh\npip3 install --user pypalex\n\n# Add local 'pip' to PATH:\n# (In your .bashrc, .zshrc etc)\nexport PATH=\"${PATH}:${HOME}/.local/bin/\"\n```\n\n### MANUAL/GIT INSTALL\n```sh\ngit clone https://github.com/AlTimofeyev/pypalex\ncd pypalex\npip3 install --user .\n\n# Add local 'pip' to PATH:\n# (In your .bashrc, .zshrc etc)\nexport PATH=\"${PATH}:${HOME}/.local/bin/\"\n```\n\n<br>\n\n<h2 align=center id=\"user-guide\">USER GUIDE</h2> \n\n### DISCLOSURE\n- PyPalEx can only work on images that are in the RBG color space, so any images that you supply to PyPalEx that are not already in RGB will automatically be converted into RGB color space before the extraction process begins.\n- PyPalEx takes about ~5 seconds on average to process an image and extract color palettes.\n- When using PyPalEx on a directory of images, you can calculate the time it takes to process all the images by multiplying the number of images by 5 seconds.\n  - Example: You have a directory of 20 images. So the time it will take to process all the images is  \n  20 x 5 = ~100 seconds\n\n<p align=justify>\nSome images may take 2-3 seconds to be processed while other images may take 4-5 seconds to be processed. But the average wait time for an image to be processed and for color palettes to be extracted is about ~5 seconds.\n</p>\n\n### OPTIONS LIST\n- `-f --files`\n  - Specify the absolute file path(s).\n  - If used with `-p --path` option, you only need to specify the relative file path(s).\n- `-p --path`\n  - Specify the path from where to use images.\n  - Absolute path is preferred, but relative path can also be used.\n- `-o --output`\n  - Specify the output path where to store the JSON color palette.\n- `--save-check`\n  - Asks if the user wants to save the extracted color palettes.\n- `--preview`\n  - Shows a preview of the extracted color palettes before saving.\n- `--preview-check`\n  - Shows a preview of, and asks if the user wants to save, the extracted color palettes.\n- `--pastel`\n  - Converts all color types into pastel.\n- `--pastel-light`\n  - Converts light color type into pastel.\n- `--pastel-normal`\n  - Converts normal color type into pastel.\n- `--pastel-dark`\n  - Converts dark color type into pastel.\n- `-r --raw-dump`\n  - Saves the raw extracted colors without organizing them into color palettes.\n- `-g --gen-config`\n  - Generates a default configuration file.\n- `-w --where`\n  - Prints where the default output locations of the configuration file and extracted color palattes are located.\n  - This option will also let you know if these locations exist or not, as they are optional.\n- `-v --version`\n  -  Prints the PyPalEx version.\n\n### NOTES\n- When using PyPalEx, the use of either `-f --files` and/or `-p --path` is a **MUST**. Without either, or both of, these two options being specified, PyPalEx will not work.\n- PyPalEx will skip over any files that are not images.\n- Please note that all the `--pastel` and `--sat_pref` options only affect the 6 base colors (red, green, yellow, blue, magenta, cyan) and do **NOT** affect the background, foreground, black, and white colors.\n- Please note that the user can individually select which palette to convert to pastel (do not mistake palette for \"color scheme/color theme\"). For more details, please refer to the PyPalEx wiki homepage to identify which \"color scheme/color theme\" contains the palette you wish to convert to pastel.\n\n### OPTION USAGE EXAMPLES\nFor usage examples of each of the options provided, please read the Wiki Homepage :  \n[https://github.com/AlTimofeyev/pypalex/wiki#option-usage-examples](https://github.com/AlTimofeyev/pypalex/wiki#option-usage-examples)\n\n<br>\n\n<h2 align=center id=\"feedback\">FEEDBACK</h2>\n\n<p align=justify>\nAny and all feedback is greatly appreciated and welcomed! On the PyPalEx GitHub repository, there is a <b><a href=\"https://github.com/AlTimofeyev/pypalex/discussions\">Discussion</a></b> post that is available for each Release version of PyPalEx and open to everyone for any comments or feedback on the version of PyPalEx you are using.\n</p>\n\n[//]: # (Include Contributions Section Later)\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python Palette Extractor: extracts color palettes from images into json / yaml files.",
    "version": "2.1.1",
    "project_urls": {
        "Changelog": "https://github.com/AlTimofeyev/pypalex/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/AlTimofeyev/pypalex/blob/main/pypalex_code_documentation.pdf",
        "Download": "https://github.com/AlTimofeyev/pypalex/archive/2.1.1.tar.gz",
        "Homepage": "https://github.com/AlTimofeyev/pypalex",
        "Showcase": "https://github.com/AlTimofeyev/pypalex/wiki/Archive-of-Palette-Examples",
        "Wiki": "https://github.com/AlTimofeyev/pypalex/wiki"
    },
    "split_keywords": [
        "python",
        " pypalex",
        " palex",
        " color-palette",
        " colorscheme",
        " extract-colorscheme",
        " extract-palette",
        " extractor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "575b9736f9f3c991cec235385fd0521149c09c6495d91dda314824ff27652bb2",
                "md5": "c2f9350d9848155dc1c11ddb1f1d090a",
                "sha256": "004b0ba07bcee69183a8fdd5e94f7ee182e3f4b21f3a2bad19049fe02c6d51e4"
            },
            "downloads": -1,
            "filename": "pypalex-2.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c2f9350d9848155dc1c11ddb1f1d090a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 35516,
            "upload_time": "2024-07-09T21:42:17",
            "upload_time_iso_8601": "2024-07-09T21:42:17.647395Z",
            "url": "https://files.pythonhosted.org/packages/57/5b/9736f9f3c991cec235385fd0521149c09c6495d91dda314824ff27652bb2/pypalex-2.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa64268df43f044f4ff5ed4fa2e42d35ba2d7a451573e27cd98c69fa8ea4c5c0",
                "md5": "a1a3aa4eb9af42bb95e7a5c0e6919064",
                "sha256": "6da5e66499faa2e7d449e11869b4b6b641f38c7a69f72ac48af49a08b1556acd"
            },
            "downloads": -1,
            "filename": "pypalex-2.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a1a3aa4eb9af42bb95e7a5c0e6919064",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 35534,
            "upload_time": "2024-07-09T21:42:18",
            "upload_time_iso_8601": "2024-07-09T21:42:18.959488Z",
            "url": "https://files.pythonhosted.org/packages/fa/64/268df43f044f4ff5ed4fa2e42d35ba2d7a451573e27cd98c69fa8ea4c5c0/pypalex-2.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-09 21:42:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AlTimofeyev",
    "github_project": "pypalex",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pypalex"
}
        
Elapsed time: 4.87768s