Skip to content

Commit

Permalink
Generated new exampels with Sobel operator
Browse files Browse the repository at this point in the history
- Re-generated the examples with the new algorithm
- updated README.md
- increased version number to 2.0.2
  • Loading branch information
sedthh committed Apr 11, 2021
1 parent a5af950 commit a01e4b1
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 39 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ io.imsave("pixel.png", new_image)
```
![Definitely not cherry picking](/examples/p_blazkowicz.png)

Pyxelate extends scikit-learn transformers, allowing the same learned palette to be reused on multiple pictures (for aesthetically **similar** images).
Pyxelate extends scikit-learn transformers, allowing the same learned palette to be reused on other, aesthetically **similar** images (so it's somewhat like an 8-bit style transfer):

```python
car = io.imread("examples/f1.jpg")
Expand Down Expand Up @@ -72,7 +72,8 @@ trex_p = Pyx(factor=9, palette=4, dither="naive", alpha=.6).fit_transform(trex)
| palette | The number of colors in the transformed image. <br /> - If it's an `int` that is larger than 2, Pyxelate will search for this many colors automatically. Default is `8`. <br /> - If it's a `Pal` palette enum object, Pyxelate will use palette transfer to match these colors.|
| dither | The type of dithering to use on the transformed image (see more exampels below):<br />- `"none"` no dithering is applied (default, takes no additional time)<br />- `"naive"` Pyxelate's naive dithering based on probability mass function (use for images with **alpha channel**) <br />- `"bayer"` Bayer-like ordered dithering using a [4x4 Bayer Matrix](https://www.visgraf.impa.br/Courses/ip00/proj/Dithering1/) (fastest dithering method, use for large images)<br />- `"floyd"` Floyd-Steinberg inspired [error diffusion dithering](https://en.m.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering) (slowest)<br />- `"atkinson"` Atkinson inspired [error diffusion dithering](https://surma.dev/things/ditherpunk/) (slowest) |
| alpha | For images with transparency, the transformed image's pixel will be either visible/invisible above/below this threshold. Default is `0.6`. |
| depth | How many times should the Pyxelate algorithm downsample the image. More iteratrions will result in blockier images. Can be a positive `int`, although it is really time consuming and should never be more than 3. Raise it only for really small iamges. Default is `1`. |
| depth | How many times should the Pyxelate algorithm downsample the image. More iteratrions will result in blockier images. Must be a positive `int`, although it is really time consuming and should never be more than 3. Raise it only for really small iamges. Default is `1`. |
| sobel | The size of the sobel operator, must be an `int` larger than 1. Default is `3`, try `2` for a much faster but less accurate output. |
| boost | Adjust contrast and apply preprocessing on the image before transformation for better results. In case you see unwanted dark pixels in your image set this to `False`. Default is `True`. |

Showcase of available dithering methods:
Expand Down
62 changes: 27 additions & 35 deletions examples.ipynb

Large diffs are not rendered by default.

Binary file modified examples/p_blazkowicz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/p_br.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/p_br2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/p_corgi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/p_fit_transform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/p_palms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/p_trex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/p_vangogh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyxelate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.0.1"
__version__ = "2.0.2"

__short_description__ = (
"Downsample images to 8-bit pixel art.",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup

setup(name='pyxelate',
version='2.0.1',
version='2.0.2',
description='Pyxelate is a Python class that converts images into 8-bit pixel art.',
url='http://github.com/sedthh/pyxelate',
author='sedthh',
Expand Down

0 comments on commit a01e4b1

Please sign in to comment.