colorscrolling

General

tikkel

NEW 1 month ago

Please, what is the default color palette in C++ syntax?

const Color PALETTE[] = {
  (Color)0xffff, // color 0x0 ... ?

Steph

1 month ago

Image Transcoder gives you the details when you select the indexed mode....

const Color PALETTE[] = {
    (Color)0xffff, // color 0x0
    (Color)0xacd0, // color 0x1
    (Color)0x5268, // color 0x2
    (Color)0x0000, // color 0x3
    (Color)0x9008, // color 0x4
    (Color)0xca30, // color 0x5
    (Color)0xd8e4, // color 0x6
    (Color)0xfd42, // color 0x7
    (Color)0xcc68, // color 0x8
    (Color)0xfeb2, // color 0x9
    (Color)0xf720, // color 0xa
    (Color)0x8668, // color 0xb
    (Color)0x044a, // color 0xc
    (Color)0x0210, // color 0xd
    (Color)0x4439, // color 0xe
    (Color)0x7ddf  // color 0xf
};

Steph

NEW 1 month ago

tikkel tikkel

Image Transcoder gives you the details when you select the indexed mode....

const Color PALETTE[] = {
    (Color)0xffff, // color 0x0
    (Color)0xacd0, // color 0x1
    (Color)0x5268, // color 0x2
    (Color)0x0000, // color 0x3
    (Color)0x9008, // color 0x4
    (Color)0xca30, // color 0x5
    (Color)0xd8e4, // color 0x6
    (Color)0xfd42, // color 0x7
    (Color)0xcc68, // color 0x8
    (Color)0xfeb2, // color 0x9
    (Color)0xf720, // color 0xa
    (Color)0x8668, // color 0xb
    (Color)0x044a, // color 0xc
    (Color)0x0210, // color 0xd
    (Color)0x4439, // color 0xe
    (Color)0x7ddf  // color 0xf
};

tikkel

1 month ago

Sure? If i use this, all colors are changed. Not the same as without setPalette ...

(I use  DISPLAY_MODE_INDEX_HALFRES)

tikkel

NEW 1 month ago

Steph Steph

Sure? If i use this, all colors are changed. Not the same as without setPalette ...

(I use  DISPLAY_MODE_INDEX_HALFRES)

Steph

NEW 1 month ago

tikkel tikkel

tikkel

1 month ago

... but which index have the COLORS?

For example, when i don't manipulate the palette and use index 0x0 in an Image. Then the pixel is 0x0000. But the array from the API (and yours) has on index 0x0 0xffff!

I think, the default color palette in "image translator" is not the Gamebuino default palette!?

Or where is my mistake? :o)

tikkel

NEW 1 month ago

Steph Steph

... but which index have the COLORS?

For example, when i don't manipulate the palette and use index 0x0 in an Image. Then the pixel is 0x0000. But the array from the API (and yours) has on index 0x0 0xffff!

I think, the default color palette in "image translator" is not the Gamebuino default palette!?

Or where is my mistake? :o)

Steph

1 month ago

Sorry, I don't understand what you mean. Can you post your image?

The default Gamebuino palette is the one defined in the official doc. And Image Transcoder uses this palette by default!

What tool do you mean when you say Image Translator?

Steph

1 month ago

Here is a simple example drawn with the default palette:

Image Transcoder generates the following code (scroll down to see the whole code):

const Color PALETTE[] = {
  (Color)0xffff, // color 0x0
  (Color)0xacd0, // color 0x1
  (Color)0x5268, // color 0x2
  (Color)0x0000, // color 0x3
  (Color)0x9008, // color 0x4
  (Color)0xca30, // color 0x5
  (Color)0xd8e4, // color 0x6
  (Color)0xfd42, // color 0x7
  (Color)0xcc68, // color 0x8
  (Color)0xfeb2, // color 0x9
  (Color)0xf720, // color 0xa
  (Color)0x8668, // color 0xb
  (Color)0x044a, // color 0xc
  (Color)0x0210, // color 0xd
  (Color)0x4439, // color 0xe
  (Color)0x7ddf  // color 0xf
};

