Images

Creations

geed

NEW 6 years ago

Sorunome Sorunome

Yes but how ? :)

I "converted" my pictures with the "image converter" on this site. I created them with piskel and they use only color of the GB palette.

What i must write in the header to do this ? for exemple, if i write 0xCA30 or MAGENTA, it doesn't work. Magenta's pixels aren't transparent.

Thanks

Sorunome

NEW 6 years ago

it's the palette index https://github.com/Gamebuino/Gamebuino-META/blob/master/src/utility/Graphics/Graphics.cpp#L56-L73

So, 0 for black, 1 for darkblue, 2 for purple etc.

geed

6 years ago

thanks it works !

maybe it would be interesting to mention it in the tutorial, it's not writing in the fonction description and the "palette index number" from the .xls provided by rodot is different from the one of the github !



geed

NEW 6 years ago

Sorunome Sorunome

thanks it works !

maybe it would be interesting to mention it in the tutorial, it's not writing in the fonction description and the "palette index number" from the .xls provided by rodot is different from the one of the github !



Davros

NEW 6 years ago

Has anyone had any trouble with certain images crashing the Gamebuino? I have one that is 64x112 indexed mode and anytime I try to use it Gamebuino crashes with "ERROR (2) hard fault". Besides my own converter I tried using the online image converter as well with the same result, it is weird since I'm not having issues with any other images.

Sorunome

6 years ago

Are the images in flash? Hard Fault can mean you just ran out of ra?.

Do you have a simple sketch to reprpoduce?

Sorunome

NEW 6 years ago

Davros Davros

Are the images in flash? Hard Fault can mean you just ran out of ra?.

Do you have a simple sketch to reprpoduce?

Davros

6 years ago

I put it up on pastebin: https://pastebin.com/AHe3u0E8


The image is a sprite tilesheet. It has both my image converter's version (with transparency enabled) and the online converter version without transparency you can uncomment, both crash the system either way. The Gamebuino is running in full 160x128 indexed mode when the crash happens, not sure if it crashes in full color mode or not.



Max

NEW 6 years ago

Hi Sorunome,
I'm a beginners ^^
For General Idea and Image sources, could you make an example with the same image for every case ?

Davros

NEW 6 years ago

Sorunome Sorunome

I put it up on pastebin: https://pastebin.com/AHe3u0E8


The image is a sprite tilesheet. It has both my image converter's version (with transparency enabled) and the online converter version without transparency you can uncomment, both crash the system either way. The Gamebuino is running in full 160x128 indexed mode when the crash happens, not sure if it crashes in full color mode or not.



Davros

6 years ago

Actually, it may be this same bug: https://github.com/Gamebuino/Gamebuino-META/commit/81816be295e8da037d5a1d9af8d08b1a3a59484a

Since it's the only image I'm using that's taller than it is wide I think that may be it.

Vincent

NEW 6 years ago

Hi everyone! I am a compelte noob to programming, so this might be a stupid question to ask. Anyway, I am trying to work in indexed mode to use a resolution of 160x128. For that, I included the line 

gb.display.init(160, 128, ColorMode::index);

in my void setup.

This is working fine, but when I make use of images (for example a 25x25 image, i converted with the Image to code converter to an indexed image https://gamebuino.com/creations/png-to-code), they are displayed in a very weird way with completely different colors. This is probably the case because I am not using the standart color palette. I have searched the website but cannot really find a solution for this problem. How do I use my own color palette in indexed mode? Sorry for the possibly stupid question, I am sure it has been answered before, but I was not able to understand how it works due to my lack of programming knowledge. I just cannot figure out where to put which lines of code to make it work. Has it something to do with the

const Color defaultColorPalette[16] = {
    Color::black,
    Color::darkblue,
    Color::purple,
    Color::green,
    Color::brown,
    Color::darkgray,
    Color::gray,
    Color::white,
    Color::red,
    Color::orange,
    Color::yellow,
    Color::lightgreen,
    Color::lightblue,
    Color::blue,
    Color::pink,
    Color::beige,
  };

function?

I would appreciate any help very much. If i have to be more specific, just let me know and I will do my very best :-)

Best,

Vincent

Sorunome

6 years ago

I'm sorry to say that the tool you linked has a bug with indexed images having an odd width! Try making your image one pixel wider, so that it is 26 pixels wide, put it through the tool, and then in the output image header change the width back to 25

Davros

NEW 6 years ago

Davros Davros

Actually, it may be this same bug: https://github.com/Gamebuino/Gamebuino-META/commit/81816be295e8da037d5a1d9af8d08b1a3a59484a

Since it's the only image I'm using that's taller than it is wide I think that may be it.

Sorunome

6 years ago

Did you try with that bugfix yet?

Sorunome

NEW 6 years ago

Davros Davros

Did you try with that bugfix yet?

Davros

6 years ago

I'm on Windows so I don't have an easy way to use the github version.

Sorunome

NEW 6 years ago

Vincent Vincent

I'm sorry to say that the tool you linked has a bug with indexed images having an odd width! Try making your image one pixel wider, so that it is 26 pixels wide, put it through the tool, and then in the output image header change the width back to 25

Vincent

6 years ago

It works! Hah, thank you so much for the quick answer! :-)

Vincent

NEW 6 years ago

Sorunome Sorunome

It works! Hah, thank you so much for the quick answer! :-)

Davros

NEW 6 years ago

Sorunome Sorunome

I'm on Windows so I don't have an easy way to use the github version.

Sorunome

NEW 6 years ago

Since there have been so many questions on how indexed stuff is working and how animations are working i extended those sections with additional information. I hope things are clearer now!

ragnarok93

NEW 6 years ago

Yaaaay, thanks for that tutorial <3 !!  Now I can finally animate things ^^