Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3339010
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:26:34+00:00 2026-05-18T00:26:34+00:00

I currently have the following array in a Java program, byte[] data = new

  • 0

I currently have the following array in a Java program,

byte[] data = new byte[800];

and I’d like to compress it before sending it to a microcontroller over serial (115200 Baud). I would like to then decompress the array on the microcontroller in C. However, I’m not quite sure what the best way to do this is. Performance is an issue since the microcontroller is just an arduino so it can’t be too memory/cpu intensive. The data is more or less random (edit I guess it’s not really that random, see the edit below) I’d say since it represents a rgb color value for every 16 bits.

What would be the best way to compress this data? Any idea how much compression I could possibly get?

edit

Sorry about the lack of info. I need the compression to be lossless and I do only intend to send 800 bytes at a time. My issue is that 800 bytes won’t transfer fast enough at the rate of 115200 baud that I am using. I was hoping I could shrink the size a little bit to improve speed.

Every two bytes looks like:

0RRRRRGGGGGBBBBB

Where R G and B bits represent the values for color channels red, green, and blue respectively. Every two bytes is then an individual LED on a 20×20 grid. I would imagine that many sets of two bytes would be identical since I frequently assign the same color codes to multiple LEDs. It may also be the case that RGB values are often > 15 since I typically use bright colors when I can (However, this might be a moot point since they are not all typically > 15 at once).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:26:35+00:00Added an answer on May 18, 2026 at 12:26 am

    If the data is “more or less random” then you won’t have much luck compressing it, I’m afraid.

    UPDATE

    Given the new information, I bet you don’t need 32k colours on your LED display. I’d imagine that a 1024- or 256-colour palette might be sufficient. Hence you could get away with a trivial compression scheme (simply map each word through a lookup table, or possibly just discard lsbs of each component), that would work even for completely uncorrelated pixel values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have the following script: http://jsfiddle.net/oshirowanen/mnXdv/ Which works fine, i.e. if a click
I currently have the following select statement, but I wish to move to full
I currently have a binary search tree setup, utilizing templates to allow me to
Is it possible with Android to have a search bar for a ListView so
Does anyone have a working, step-by-step example of how to implement IEnumerable and IEnumerator
How can I create a new route/menu in Drupal that doesn't automatically render a
I have a fairly simple Rails application that allows users to manage their clients
hope you can help me with this one… I saw some crazy behavior so
I'm attempting to create an xquery expression that will return selected nodes but will
I'm trying to install Webiva (a Rails CMS) I’m using RVM to manage my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.