Skip to content

Commit dcc50a9

Browse files
committed
version: bump to 2.0.10
1 parent d41f7b8 commit dcc50a9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ for color in vars(MaterialDynamicColors).keys():
134134
# Pillow is required to open image to array of pixels
135135
from PIL import Image
136136
# C++ QuantizeCelebi
137-
from materialyoucolor.quantize import QuantizeCelebi, StbLoadImage
137+
from materialyoucolor.quantize import QuantizeCelebi, ImageQuantizeCelebi
138138
# Material You's default scoring of colors
139139
from materialyoucolor.score.score import Score
140140

@@ -143,17 +143,17 @@ image = Image.open("path_to_some_image.jpg")
143143
pixel_len = image.width * image.height
144144
image_data = image.getdata()
145145

146-
# Alternate method
147-
# image_data = StbLoadImage("path_to_some_image.jpg")
148-
# Warning: This method is slower and much more resource intensive
149-
# (eats too much ram) so use it with caution
150-
151146
# Quality 1 means skip no pixels
152147
quality = 1
153148
pixel_array = [image_data[_] for _ in range(0, pixel_len, quality)]
154149

155150
# Run algorithm
156151
result = QuantizeCelebi(pixel_array, 128) # 128 -> number desired colors, default 128
152+
153+
# Alternate C++ method
154+
# this is generally faster, but gives less control over image
155+
# result = ImageQuantizeCelebi("path_to_some_image.jpg", quality, 128)
156+
157157
print(result)
158158
# {4278722365: 2320, 4278723396: 2405, 4278723657: 2366,...
159159
# result is a dict where key is

materialyoucolor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.0.9"
1+
__version__ = "2.0.10"

0 commit comments

Comments
 (0)