Image Transcoder

Créations

Steph

il y a 5 ans

Transcodeur d’images polyvalent

Voici un nouvel outil pour transcoder vos images en C++. Il reconnaît les formats d’image suivants : PNG, GIF, JPG et BMP. Et il vous offre le support de tous les modes d’affichage qui existent sur la META :

  • RGB565 pour les résolutions 80x64 et 160x128
  • RGB565 avec couleurs indexées pour les résolutions 80x64 et 160x128
  • RGB565 pour l’usage de l’API gb.tft en 160x128

Dans le cas des images aux couleurs indexées, le transcodeur génère également le code de la palette de couleurs que vous lui aurez fournie.

Concernant les spritesheets et les tilesets

Vous devez fournir une image en accord avec les valeurs renseignées pour la largeur et la hauteur des frames. Le transcodeur doit pouvoir effectuer un découpage automatique de l’image pour isoler chaque frame. Sur l’image, les frames doivent être disposés sur une grille qui sera lue, de gauche à droite d’abord, et de haut en bas ensuite. Si la grille comporte des frames totalement transparents, ils seront tout simplement ignorés. Attention : si vous ne spécifiez aucune couleur de transparence, c’est la première couleur décodée qui jouera ce rôle. Autrement dit, si un frame est entièrement peint avec cette couleur, il sera automatiquement considéré comme totalement transparent et donc ignoré.

Concernant les images aux couleurs indexées

Ce type d’images doit obligatoirement être accompagné d’une palette de couleurs. Par défaut, le transcodeur utilise la palette officielle de la Gamebuino. Si vous avez créé votre image avec une autre palette, vous devez impérativement la fournir au transcodeur. Il s’agit simplement d’une image supplémentaire (que vous pouvez également glisser-déposer dans l’encart approprié), où chaque pixel représente une couleur. Cette palette doit comporter exactement 16 pixels. Les dimensions de la palette peuvent être 16x1, 8x2, 4x4, 2x8 ou 1x16.

Si votre image comporte moins de 16 couleurs, vous devez impérativement compléter votre palette avec n’importe quelle couleur de votre choix (présente ou non sur l’image).

Si votre image comporte des pixels transparents, la couleur de transparence doit figurer dans votre palette. Dans le cas contraire, c’est la première couleur de la palette qui jouera ce rôle. Par conséquent, tout frame qui serait entièrement peint avec cette couleur sera considéré comme transparent et donc ignoré.

L’exemple ci-dessous illustre une manière de définir vos sprites avec la même palette de couleurs, si vous précisez bien 0xff00ff comme couleur de transparence :

Voir la création

jicehel

NEW il y a 5 ans

English version just below after french version...  :)

Génial!  merci Steph, tu apportes vraiment beaucoup à notre petite communauté. Garde la patates et continues d'avoir plein d'idées.  :)

Great ! Thanks Steph, you make great job for our group of META owners. Continue to have so many energy and so many ideas :)

Codnpix

NEW il y a 5 ans

Salut ! Tu as été vite finalement ! Génial, merci beaucoup !!


Thanks a lot for that great contrib Steph ! This is going to help a lot.

Steph

NEW il y a 5 ans

Don't forget that our English-speaking friends will want to be able to read your comments as well ;-)

fabpianista

NEW il y a 5 ans

Hi guys! I'm trying to use both of the image transcoders on Chrome and Safari for Mac and they don't work. :(

Maybe I'm doing something wrong? I'm trying to transcode an image with 160x128 pixels.

Any help you be much appreciated. Merci! :)

Steph

il y a 5 ans

Hi fabpianista,

I'm on macOS and ImageTranscoder works perfectly with Chrome and Safari!

What exactly is your problem?

Steph

il y a 5 ans

Here is a screenshot from Safari, but we get exactly the same thing with Chrome !

Steph

NEW il y a 5 ans

fabpianista fabpianista

Hi fabpianista,

I'm on macOS and ImageTranscoder works perfectly with Chrome and Safari!

What exactly is your problem?

Steph

NEW il y a 5 ans

fabpianista fabpianista

Here is a screenshot from Safari, but we get exactly the same thing with Chrome !

fabpianista

il y a 5 ans

Hi Steph,

Many thanks for your reply! It turns out that the conversion tool was not working with BMPs. After converting my sprites to PNGs, it worked as intended. :)

Muito obrigado! :D

fabpianista

NEW il y a 5 ans

Steph Steph

Hi Steph,

Many thanks for your reply! It turns out that the conversion tool was not working with BMPs. After converting my sprites to PNGs, it worked as intended. :)

Muito obrigado! :D

Steph

il y a 5 ans

Com prazer!

Of course it works with BMP files!
I just did the test with different color depths: 32, 24, 16, 8, 4 and 1 bit :-)
Maybe your creative tool generates a strange format?

Steph

NEW il y a 5 ans

fabpianista fabpianista

Com prazer!

Of course it works with BMP files!
I just did the test with different color depths: 32, 24, 16, 8, 4 and 1 bit :-)
Maybe your creative tool generates a strange format?

sentinel87

NEW il y a 4 ans

Steph this is great tool. Thx for sharing it :D Created all images for my game so far :)

Steph

il y a 4 ans

I'm very happy that it was able to help you ;-)

Steph

NEW il y a 4 ans

sentinel87 sentinel87

I'm very happy that it was able to help you ;-)

DavTheDev

NEW il y a 4 ans

I used it as well for all my graphics. Real time saver!

There's one little thing that may be a bug: it is impossible to scroll down in the ouput code box and manually select what to copy & paste, especially when the image is large. Just saying that, because I don't need to get the palette definition back with each new indexed image I'm adding to the game.
Something that would be nice as well is autodetecting the width and height from the provided image source. Especially when multiple frames are not needed.

Steph

il y a 4 ans

Hello Dav,

Glad to know you find the tool useful.

In fact, it's not a bug at all... to be able to scroll through the text field and copy a selection, you have to give it keyboard focus.

And thanks for the improvement tips... I'll think about it for the next version, as soon as I have time!

Steph

NEW il y a 4 ans

DavTheDev DavTheDev

Hello Dav,

Glad to know you find the tool useful.

In fact, it's not a bug at all... to be able to scroll through the text field and copy a selection, you have to give it keyboard focus.

And thanks for the improvement tips... I'll think about it for the next version, as soon as I have time!