FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: Compressing to ASTC on Linux.  (Read 8156 times)

rascalito

  • Newbie
  • *
  • Posts: 8
    • View Profile
Compressing to ASTC on Linux.
« on: July 14, 2022, 07:20:48 AM »

Hello!

I'm using Ubuntu 22.04.
I'm using a lot of bitmaps, and the easiest way to use bitmaps seems to be to compress
them to ASTC, and store them directly in flash.
As the process of adding a new bitmap is quite time consuming, I have made a php script
that takes one raw image and its associated json. It then creates a pair of .h / .c files
and adds a record in a bitmaplist.h / .cp. files.
Now the next step I would like is a way to directly compress my images on Linux.
It also creats in each .h / .cpp file a structure which contains the file name, data pointer, position
in flash, etc... and also spits out the percentage of flash that has been used. And beside this,
drawing a single image is done with a single command with 2 parameters, one being a rectangle,
and the other is this structure.
Example:
Rect R(x, y, w, h);
BitmapInfo * bmi = BitmapList->FindBMI("MyLogo");
if(bmi) SysLCD->DrawBitmap(R, bmi);
Is there a command-line tool that I can run from the terminal (and therefore from a php script)?

Next question:
How do I choose an encoding method?
I choosed ASTC8x8 at random and it works, but is there logical way to choose an encoding scheme?

Last one:
I have chosen ASTC8x8. When the bitmap dimensions are mutliple of 8, it's just fine. When not,
the size is rounded up to the next multiple of 8. In this case, what will the added image border
look like?

Thanks!

R
Logged

rascalito

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compressing to ASTC on Linux.
« Reply #1 on: July 14, 2022, 08:14:04 AM »

Hello!

Sorry, just replying to a part of my own post.
Compressing in ASTC format on Ubuntu:
1. Install by
sudo apt install astcenc
2. Run astcenc.
-> This will list a couple of examples which will be good to start before learning how
to tune the bitmaps for a given purpose.

Now the other questions remain: how to choose the right ASTC format.

Regards,

R

Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: Compressing to ASTC on Linux.
« Reply #2 on: July 14, 2022, 09:13:24 AM »

Hello,

This is the FTDI Community.

For EVE related questions please post on our Bridgetek Community:

www.brtcommunity.com

Best Regards,
FTDI Community
Logged