Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,3 +10,31 @@ pinned: false
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 13 |
+
|
| 14 |
+
Halftone Effect App
|
| 15 |
+
|
| 16 |
+
This application allows users to apply a halftone effect to an image using different shapes such as circles, squares, or triangles. The halftone effect is a technique that simulates continuous tone imagery through the use of dots, varying in size and spacing.
|
| 17 |
+
Requirements
|
| 18 |
+
To run this app, you need to have Python installed along with the following libraries:
|
| 19 |
+
Gradio
|
| 20 |
+
Pillow
|
| 21 |
+
You can install these libraries using pip:
|
| 22 |
+
pip install gradio Pillow
|
| 23 |
+
Usage
|
| 24 |
+
Upload an image using the interface.
|
| 25 |
+
Select a shape type (circle, square, or triangle) from the dropdown menu.
|
| 26 |
+
View the output image with the applied halftone effect.
|
| 27 |
+
How it Works
|
| 28 |
+
The halftone effect is achieved by:
|
| 29 |
+
Converting the input image to grayscale.
|
| 30 |
+
Creating a grid over the image with a specified spacing (default is 10 pixels).
|
| 31 |
+
For each grid point, calculating the grayscale value (brightness) at that point.
|
| 32 |
+
Determining the size of the shape based on the grayscale value: darker areas get larger shapes, lighter areas get smaller or no shapes.
|
| 33 |
+
Drawing the selected shape (circle, square, or triangle) at each grid point with the calculated size.
|
| 34 |
+
Parameters
|
| 35 |
+
grid_spacing: Controls the density of shapes. Smaller values create denser patterns but may slow processing. Default is 10 pixels.
|
| 36 |
+
max_size: Ensures shapes don't overlap too much. Adjust as needed for desired effect. Default is 8 pixels.
|
| 37 |
+
Notes
|
| 38 |
+
The app is built using Gradio, which provides a user-friendly web interface.
|
| 39 |
+
For large images or small grid_spacing, processing may take longer. Adjust parameters for faster results.
|
| 40 |
+
Future enhancements could include adjustable parameters via sliders, colored shapes, or additional shape types.
|