Spaces:
Running
Running
README update
Browse files- README.md +35 -11
- app.py +8 -2
- example_images/bananas_out.jpeg +0 -0
- example_images/bananas_palette.jpeg +0 -0
README.md
CHANGED
|
@@ -1,13 +1,37 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Pixelart Filter
|
| 3 |
-
emoji: 👾
|
| 4 |
-
colorFrom: gray
|
| 5 |
-
colorTo: red
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 5.16.0
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
# Simple Pixelart Filter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Simple Pixelart Filter
|
| 2 |
+
A Gradio [app](https://kuko6-pixel-filter.hf.space/) that allows you to pixelate images, quantize colors and display color palettes.
|
| 3 |
+
|
| 4 |
+
<p align="center">
|
| 5 |
+
<img src="example_images/bananas.jpg" alt="Bananas" width="30%">
|
| 6 |
+
<img src="example_images/bananas_out.jpeg" alt="Bananas pixelated" width="30%">
|
| 7 |
+
<img src="example_images/bananas_palette.jpeg" alt="Bananas palette" width="30%">
|
| 8 |
+
</p>
|
| 9 |
+
|
| 10 |
+
<!-- ## Features
|
| 11 |
+
- Pixelate images with customizable pixel size
|
| 12 |
+
- Apply blur effect to pixelated images
|
| 13 |
+
- Quantize using k-means clustering
|
| 14 |
+
- Interactive web interface using Gradio -->
|
| 15 |
+
|
| 16 |
+
## Try it locally
|
| 17 |
+
set up a virtual environment with:
|
| 18 |
+
```sh
|
| 19 |
+
python3 -m venv venv
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
activate the virtual environment:
|
| 23 |
+
```sh
|
| 24 |
+
source venv/bin/activate
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
install the requirements:
|
| 28 |
+
```sh
|
| 29 |
+
pip install -r requirements.txt
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
run the gradio app:
|
| 33 |
+
```sh
|
| 34 |
+
python3 app.py
|
| 35 |
+
```
|
| 36 |
|
| 37 |
+
open `127.0.0.1:7860` in your browser.
|
app.py
CHANGED
|
@@ -12,7 +12,7 @@ with gr.Blocks() as demo:
|
|
| 12 |
|
| 13 |
with gr.Row(equal_height=True):
|
| 14 |
with gr.Column(variant="panel"):
|
| 15 |
-
img = gr.Image(label="Input Image")
|
| 16 |
pixel_size = gr.Number(label="Pixel Size", minimum=1, value=16)
|
| 17 |
blur = gr.Checkbox(label="Blur")
|
| 18 |
use_palette = gr.Checkbox(label="Use Palette")
|
|
@@ -20,12 +20,18 @@ with gr.Blocks() as demo:
|
|
| 20 |
|
| 21 |
with gr.Column(variant="panel"):
|
| 22 |
output_img = gr.Image(
|
| 23 |
-
label="Output Image", format="jpeg",
|
|
|
|
|
|
|
|
|
|
| 24 |
)
|
| 25 |
output_palette = gr.Image(
|
| 26 |
label="Image Palette",
|
|
|
|
| 27 |
show_download_button=False,
|
| 28 |
show_share_button=False,
|
|
|
|
|
|
|
| 29 |
visible=False,
|
| 30 |
)
|
| 31 |
|
|
|
|
| 12 |
|
| 13 |
with gr.Row(equal_height=True):
|
| 14 |
with gr.Column(variant="panel"):
|
| 15 |
+
img = gr.Image(label="Input Image",show_fullscreen_button=False)
|
| 16 |
pixel_size = gr.Number(label="Pixel Size", minimum=1, value=16)
|
| 17 |
blur = gr.Checkbox(label="Blur")
|
| 18 |
use_palette = gr.Checkbox(label="Use Palette")
|
|
|
|
| 20 |
|
| 21 |
with gr.Column(variant="panel"):
|
| 22 |
output_img = gr.Image(
|
| 23 |
+
label="Output Image", format="jpeg",
|
| 24 |
+
show_download_button=False,
|
| 25 |
+
show_share_button=False,
|
| 26 |
+
show_fullscreen_button=False
|
| 27 |
)
|
| 28 |
output_palette = gr.Image(
|
| 29 |
label="Image Palette",
|
| 30 |
+
format="jpeg",
|
| 31 |
show_download_button=False,
|
| 32 |
show_share_button=False,
|
| 33 |
+
show_fullscreen_button=False,
|
| 34 |
+
show_label=False,
|
| 35 |
visible=False,
|
| 36 |
)
|
| 37 |
|
example_images/bananas_out.jpeg
ADDED
|
|
example_images/bananas_palette.jpeg
ADDED
|
|