const uint8_t IMAGE_DATA[] = {
  16,   // frame width
  16,   // frame height
  0x01, // number of frames (lower byte)
  0x00, // number of frames (higher byte)
  0,    // animation speed
  0x0,  // transparent color
  1,    // indexed color mode
  // frame 1/1
  0x00, 0x00, 0x03, 0x33, 0x33, 0x30, 0x00, 0x00, 
  0x00, 0x03, 0x3a, 0xaa, 0xaa, 0xa3, 0x30, 0x00, 
  0x00, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x00, 
  0x03, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x30, 
  0x03, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x30, 
  0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 
  0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 
  0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 
  0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 
  0x3a, 0xa3, 0xaa, 0xaa, 0xaa, 0xaa, 0x3a, 0xa3, 
  0x3a, 0xa3, 0xaa, 0xaa, 0xaa, 0xaa, 0x3a, 0xa3, 
  0x03, 0xaa, 0x3a, 0xaa, 0xaa, 0xa3, 0xaa, 0x30, 
  0x03, 0xaa, 0xa3, 0x33, 0x33, 0x3a, 0xaa, 0x30, 
  0x00, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x00, 
  0x00, 0x03, 0x3a, 0xaa, 0xaa, 0xa3, 0x30, 0x00, 
  0x00, 0x00, 0x03, 0x33, 0x33, 0x30, 0x00, 0x00
};

Of course, it should not be forgotten to specify that the transparency color chosen here is white, so #ffffff = 0xffff (which is actually the color with index 0x0 in the palette)!

I don't see what the problem is?

Steph

NEW 1 month ago

tikkel tikkel

Sorry, I don't understand what you mean. Can you post your image?

The default Gamebuino palette is the one defined in the official doc. And Image Transcoder uses this palette by default!

What tool do you mean when you say Image Translator?

Steph

NEW 1 month ago

tikkel tikkel

Here is a simple example drawn with the default palette:

Image Transcoder generates the following code (scroll down to see the whole code):

const Color PALETTE[] = {
  (Color)0xffff, // color 0x0
  (Color)0xacd0, // color 0x1
  (Color)0x5268, // color 0x2
  (Color)0x0000, // color 0x3
  (Color)0x9008, // color 0x4
  (Color)0xca30, // color 0x5
  (Color)0xd8e4, // color 0x6
  (Color)0xfd42, // color 0x7
  (Color)0xcc68, // color 0x8
  (Color)0xfeb2, // color 0x9
  (Color)0xf720, // color 0xa
  (Color)0x8668, // color 0xb
  (Color)0x044a, // color 0xc
  (Color)0x0210, // color 0xd
  (Color)0x4439, // color 0xe
  (Color)0x7ddf  // color 0xf
};

const uint8_t IMAGE_DATA[] = {
  16,   // frame width
  16,   // frame height
  0x01, // number of frames (lower byte)
  0x00, // number of frames (higher byte)
  0,    // animation speed
  0x0,  // transparent color
  1,    // indexed color mode
  // frame 1/1
  0x00, 0x00, 0x03, 0x33, 0x33, 0x30, 0x00, 0x00, 
  0x00, 0x03, 0x3a, 0xaa, 0xaa, 0xa3, 0x30, 0x00, 
  0x00, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x00, 
  0x03, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x30, 
  0x03, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x30, 
  0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 
  0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 
  0x3a, 0xaa, 0xa3, 0x3a, 0xa3, 0x3a, 0xaa, 0xa3, 
  0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 
  0x3a, 0xa3, 0xaa, 0xaa, 0xaa, 0xaa, 0x3a, 0xa3, 
  0x3a, 0xa3, 0xaa, 0xaa, 0xaa, 0xaa, 0x3a, 0xa3, 
  0x03, 0xaa, 0x3a, 0xaa, 0xaa, 0xa3, 0xaa, 0x30, 
  0x03, 0xaa, 0xa3, 0x33, 0x33, 0x3a, 0xaa, 0x30, 
  0x00, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x00, 
  0x00, 0x03, 0x3a, 0xaa, 0xaa, 0xa3, 0x30, 0x00, 
  0x00, 0x00, 0x03, 0x33, 0x33, 0x30, 0x00, 0x00
};

