Commit 3f6f75d5 authored by inkhey's avatar inkhey

fixing seed mecanism to generate seed per layer to be sure allowing fully...

fixing seed mecanism to generate seed per layer to be sure allowing fully random result of layer choice
parent 1faff0cc
Pipeline #231474 passed with stages
in 1 minute and 8 seconds
Version 0.5.1
-------------
- Breaking change ! Avatar generation use seed per layer now to be sure to not obtain same result from different layer.
Version 0.5
------------
- add Chooser mecanism to choose mecanism for choosing layer from a hash method of hashlib
Version 0.4
------------
- fix issue related to predictibility/reproductibility of result with FolderAvatarTheme.
PiouPiou for the same entry given, should return exactly same result in layers choosen.
Pillow configuration may cause some difference in
PiouPiou for the same entry given, should return exactly same result in layers choosen.
Pillow configuration may cause some difference in
image file, but this case hasn't been reproduced yet. This is tested an you
can verify the behavior on your system by running TestFolderAvatarTheme test
https://framagit.org/inkhey/pioupiou/commit/067af0a7800f51a1b3a4e172f9ab47e3737d473d
......@@ -13,4 +21,4 @@ https://framagit.org/inkhey/pioupiou/commit/8f9535324adf85bc62dc19cd5cd3ab8a3b06
Version 0.3
-------------
- Initial Feature
- First Pypi release
\ No newline at end of file
- First Pypi release
......@@ -66,12 +66,13 @@ class AvatarTheme(object):
Generate avatar Image by obtaining layer and applying them
:param token: token used as seed to decide layer variation to use.
"""
self.chooser.seed(token)
sorted_layers = sorted(self.layers, key=lambda x: x.level)
self.chooser.seed(token + sorted_layers[0].name)
current_image = sorted_layers[0].get_random_image(
allow_no_alpha_layer=True, chooser=self.chooser
)
for layer in sorted_layers[1:]:
self.chooser.seed(token + layer.name)
current_image = Image.alpha_composite(
current_image, layer.get_random_image(chooser=self.chooser)
)
......
tests/test_img/saved_bird_avatar.png

53.8 KB | W: | H:

tests/test_img/saved_bird_avatar.png

42.8 KB | W: | H:

tests/test_img/saved_bird_avatar.png
tests/test_img/saved_bird_avatar.png
tests/test_img/saved_bird_avatar.png
tests/test_img/saved_bird_avatar.png
  • 2-up
  • Swipe
  • Onion skin
tests/test_img/saved_cat_avatar.png

45.9 KB | W: | H:

tests/test_img/saved_cat_avatar.png

51.8 KB | W: | H:

tests/test_img/saved_cat_avatar.png
tests/test_img/saved_cat_avatar.png
tests/test_img/saved_cat_avatar.png
tests/test_img/saved_cat_avatar.png
  • 2-up
  • Swipe
  • Onion skin
tests/test_img/saved_monster_avatar.png

1.38 KB | W: | H:

tests/test_img/saved_monster_avatar.png

1.24 KB | W: | H:

tests/test_img/saved_monster_avatar.png
tests/test_img/saved_monster_avatar.png
tests/test_img/saved_monster_avatar.png
tests/test_img/saved_monster_avatar.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment