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

  • SEARCH
  • Home
  • 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 have to send the audio data in byte array obtain by recording from
I have the following array, it is currently created sorted by entity_count (outputted by
currently I have the following code: String select = qry.substring(select .length(),qry2.indexOf( from )); String[]
currently i have jdbc code with the following basic stucture: get Connection (do the
I have the following problem using subversion: I'm currently working on the trunk of
I have a select query that currently produces the following results: Description Code Price
I'm currently turning an array of pixel values (originally created with a java.awt.image.PixelGrabber object)
I have following code in Java: import java.util.*; public class longest{ public static void
currently I have following code: home.php <form name='myformname' id='myformid'> <input type='text' name='mytext1' value='abc'> <input
I currently have the following code: events.detect do |event| #detect does the block until

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.