Of course, it should not be forgotten to specify that the transparency color chosen here is white, so #ffffff = 0xffff (which is actually the color with index 0x0 in the palette)!

I don't see what the problem is?

tikkel

NEW 1 month ago

I think, it's a bug?

If i compile/upload DiggerMETA without setPalette (left) and if i compile/upload DiggerMETA with default setPalette (right), it looks:

If i take a screenshot from the second, it looks like the first (left).

I'm confused ...

Steph

1 month ago

I really have a hard time understanding what's bothering you... can you send me the image you're looking to transcode, please?

If you want to compile Digger META, you don't have to do anything, since the image is already encoded in the source code.

In order to be able to help you, I need you to clearly express to me what you are trying to do, what you are doing, and what are the difficulties you are facing...

Steph

NEW 1 month ago

tikkel tikkel

I really have a hard time understanding what's bothering you... can you send me the image you're looking to transcode, please?

If you want to compile Digger META, you don't have to do anything, since the image is already encoded in the source code.

In order to be able to help you, I need you to clearly express to me what you are trying to do, what you are doing, and what are the difficulties you are facing...

tikkel

1 month ago

I have foreked the orig. DiggerMETA with a bit changes, so its a little bit more playable for me.

If i load the default palette, it looks like inverted...

... try it self.

https://github.com/tikkel/Digger

I want the rocks a bit more violate - like the original...

deeph

NEW 1 month ago

Also, if I remember correctly, the built-in screenshot recorder don't work with custom palettes.

tikkel

NEW 1 month ago

Steph Steph

I have foreked the orig. DiggerMETA with a bit changes, so its a little bit more playable for me.

If i load the default palette, it looks like inverted...

... try it self.

https://github.com/tikkel/Digger

I want the rocks a bit more violate - like the original...

Steph

1 month ago

Okay... now I understand what your problem is:-)

Indeed... it just looks like the sprites were drawn with the default palette... but not in the right order!

So I wonder if, at the time Digger-Meta was developed, the official palette was not defined in a different order? You'd have to ask Sorunome about it.

I relied on the palette that is defined in the reference documentation.

Steph

NEW 1 month ago

tikkel tikkel

Okay... now I understand what your problem is:-)

Indeed... it just looks like the sprites were drawn with the default palette... but not in the right order!

So I wonder if, at the time Digger-Meta was developed, the official palette was not defined in a different order? You'd have to ask Sorunome about it.

I relied on the palette that is defined in the reference documentation.

Sutchig

NEW 1 month ago

I guess, since i'm using indexed half res, the color numbers are from the enum ColorIndex in https://github.com/Gamebuino/Gamebuino-META/blob/master/src/utility/Graphics/Graphics.h , not "Color".

No tool was used for converting the colors from original bitmap to sprite. Just pen and paper ;)

@tikkel: love your diamond animation :)

Steph

1 month ago

Well, that's it! It was a problem of order!
But why did they define different orders between the different display modes?...
It doesn't make sense!...
Well, it complicates things especially!

tikkel

1 month ago

... It looks a bit like the original:

At the beginning of this thread, I hoped that this effect would be possible on the META as well. But I have learned that you have to paint everything.
In the original KC85, a specific foreground color is switched on / off via an interrupt. You can read a technical blog about this ingenious trick: https://floooh.github.io/2017/01/14/yakc-diamond-scroll.html

Steph

NEW 1 month ago

Sutchig Sutchig

Well, that's it! It was a problem of order!
But why did they define different orders between the different display modes?...
It doesn't make sense!...
Well, it complicates things especially!

tikkel

1 month ago

Hello Steph, do you have a code snippet for me? How to load the current palette into an array. And then manipulate a single index and then set this array again?

tikkel

NEW 1 month ago

Sutchig Sutchig

... It looks a bit like the original:

At the beginning of this thread, I hoped that this effect would be possible on the META as well. But I have learned that you have to paint everything.
In the original KC85, a specific foreground color is switched on / off via an interrupt. You can read a technical blog about this ingenious trick: https://floooh.github.io/2017/01/14/yakc-diamond-scroll.html

You must be logged in in order to post a message on the forum

Log in