Author Topic: EVE2 Palette8 Pixels  (Read 170 times)


  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
EVE2 Palette8 Pixels
« on: July 01, 2018, 02:52:40 PM »
This display is awesome!  I've referenced FTDI's FT81x Series Programmers Guide and implemented a display library, asset management and lightweight display stack for RGB565.  I have a couple needs for small, high quality transparent Paletted8 bitmaps, however.  Here are the bytes that are written to memory, line:[ ] pixel: ():

[ (ff 00 00 ff) (00 ff 00 ff) (00 00 ff ff) ]    [ (ff ff ff 00) (ff ff ff 80) (ff ff ff 00) ]

This is supposed to be RGBA, 3px wide by 2px high.
Top row goes red, green, blue.
Bottom row goes transparent, halfway white transparent, transparent.

On the display there's just garbage.  What is the proper way to store in memory and display a Paletted8 bitmap on EVE2?

Code: [Select]
display_list.bitmap_layout(BitmapFormat::Paletted8, width, height));
display_list.bitmap_size(BitmapFilter::nearest, BitmapWrap::border, BitmapWrap::border, width, height));

// Alpha
display_list.blend(BlendFunction::one, BlendFunction::zero));
display_list.color_mask(0, 0, 0, 1));
display_list.palette_source(bitmap_location + 3));
display_list.vertex2ii(x, y, 0));
display_list.blend(BlendFunction::dst_alpha, BlendFunction::one_minus_dst_alpha));

// Red
display_list.color_mask(1, 0, 0, 0));
display_list.vertex2ii(x, y, 0));

// Green
display_list.color_mask(0, 1, 0, 0));
display_list.palette_source(bitmap_location + 1));
display_list.vertex2ii(x, y, 0));

// Blue
display_list.color_mask(0, 0, 1, 0));
display_list.palette_source(bitmap_location + 2));
display_list.vertex2ii(x, y, 0));

Regular 565 2 bytes per pixel works great.  I've got animations and counters working great already, just need to figure out how to draw an RGBA8888 image :-)

I found FTDI's tool for converting PNG's to palette8.  It seems to be broken though - it won't open any png file I can find.  "invalid input file" on anything I've produced or found on the Internet.  I just need the file format and I'll make my own tool!!  What does a palette & index bytewise schema look like?
« Last Edit: July 01, 2018, 04:30:30 PM by warriorofwire »


  • Administrator
  • Hero Member
  • *****
  • Posts: 297
  • Karma: 18
    • View Profile
Re: EVE2 Palette8 Pixels
« Reply #1 on: July 02, 2018, 09:32:20 AM »
Hi warriorofwire!

Iím sorry to hear about the trouble you are having with storing / displaying Paletted8 bitmaps.

FTDI has an application note for image file conversion (see page 14):

Code: [Select]
//The following code shows a PALETTED8 example for the FT81x. PALETTED8 format is supported
//indirectly in the FT81x and it is different from the PALETTED format in the FT80x. To render
//Alpha, Red, Green and Blue channels, multi-pass drawing action is required.

//addr_pal is the starting address of palette lookup table in RAM_G
//bitmap source(palette indices) is starting from address 0

dl(BITMAP_LAYOUT(PALETTED8, width, height))

dl(BITMAP_SOURCE(0)) //bitmap source(palette indices)


//Draw Alpha channel
dl(VERTEX2II(0, 0, 0, 0))

//Draw Red channel
dl(PALETTE_SOURCE (addr_pal+2))
dl(VERTEX2II (0, 0, 0, 0))

//Draw Green channel
dl(PALETTE_SOURCE(addr_pal + 1))
dl(VERTEX2II(0, 0, 0, 0))

//Draw Blue channel

Regarding the palette / index scheme of FTDI's image converter tool it may be beneficial to seek support from their support team directly.

Hope this helps!


  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: EVE2 Palette8 Pixels
« Reply #2 on: July 07, 2018, 01:07:55 PM »
Oh goodness, hi Paul - thank you for your reply, I didn't have email notification set up for this thread!

I've reached out to FTDI for help.  I read that application note and the extensively.  It is very unclear what the "palette" schema is, and what a paletted bitmap should contain to reference that palette.

Here's the application, sorry for the poor video - I haven't implemented screen capture for video yet:

The tachometer needle is a subtle asset with a blue glow that fades off over the span of a few pixels.  I'd like to retain a very high quality color gradient and use transparency.  I tried using "rgb8888" 32 bit raw bitmap and was unable to get that to work.  Any alternative ideas?  32bpp is expensive, but totally tolerable for this small, high-value asset.

By the way, I thought it was kind of funny that the coprocessor uses "degrees" for rotation when it seems most natural to use "radians" with a transformation matrix  :D


EVE2 TFT Module VHDL Code Support (NHD-3.5-320240FT-CSXN-CTP)

Started by bivinBoard TFTs

Replies: 0
Views: 605
Last post March 19, 2018, 12:06:34 AM
by bivin
EVE2 Git repository proting for PIC32MZ,NHD-7.0-800480FT-CSXV-CTP

Started by mrupprathBoard TFTs

Replies: 7
Views: 1621
Last post February 14, 2018, 09:14:18 AM
by Paul_B
New Support library for Screen EVE2 NHD Playback videos

Started by lightcalamarBoard Customer Projects

Replies: 7
Views: 1008
Last post July 12, 2018, 12:43:01 PM
by lightcalamar
EVE2 Startup for 7" Display

Started by warriorofwireBoard TFTs

Replies: 2
Views: 427
Last post May 22, 2018, 01:18:23 AM
by warriorofwire
Introducing our New EVE2 TFT Modules

Started by Robert_HBoard New Product Releases

Replies: 0
Views: 1352
Last post December 11, 2017, 09:59:41 AM
by Robert_H