<p align="center">
<img width="200" src="https://github.com/Gabrock94/pyaesthetics/blob/master/docs/pyaesthetics_small.png?raw=True" alt="Logo">
</p>
# pyaesthetics
![GitHub release](https://img.shields.io/github/release/Gabrock94/prettywebsite.svg)
[![PyPI](https://img.shields.io/pypi/v/pyaesthetics.svg)](https://badge.fury.io/py/pyaesthetics)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pyaesthetics.svg)](https://pypi.python.org/pypi/pyaesthetics/)
[![PyPI status](https://img.shields.io/pypi/status/pyaesthetics.svg)](https://pypi.python.org/pypi/pyaesthetics/)
[![PyPI downloads](https://img.shields.io/pypi/dm/pyaesthetics.svg?label=PyPI%20downloads)](https://pypi.python.org/pypi/pyaesthetics/)
[![Downloads](https://static.pepy.tech/badge/pyaesthetics)](https://pepy.tech/project/pyaesthetics)
[![Documentation Status](https://readthedocs.org/projects/prettywebsite/badge/?version=latest)](https://prettywebsite.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://zenodo.org/badge/129248933.svg)](https://zenodo.org/badge/latestdoi/129248933)
Pyaesthetics (formlerly known as PrettyWebsite) is a python package designed to estimate visual features concerning the aesthetic appearance of a still image.
## Features
The module can estimate the following features:
- Brightness (in both the BT709 and BT601 standards)
- Contrast (RMS or Michelson contrast)
- Saturation
- Visual Complexity (either by using the weight of the image, by Quadratic Tree Decomposition, or by gradients)
- Simmetry (using Quadratic Tree Decomposition)
- Colorfulness (in both the HSV and RGB color spaces)
- Presence and number of human faces
- Color distribution (16 or 140 W3C colors, or no named colors)
- Number of images within the image
- Surface of visual and textual areas within the image
- Ratio between visual and textual areas
- Ratio between straight and curved lines
- Anisotropy
- Self-similarity (using either the ground, parent, or neighbors method)
## Installation
pyaesthetics can be installed using pip:
```bash
pip install pyaesthetics
```
### Tesseract and pytesseract
Tesseract and pytesseract are also required.
To install tesseract please visit: https://tesseract-ocr.github.io/tessdoc/Installation.html
### Updating the package
To update the package via pip, you can use:
```bash
pip install --user --upgrade pyaesthetics
```
## Example
pyaeshtetics modules can be used one at the time to estimate one specific feature, or they can be automatically called using an automated entrypoint that calls all the available modules at once.
### Example 1: one single feature (e.g. Brigthness BT601)
```python
#load only the neede functions from the specific module
from pyaesthetics.brightness import relativeluminance_bt601
from pyaeshtetics.utils import sRGB2RGB
import cv2 #to open and handle images
#define the path to a sample image
path_to_img = "/path/to/image/image.jpg"
#load the image
img = cv2.imread(path_to_img)
#convert the image to the RGB colorscheme
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = sRGB2RGB(img)
print(relativeluminance_bt601(img))
```
### Example 2: Complete analysis
```python
import pyaesthetics
#define the path to a sample image
path_to_img = "/path/to/image/image.jpg"
#perform a subset of the analysis using standard parameters
results = pyaesthetics.analysis.analyze_image(path_to_img, method="fast")
print(results)
```
Or for a faster analysis:
```python
import pyaesthetics
#define the path to a sample image
path_to_img = "/path/to/image/image.jpg"
#perform a subset of the analysis using standard parameters
results = pyaesthetics.analysis.analyze_image(path_to_img, method="complete")
print(results)
```
## Documentation
The updated documentation of pyaesthetics, its modules, as well as a getting started guide and a list of examples can be found on [Read the Docs](https://prettywebsite.readthedocs.io/en/latest/). The documentation of each release version of pyaesthetics can be accessed separately through the drop-down menu at the bottom of the left sidebar.
## Requirements
In order to work correctly, pyaesthetics requires the installation of the following packages.
- numpy
- scipy
- matplotlib
- pandas
- opencv-python
- imutils
- pytesseract
- pillow
- scikit-image
## Contacts
For questions, suggestions, or advices, you can reach out at: giulio.gabrieli@iit.it or giulio@duck.com
## Scientific Publications that used pyaesthetic
Pyaesthetics has been used in different scientific publication. The most relevant works are listed below.
### Peer-reviewed articles
- Gabrieli, G., Bornstein, M. H., Setoh, P., & Esposito, G. (2022). *Machine learning estimation of users’ implicit and explicit aesthetic judgments of web-pages*. Behaviour & Information Technology, 1-11.
- Bizzego, A., Gabrieli, G., Azhari, A., Lim, M., & Esposito, G. (2022). *Dataset of parent-child hyperscanning functional near-infrared spectroscopy recordings*. Scientific Data, 9(1), 625.
- Cianfanelli, B., Esposito, A., Spataro, P., Santirocchi, A., Cestari, V., Rossi-Arnaud, C., & Costanzi, M. (2023). *The binding of negative emotional stimuli with spatial information in working memory: A possible role for the episodic buffer*. Frontiers in Neuroscience, 17, 445.
- Music A., Maerten A., Wagemans J. (2023).*Beautification of images by generative adversarial networks*. Journal of Vision 2023;23(10):14.
- Liu, Q., Zhu, S., Zhou, X., Liu, F., Becker, B., Kendrick, K. M., & Zhao, W. (2024). Mothers and fathers show different neural synchrony with their children during shared experiences. NeuroImage, 288, 120529.
### Theses
- Gabrieli G. (2018), Using users' physiological response to predict aesthetic experience of websites, Master Degree in Human-Computer Interaction, University of Trento (Italy)
- Veldhuizen M. (2024), Analyzing the Role of Aesthetic Features in Packaging Designs on Consumer Responses: The Case of Specialty Coffee, Master Degree in Communication Science, Vrije Universiteit (Netherlands)
### Presentation
- Gabrieli, G., Scapin, G., & Esposito, G. (2022). Pyaesthetic, a python package for empirical aesthetic analysis. XXVII
Conference of the International Association of Empirical Aesthetics, Philadelphia, United States. https://giuliogabrieli.it/posters/iaea2022/
## Contribution Guidelines for pyaesthetics
We welcome contributions to the pyaesthetics project! Whether you want to help with code, documentation, or examples, your input is valuable. Here’s how you can contribute:
### How to Contribute
1. **Fork the Repository:**
- Click the "Fork" button on the top right corner of the repository page to create your own copy of the project.
2. **Clone the Repository:**
- Clone your fork to your local machine:
```bash
git clone https://github.com/your-username/pyaesthetics.git
cd pyaesthetics
```
3. **Create a Branch:**
- Create a new branch for your changes:
```bash
git checkout -b your-branch-name
```
### Types of Contributions
1. **Code Contributions:**
- **Bug Fixes:** Help us fix bugs and improve the stability of the project.
- **New Features:** Implement new features or enhance existing ones.
- **Performance Improvements:** Optimize code for better performance and efficiency.
2. **Documentation:**
- Improve existing documentation or add new sections to help users understand and use the project more effectively.
3. **Examples:**
- Create and share examples to demonstrate how to use various features of the pyaesthetics package.
### Submitting Your Contribution
1. **Commit Your Changes:**
- Make sure your commits are clear and concise. Follow good commit message practices.
```bash
git add .
git commit -m "Description of your changes"
```
2. **Push to Your Fork:**
- Push your changes to your forked repository:
```bash
git push origin your-branch-name
```
3. **Create a Pull Request:**
- Go to the original repository and click on the "New Pull Request" button.
- Select your fork and branch as the source, and the original repository and branch as the target.
- Provide a clear and descriptive title and description for your pull request.
### Code Review Process
1. **Review:**
- Your pull request will be reviewed by the maintainers. They may request changes or ask for additional information.
2. **Update:**
- Make any requested changes and update your pull request.
3. **Merge:**
- Once your pull request is approved, it will be merged into the main branch.
### Additional Notes
- Please ensure that your code follows the project's coding style and conventions. Functions should contain docstrings and follow, if possible PEP8 guidelines.
- Write tests or samples debug methods for any new features or bug fixes to ensure they work as expected.
- Be respectful and considerate in your communications and contributions.
## Sponsorship
The project has received a one-shot sponsorship for open-source projects by Gitkraken.
Raw data
{
"_id": null,
"home_page": null,
"name": "pyaesthetics",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "Image, Analysis, Aesthetic, Visual, Features, Empirical Aesthetic",
"author": "Giulio Gabrieli",
"author_email": "gack94@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/79/ed/225df2d6359153c66cf4823e4c4b827eab0f65f6a5bf845af4e9ba30980a/pyaesthetics-0.0.8.9.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <img width=\"200\" src=\"https://github.com/Gabrock94/pyaesthetics/blob/master/docs/pyaesthetics_small.png?raw=True\" alt=\"Logo\">\n</p>\n\n# pyaesthetics\n![GitHub release](https://img.shields.io/github/release/Gabrock94/prettywebsite.svg)\n[![PyPI](https://img.shields.io/pypi/v/pyaesthetics.svg)](https://badge.fury.io/py/pyaesthetics)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pyaesthetics.svg)](https://pypi.python.org/pypi/pyaesthetics/)\n[![PyPI status](https://img.shields.io/pypi/status/pyaesthetics.svg)](https://pypi.python.org/pypi/pyaesthetics/)\n[![PyPI downloads](https://img.shields.io/pypi/dm/pyaesthetics.svg?label=PyPI%20downloads)](https://pypi.python.org/pypi/pyaesthetics/)\n[![Downloads](https://static.pepy.tech/badge/pyaesthetics)](https://pepy.tech/project/pyaesthetics)\n[![Documentation Status](https://readthedocs.org/projects/prettywebsite/badge/?version=latest)](https://prettywebsite.readthedocs.io/en/latest/?badge=latest)\n[![DOI](https://zenodo.org/badge/129248933.svg)](https://zenodo.org/badge/latestdoi/129248933)\n\nPyaesthetics (formlerly known as PrettyWebsite) is a python package designed to estimate visual features concerning the aesthetic appearance of a still image.\n\n## Features\nThe module can estimate the following features:\n- Brightness (in both the BT709 and BT601 standards)\n- Contrast (RMS or Michelson contrast)\n- Saturation\n- Visual Complexity (either by using the weight of the image, by Quadratic Tree Decomposition, or by gradients)\n- Simmetry (using Quadratic Tree Decomposition)\n- Colorfulness (in both the HSV and RGB color spaces)\n- Presence and number of human faces\n- Color distribution (16 or 140 W3C colors, or no named colors)\n- Number of images within the image\n- Surface of visual and textual areas within the image\n- Ratio between visual and textual areas\n- Ratio between straight and curved lines\n- Anisotropy\n- Self-similarity (using either the ground, parent, or neighbors method)\n\n## Installation\npyaesthetics can be installed using pip:\n```bash\npip install pyaesthetics\n```\n\n### Tesseract and pytesseract\nTesseract and pytesseract are also required. \nTo install tesseract please visit: https://tesseract-ocr.github.io/tessdoc/Installation.html\n\n### Updating the package\nTo update the package via pip, you can use:\n```bash\npip install --user --upgrade pyaesthetics\n```\n\n## Example\npyaeshtetics modules can be used one at the time to estimate one specific feature, or they can be automatically called using an automated entrypoint that calls all the available modules at once. \n\n### Example 1: one single feature (e.g. Brigthness BT601)\n\n```python\n#load only the neede functions from the specific module\nfrom pyaesthetics.brightness import relativeluminance_bt601\nfrom pyaeshtetics.utils import sRGB2RGB\nimport cv2 #to open and handle images\n\n#define the path to a sample image\npath_to_img = \"/path/to/image/image.jpg\"\n\n#load the image\nimg = cv2.imread(path_to_img)\n\n#convert the image to the RGB colorscheme\nimg = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)\nimg = sRGB2RGB(img)\nprint(relativeluminance_bt601(img))\n\n```\n### Example 2: Complete analysis\n\n```python\nimport pyaesthetics\n\n#define the path to a sample image\npath_to_img = \"/path/to/image/image.jpg\"\n\n#perform a subset of the analysis using standard parameters\nresults = pyaesthetics.analysis.analyze_image(path_to_img, method=\"fast\")\nprint(results)\n\n```\nOr for a faster analysis:\n\n```python\nimport pyaesthetics\n\n#define the path to a sample image\npath_to_img = \"/path/to/image/image.jpg\"\n\n#perform a subset of the analysis using standard parameters\nresults = pyaesthetics.analysis.analyze_image(path_to_img, method=\"complete\")\nprint(results)\n```\n\n## Documentation\nThe updated documentation of pyaesthetics, its modules, as well as a getting started guide and a list of examples can be found on [Read the Docs](https://prettywebsite.readthedocs.io/en/latest/). The documentation of each release version of pyaesthetics can be accessed separately through the drop-down menu at the bottom of the left sidebar. \n\n## Requirements\nIn order to work correctly, pyaesthetics requires the installation of the following packages.\n\n- numpy\n- scipy\n- matplotlib\n- pandas\n- opencv-python\n- imutils\n- pytesseract\n- pillow\n- scikit-image\n\n## Contacts\nFor questions, suggestions, or advices, you can reach out at: giulio.gabrieli@iit.it or giulio@duck.com\n\n## Scientific Publications that used pyaesthetic\nPyaesthetics has been used in different scientific publication. The most relevant works are listed below.\n\n### Peer-reviewed articles\n- Gabrieli, G., Bornstein, M. H., Setoh, P., & Esposito, G. (2022). *Machine learning estimation of users\u2019 implicit and explicit aesthetic judgments of web-pages*. Behaviour & Information Technology, 1-11.\n- Bizzego, A., Gabrieli, G., Azhari, A., Lim, M., & Esposito, G. (2022). *Dataset of parent-child hyperscanning functional near-infrared spectroscopy recordings*. Scientific Data, 9(1), 625.\n- Cianfanelli, B., Esposito, A., Spataro, P., Santirocchi, A., Cestari, V., Rossi-Arnaud, C., & Costanzi, M. (2023). *The binding of negative emotional stimuli with spatial information in working memory: A possible role for the episodic buffer*. Frontiers in Neuroscience, 17, 445.\n- Music A., Maerten A., Wagemans J. (2023).*Beautification of images by generative adversarial networks*. Journal of Vision 2023;23(10):14.\n- Liu, Q., Zhu, S., Zhou, X., Liu, F., Becker, B., Kendrick, K. M., & Zhao, W. (2024). Mothers and fathers show different neural synchrony with their children during shared experiences. NeuroImage, 288, 120529.\n\n### Theses\n- Gabrieli G. (2018), Using users' physiological response to predict aesthetic experience of websites, Master Degree in Human-Computer Interaction, University of Trento (Italy)\n- Veldhuizen M. (2024), Analyzing the Role of Aesthetic Features in Packaging Designs on Consumer Responses: The Case of Specialty Coffee, Master Degree in Communication Science, Vrije Universiteit (Netherlands)\n\n### Presentation\n- Gabrieli, G., Scapin, G., & Esposito, G. (2022). Pyaesthetic, a python package for empirical aesthetic analysis. XXVII\nConference of the International Association of Empirical Aesthetics, Philadelphia, United States. https://giuliogabrieli.it/posters/iaea2022/\n\n## Contribution Guidelines for pyaesthetics\n\nWe welcome contributions to the pyaesthetics project! Whether you want to help with code, documentation, or examples, your input is valuable. Here\u2019s how you can contribute:\n\n### How to Contribute\n\n1. **Fork the Repository:**\n - Click the \"Fork\" button on the top right corner of the repository page to create your own copy of the project.\n\n2. **Clone the Repository:**\n - Clone your fork to your local machine:\n ```bash\n git clone https://github.com/your-username/pyaesthetics.git\n cd pyaesthetics\n ```\n\n3. **Create a Branch:**\n - Create a new branch for your changes:\n ```bash\n git checkout -b your-branch-name\n ```\n\n### Types of Contributions\n\n1. **Code Contributions:**\n - **Bug Fixes:** Help us fix bugs and improve the stability of the project.\n - **New Features:** Implement new features or enhance existing ones.\n - **Performance Improvements:** Optimize code for better performance and efficiency.\n\n2. **Documentation:**\n - Improve existing documentation or add new sections to help users understand and use the project more effectively.\n\n3. **Examples:**\n - Create and share examples to demonstrate how to use various features of the pyaesthetics package.\n\n### Submitting Your Contribution\n\n1. **Commit Your Changes:**\n - Make sure your commits are clear and concise. Follow good commit message practices.\n ```bash\n git add .\n git commit -m \"Description of your changes\"\n ```\n\n2. **Push to Your Fork:**\n - Push your changes to your forked repository:\n ```bash\n git push origin your-branch-name\n ```\n\n3. **Create a Pull Request:**\n - Go to the original repository and click on the \"New Pull Request\" button.\n - Select your fork and branch as the source, and the original repository and branch as the target.\n - Provide a clear and descriptive title and description for your pull request.\n\n### Code Review Process\n\n1. **Review:**\n - Your pull request will be reviewed by the maintainers. They may request changes or ask for additional information.\n \n2. **Update:**\n - Make any requested changes and update your pull request.\n\n3. **Merge:**\n - Once your pull request is approved, it will be merged into the main branch.\n\n### Additional Notes\n\n- Please ensure that your code follows the project's coding style and conventions. Functions should contain docstrings and follow, if possible PEP8 guidelines. \n- Write tests or samples debug methods for any new features or bug fixes to ensure they work as expected.\n- Be respectful and considerate in your communications and contributions.\n\n## Sponsorship\nThe project has received a one-shot sponsorship for open-source projects by Gitkraken. \n\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "A python package to estimate visual features about the aesthetic appearance of still images.",
"version": "0.0.8.9",
"project_urls": null,
"split_keywords": [
"image",
" analysis",
" aesthetic",
" visual",
" features",
" empirical aesthetic"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5f7c549267966c0f4f01c83da748d9faa11ef8c876bcf8096776bb98079cb39a",
"md5": "0d361c8e276d5e642cc68d36f321c8da",
"sha256": "f2c4e5c3a841284172f006635eca948f7deb7d806442f7bd3c4a28f7e99033f7"
},
"downloads": -1,
"filename": "pyaesthetics-0.0.8.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0d361c8e276d5e642cc68d36f321c8da",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 1309150,
"upload_time": "2024-09-13T08:27:26",
"upload_time_iso_8601": "2024-09-13T08:27:26.659666Z",
"url": "https://files.pythonhosted.org/packages/5f/7c/549267966c0f4f01c83da748d9faa11ef8c876bcf8096776bb98079cb39a/pyaesthetics-0.0.8.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "79ed225df2d6359153c66cf4823e4c4b827eab0f65f6a5bf845af4e9ba30980a",
"md5": "526d7f0e0374d90453939831ec9d53e5",
"sha256": "e4e5c0920a045d296da847016b6d7f5a902504214eec6be9f7d9e599c531e127"
},
"downloads": -1,
"filename": "pyaesthetics-0.0.8.9.tar.gz",
"has_sig": false,
"md5_digest": "526d7f0e0374d90453939831ec9d53e5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 1304711,
"upload_time": "2024-09-13T08:27:28",
"upload_time_iso_8601": "2024-09-13T08:27:28.420706Z",
"url": "https://files.pythonhosted.org/packages/79/ed/225df2d6359153c66cf4823e4c4b827eab0f65f6a5bf845af4e9ba30980a/pyaesthetics-0.0.8.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-13 08:27:28",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyaesthetics"
}