Name | palettecleanse JSON |
Version |
2.0.0
JSON |
| download |
home_page | None |
Summary | palettecleanse is a python library for quick conversions of images to custom color palettes |
upload_time | 2024-10-29 18:09:12 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | The MIT License (MIT) Copyright © 2024 <Jiaming Chen> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
matplotlib
seaborn
plotly
data visualization
color map
color palette
palette
|
VCS |
|
bugtrack_url |
|
requirements |
lifelines
matplotlib
numpy
Pillow
plotly
pytest
scikit_learn
seaborn
tqdm
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# palettecleanse
`palettecleanse` is a python library for quick conversions of images to custom color palettes
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
## Installation
```pip import palettecleanse```
For manually installing requirements:
``` pip install -r requirements.txt```
To verify the installation worked, run the following code:
```py
from palettecleanse.presets import TwilightSunset
TwilightSunset.display_plotly_examples()
```
## Quickstart
To convert an image to a custom color palette, simply select an image and load it into `palettecleanse` as a `Palette` object, where desired attributes such as the number of colors (`n_colors`) can be specified as part of the class initialization. All available palettes for the image can be displayed via. the `display_all_palettes` method.
```py
from palettecleanse.palettes import Palette
# load image
vangogh = Palette('images/vangogh.jpg')
vangogh.display_all_palettes()
```
![vangogh_image](palettecleanse/images/vangogh_small.png?raw=true "Starry Night")
![vangogh_palette](palettecleanse/images/examples/vangogh_palettes.png "Vangogh palette Examples")
Specific palette types (sequential, qualitative, etc) are stored as attributes for this object and are compatible with `matplotlib`, `seaborn`, and `plotly`.
```py
# sequential palette in matplotlib
plt.scatter(x, y, c=colors, palette=vangogh.sequential)
# qualitative palette in matplotlib
plt.bar(categories, values, color=vangogh.qualitative)
# qualitative palette in seaborn
sns.swarmplot(df, x="x", y="y", hue="z", palette=vangogh.qualitative)
# generic palette in plotly
px.scatter(df, x="x", y="y", color="z", color_continuous_scale=vangogh.plotly)
```
To get a sense for how well your palette works, use the `display_example_plots` method
```py
# this creates some misc plots using your generated palettes
vangogh.display_example_plots()
# plotly equivalent
vangogh.display_plotly_examples()
```
![vangogh_example](palettecleanse/images/examples/vangogh_output.png)
`palettecleanse` also comes prepackaged with some preset palettes:
```py
from palettecleanse.presets import TwilightSunset
TwilightSunset.display_all_palettes()
```
![TwilightSunset palette](palettecleanse/images/examples/sunset_palettes.png)
See `usage.ipynb` for more examples.
## Examples
All available preset palettes can be accessed via. the `display_all_preset_palettes` method
```py
display_all_preset_palettes('sequential')
```
![Preset Sequentials](palettecleanse/images/examples/custom_sequentials.png)
Below are example plots made using via. the `display_example_plots` method that can be used to get a bird's eye view on how well a palette behaves across generic plot types
### Hokusai - The Great Wave off Kanagawa
![great_wave_example](palettecleanse/images/examples/great_wave_output.png)
### Red Rose
![red_roses_example](palettecleanse/images/examples/red_roses_output.png)
### Sunset
![sunset_example](palettecleanse/images/examples/sunset_output.png)
### Bladerunner Olive
![bladerunner_olive](palettecleanse/images/examples/bladerunner_olive_output.png)
More examples available in `usage.ipynb`.
## Contributing
Contributions at all levels are welcome! I'm happy to discuss with anyone the potential for contributions. Please see `CONTRIBUTING.md` for some general guidelines and message me with any questions!
## Meta
Jiaming Chen – jiaming.justin.chen@gmail.com
Distributed under the MIT license. See ``LICENSE.txt`` for more information.
[https://github.com/sansona/palettecleanse](https://github.com/sansona/)
Raw data
{
"_id": null,
"home_page": null,
"name": "palettecleanse",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Jiaming Chen <jiaming.justin.chen@gmail.com>",
"keywords": "matplotlib, seaborn, plotly, data visualization, color map, color palette, palette",
"author": null,
"author_email": "Jiaming Chen <jiaming.justin.chen@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/60/f9/00112ef8b585a4474a977fdb48d2e3d659853150b83ba09f86bc110f9c58/palettecleanse-2.0.0.tar.gz",
"platform": null,
"description": "# palettecleanse\n`palettecleanse` is a python library for quick conversions of images to custom color palettes\n\n [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n \n## Installation\n```pip import palettecleanse```\n\nFor manually installing requirements:\n``` pip install -r requirements.txt```\n\nTo verify the installation worked, run the following code:\n```py\nfrom palettecleanse.presets import TwilightSunset\n\nTwilightSunset.display_plotly_examples()\n```\n\n## Quickstart\nTo convert an image to a custom color palette, simply select an image and load it into `palettecleanse` as a `Palette` object, where desired attributes such as the number of colors (`n_colors`) can be specified as part of the class initialization. All available palettes for the image can be displayed via. the `display_all_palettes` method.\n```py\nfrom palettecleanse.palettes import Palette\n\n# load image\nvangogh = Palette('images/vangogh.jpg')\nvangogh.display_all_palettes()\n```\n\n![vangogh_image](palettecleanse/images/vangogh_small.png?raw=true \"Starry Night\")\n\n![vangogh_palette](palettecleanse/images/examples/vangogh_palettes.png \"Vangogh palette Examples\")\n\nSpecific palette types (sequential, qualitative, etc) are stored as attributes for this object and are compatible with `matplotlib`, `seaborn`, and `plotly`.\n```py\n# sequential palette in matplotlib\nplt.scatter(x, y, c=colors, palette=vangogh.sequential)\n\n# qualitative palette in matplotlib\nplt.bar(categories, values, color=vangogh.qualitative)\n\n# qualitative palette in seaborn\nsns.swarmplot(df, x=\"x\", y=\"y\", hue=\"z\", palette=vangogh.qualitative)\n\n# generic palette in plotly\npx.scatter(df, x=\"x\", y=\"y\", color=\"z\", color_continuous_scale=vangogh.plotly)\n```\nTo get a sense for how well your palette works, use the `display_example_plots` method\n```py\n# this creates some misc plots using your generated palettes\nvangogh.display_example_plots()\n\n# plotly equivalent\nvangogh.display_plotly_examples()\n```\n![vangogh_example](palettecleanse/images/examples/vangogh_output.png)\n\n`palettecleanse` also comes prepackaged with some preset palettes:\n```py\nfrom palettecleanse.presets import TwilightSunset\n\nTwilightSunset.display_all_palettes()\n```\n![TwilightSunset palette](palettecleanse/images/examples/sunset_palettes.png)\n\nSee `usage.ipynb` for more examples.\n\n## Examples\nAll available preset palettes can be accessed via. the `display_all_preset_palettes` method\n```py\ndisplay_all_preset_palettes('sequential')\n```\n![Preset Sequentials](palettecleanse/images/examples/custom_sequentials.png)\n\nBelow are example plots made using via. the `display_example_plots` method that can be used to get a bird's eye view on how well a palette behaves across generic plot types\n### Hokusai - The Great Wave off Kanagawa\n![great_wave_example](palettecleanse/images/examples/great_wave_output.png)\n\n### Red Rose\n![red_roses_example](palettecleanse/images/examples/red_roses_output.png)\n\n### Sunset\n![sunset_example](palettecleanse/images/examples/sunset_output.png)\n\n### Bladerunner Olive\n![bladerunner_olive](palettecleanse/images/examples/bladerunner_olive_output.png)\n\nMore examples available in `usage.ipynb`.\n\n## Contributing\nContributions at all levels are welcome! I'm happy to discuss with anyone the potential for contributions. Please see `CONTRIBUTING.md` for some general guidelines and message me with any questions!\n\n## Meta\nJiaming Chen \u2013 jiaming.justin.chen@gmail.com\n\nDistributed under the MIT license. See ``LICENSE.txt`` for more information.\n\n[https://github.com/sansona/palettecleanse](https://github.com/sansona/)\n",
"bugtrack_url": null,
"license": "The MIT License (MIT) Copyright \u00a9 2024 <Jiaming Chen> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "palettecleanse is a python library for quick conversions of images to custom color palettes",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://github.com/sansona/palettecleanse",
"Issues": "https://github.com/sansona/palettecleanse/issues"
},
"split_keywords": [
"matplotlib",
" seaborn",
" plotly",
" data visualization",
" color map",
" color palette",
" palette"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "060ae54994eb4f4c72f236f9786fc6b532425c9ffa0bdf4a1304e0f749055202",
"md5": "82f87a77d861f7e442aae7b6a43a1cb4",
"sha256": "b2eb4ddad492358d38ed79602b88179e995d9b83d3e4d94b9beaa892798af6fd"
},
"downloads": -1,
"filename": "palettecleanse-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "82f87a77d861f7e442aae7b6a43a1cb4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 14401048,
"upload_time": "2024-10-29T18:09:04",
"upload_time_iso_8601": "2024-10-29T18:09:04.680964Z",
"url": "https://files.pythonhosted.org/packages/06/0a/e54994eb4f4c72f236f9786fc6b532425c9ffa0bdf4a1304e0f749055202/palettecleanse-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "60f900112ef8b585a4474a977fdb48d2e3d659853150b83ba09f86bc110f9c58",
"md5": "866b73e02d412b651ad5073521247345",
"sha256": "b0803b66e087f084b1ec0e6824abfe041420da296e97e4886fccec0ec01f4c0a"
},
"downloads": -1,
"filename": "palettecleanse-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "866b73e02d412b651ad5073521247345",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 14403102,
"upload_time": "2024-10-29T18:09:12",
"upload_time_iso_8601": "2024-10-29T18:09:12.651211Z",
"url": "https://files.pythonhosted.org/packages/60/f9/00112ef8b585a4474a977fdb48d2e3d659853150b83ba09f86bc110f9c58/palettecleanse-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-29 18:09:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sansona",
"github_project": "palettecleanse",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "lifelines",
"specs": [
[
"==",
"0.27.8"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.7.5"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"1.24.4"
]
]
},
{
"name": "Pillow",
"specs": [
[
"==",
"10.4.0"
]
]
},
{
"name": "plotly",
"specs": [
[
"==",
"5.24.1"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"8.3.3"
]
]
},
{
"name": "scikit_learn",
"specs": [
[
"==",
"1.3.2"
]
]
},
{
"name": "seaborn",
"specs": [
[
"==",
"0.13.2"
]
]
},
{
"name": "tqdm",
"specs": [
[
"==",
"4.64.0"
]
]
}
],
"lcname": "palettecleanse"
}