A package to generate color sequences from videos and images
Its main use is to create a set of unique colors from an image and then sort the colors according to the selected sorting method.
You can simply pip install this package:
pip install pyrolld
Here is an example:
from rolld import Roller
filepath = "image.png"
image = Roller(filepath)
rolled = image.roll()
rolled.show()
You can also chose between 3 different sorting methods ["HSV", "HSL", "YIQ", "LUM"]
:
from rolld import Roller
filepath = "image.png"
image = Roller(filepath)
rolled = image.roll(sorter="LUM")
rolled.show()
Here is an example. We are going to use the image lena.png
:
And with this code we will "roll" the image:
from rolld import Roller
filepath = "lena.png"
roller = Roller(filepath)
sorters = ["HSV", "HSL", "YIQ", "LUM"]
for sorter in sorters:
image = roller.roll(sorter=sorter)
image.show()
Here is the output of all the sorting methods: