-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from Schmiddiii/gdk-pixbuf-only-approximate-equal
Only check for approximate result for gdk-pixbuf decoding
- Loading branch information
Showing
7 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Blur the test images using the official blurhash-python package. | ||
# The results are used as reference images in the tests of blurhash-rs. | ||
|
||
import blurhash | ||
from os import listdir | ||
from PIL import Image | ||
|
||
images = [f for f in listdir(".") if "png" in f and not "blurred" in f] | ||
|
||
for path in images: | ||
with Image.open(path) as image: | ||
hash = blurhash.encode(image, x_components=4, y_components=3) | ||
width, height = image.size | ||
|
||
result = blurhash.decode(hash, width, height, mode=blurhash.PixelMode.RGBA) | ||
result.save(path.split(".")[0] + "_blurred.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 not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters