elixir-image/image

Extract RGB pixels

Closed this issue · 0 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.