0

I am getting some data (pixel data of pictures) and storing them in a RedisJSON database.

The problem is that each picture will yield about 11 MB of pixel data text, which will be very expensive to store.

Is there a way we can reduce the text while keeping its integrity so we can open it again? (I'm thinking of text compression in Python)

Kaiss B.
  • 249
  • 1
  • 12
  • my first thought is: why are you storing pictures as text data in Redis...? it's probably better to store large files "on disk" and just the location and other metadata about the file in Redis – Anentropic Sep 15 '22 at 16:24
  • lossless image compression may be useful https://siipo.la/blog/whats-the-best-lossless-image-format-comparing-png-webp-avif-and-jpeg-xl – Anentropic Sep 15 '22 at 16:26
  • To @Anentropic, I am doing this because I'm working on a Machine Learning algorithm to work on these images, and therefore, I need the pixel data, not the file itself. – Kaiss B. Sep 15 '22 at 21:08
  • For your second comment, The file compression does not matter since I will always have a 1024x1024x3 matrix for pixel data (1024 resolution in RGB) – Kaiss B. Sep 15 '22 at 21:11
  • I'm just suggesting that lossless image compression algo is likely to be most effective compression for that data, I don't see how the matrix size is relevant – Anentropic Sep 16 '22 at 08:58

0 Answers0