elixir-image / image

Image processing for Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extract RGB pixels

stiang opened this issue · comments

This might be trivial for people who understand image formats better than me, but is there currently a way to use this library to extract the RGB pixels from an image, so that they are suitable for use with BlurHash?

Here is the example code from the blurhash-elixir package:

# Pixel data supplied in RGB order, with 3 bytes per pixels.
pixels = [255, 43, 20, 11, 0, 155, ...]

hash = BlurHash.encode(pixels, 30, 30, 4, 3)

I’m looking for a way to get the pixels in the above code from an image opened with Image.open/2.