# Computer Science Education - Image Processing Module and Visualization of Distributions
![Image Description](https://raw.githubusercontent.com/henningmattes/diverse/main/csedu_package_img_small.png)
## Description
This project consists of two modules for computer science education:
- **Image Processing**: A module for simple editing and analysis of images. It allows loading, saving, and displaying images, calculating color depths, and converting palette-based images to RGB.
- **Visualization of Distributions**: A module for visualizing two distributions side by side as line or bar charts. Ideal for presenting statistical data in educational settings.
## Modules
### imageprocessing
This module provides functions for simple processing and analysis of images. The main functions are:
- `load_image(path_and_filename)`: Loads an image and calculates its color depth.
- `transform_palette_image_to_rgb(np_image_array, palette)`: Transforms a palette-based image into an RGB image.
- `pillow_image(numpy_array, palette=None)`: Converts a NumPy array into a Pillow image.
- `save_image(path, np_image_array, palette=None)`: Saves an image to a file.
- `show(image_data, show_axes=True, label_data=None, palette_data=None, show_grid=False, grid_color='black', number_of_ticks=None, number_of_columns=1, figsize=None)`: Displays images in a plot.
- `plot_histogram(histogram, palette='inferno')`: Plots a histogram of the brightness values of an image.
### diagrams
This module provides a simple way to visualize two distributions. The main function is:
- `show_distributions(distribution1, distribution2, title1="", title2="", mode="Lines")`: Visualizes two distributions as line or bar charts.
## Example Usage
### Image Processing
```python
from imageprocessing import load_image, show, save_image
# Load image and calculate color depth
image, color_mode, color_depth, palette = load_image('path/to/image.png')
print(f"Color depth: {color_depth} Bit")
# Display image
show(image)
# Save image
save_image('path/to/output_image.png', image, palette)
```
## License
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT) with additional terms for attribution. See the [LICENSE](https://raw.githubusercontent.com/henningmattes/diverse/main/LICENSE.txt) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/henningmattes/csedu",
"name": "csedu",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "education computer science image processing charts computer science education",
"author": "Henning Mattes",
"author_email": "henning_mattes@gmx.de",
"download_url": "https://files.pythonhosted.org/packages/b6/46/5ec687ca0be4dd1d5ae668654292cd78c3676dc451b40a33e6551448f9df/csedu-0.1.0.tar.gz",
"platform": null,
"description": "# Computer Science Education - Image Processing Module and Visualization of Distributions\r\n![Image Description](https://raw.githubusercontent.com/henningmattes/diverse/main/csedu_package_img_small.png)\r\n\r\n## Description\r\n\r\nThis project consists of two modules for computer science education:\r\n\r\n- **Image Processing**: A module for simple editing and analysis of images. It allows loading, saving, and displaying images, calculating color depths, and converting palette-based images to RGB.\r\n\r\n- **Visualization of Distributions**: A module for visualizing two distributions side by side as line or bar charts. Ideal for presenting statistical data in educational settings.\r\n\r\n## Modules\r\n\r\n### imageprocessing\r\n\r\nThis module provides functions for simple processing and analysis of images. The main functions are:\r\n\r\n- `load_image(path_and_filename)`: Loads an image and calculates its color depth.\r\n- `transform_palette_image_to_rgb(np_image_array, palette)`: Transforms a palette-based image into an RGB image.\r\n- `pillow_image(numpy_array, palette=None)`: Converts a NumPy array into a Pillow image.\r\n- `save_image(path, np_image_array, palette=None)`: Saves an image to a file.\r\n- `show(image_data, show_axes=True, label_data=None, palette_data=None, show_grid=False, grid_color='black', number_of_ticks=None, number_of_columns=1, figsize=None)`: Displays images in a plot.\r\n- `plot_histogram(histogram, palette='inferno')`: Plots a histogram of the brightness values of an image.\r\n\r\n### diagrams\r\n\r\nThis module provides a simple way to visualize two distributions. The main function is:\r\n\r\n- `show_distributions(distribution1, distribution2, title1=\"\", title2=\"\", mode=\"Lines\")`: Visualizes two distributions as line or bar charts.\r\n\r\n## Example Usage\r\n\r\n### Image Processing\r\n\r\n```python\r\nfrom imageprocessing import load_image, show, save_image\r\n\r\n# Load image and calculate color depth\r\nimage, color_mode, color_depth, palette = load_image('path/to/image.png')\r\nprint(f\"Color depth: {color_depth} Bit\")\r\n\r\n# Display image\r\nshow(image)\r\n\r\n# Save image\r\nsave_image('path/to/output_image.png', image, palette)\r\n\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT) with additional terms for attribution. See the [LICENSE](https://raw.githubusercontent.com/henningmattes/diverse/main/LICENSE.txt) file for details.\r\n",
"bugtrack_url": null,
"license": "MIT with additional terms",
"summary": "A package for computer science education containing modules for image processing and chart creation.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/henningmattes/csedu"
},
"split_keywords": [
"education",
"computer",
"science",
"image",
"processing",
"charts",
"computer",
"science",
"education"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5c6d94f19873cd88cc1cab88ee76be589f3f092683436c2175c8cb3b5ad2b49c",
"md5": "8ce1e5b2bba03fca3eb12e6d93c4babc",
"sha256": "b5c64b541f9e446cca5ee5c06a8c956ae303826699daa5f22b9317de437055dc"
},
"downloads": -1,
"filename": "csedu-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8ce1e5b2bba03fca3eb12e6d93c4babc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7440,
"upload_time": "2024-08-09T08:53:51",
"upload_time_iso_8601": "2024-08-09T08:53:51.697000Z",
"url": "https://files.pythonhosted.org/packages/5c/6d/94f19873cd88cc1cab88ee76be589f3f092683436c2175c8cb3b5ad2b49c/csedu-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b6465ec687ca0be4dd1d5ae668654292cd78c3676dc451b40a33e6551448f9df",
"md5": "c93f97fd4b64cdc862574733fa1bf924",
"sha256": "d65725c579c8f088dc84336576f4302750a9169111b654a2763b2a6098d5021f"
},
"downloads": -1,
"filename": "csedu-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "c93f97fd4b64cdc862574733fa1bf924",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 479769,
"upload_time": "2024-08-09T08:53:53",
"upload_time_iso_8601": "2024-08-09T08:53:53.539050Z",
"url": "https://files.pythonhosted.org/packages/b6/46/5ec687ca0be4dd1d5ae668654292cd78c3676dc451b40a33e6551448f9df/csedu-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-09 08:53:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "henningmattes",
"github_project": "csedu",
"github_not_found": true,
"lcname": "csedu"
}