BMP2POK graphics conversion tool

Last iteration: fix some wrong output and lot of small fixes.

1 Like

Is the reorder palette implemented? If not, can you let me know how img2pok generates the palette? By amount of color in the pic or the horizontal order from 0,0?

just drag and drop colors in the listbox.
The colors are generated by top avarage using “Extract to palette from image”, or using all colors with “Extract all colors”.

2 Likes

whats this using for ui? is it portable to mac/linux?

1 Like

Hi @adekto, sorry for late response. I take some time to check it under Ubuntu. It’s .NET and plain WinForm so it should run even in Linux/Mac.

I take a clean machine with Ubuntu 17.04 moved the exe there then run in terminal

sudo apt-get install mono-runtime
sudo apt-get install libmono-system-windows-forms4.0-cil

now from console I run the img2pok.exe with mono:

mono yourpathto/img2exe

and it seems to work. But I’m not a Linux user. I have no way to test under Mac now, but it should be more or less the same.

Just fund a bug, the imported palette was not respected if using an external image as reference.
Also modify the exported c file if splitting the sprite sheet. In that case the output is an handy 2D array

3 Likes

Just re-read that post, something similar you say? Game-wise or real-colour-wise?

img2pok bump to 0.4

Transparent color mapped to first color in palette, better handling of mapping colors.
Json import export require external dll, so included here

[Edit:]
also removed locking on original image, so you can edit it and reload without closing the software.

2 Likes

Could we please make this a part of the GitHub repo ? It could be a submodule included in the tools or its own repository

Time to polish! :grin:
Really it will be a honor! Probably I should clean the code and maybe optimize some routine.
My main concern is its written in C# (Win Form) so it will be like a white fly among all that C/C++ stuff :relaxed:

So yes. I think I’ll go for a public repo with my account, then we’ll see the best way to join up.

[Edit]
And here it’s a draft: https://github.com/Effer/img2pok

Forked! Thanks. Now available via Pokitto repo

1 Like

Any chance someone can drop in an 8bit (256Color) option?

1 Like

in 565 rgb? or you still want that in a pallet?

Something like this?

Please give a try https://github.com/Effer/img2pok/blob/master/Binaries/Latest.zip

4 Likes

Yup, that should do it! Thanks.

Although it crashes if you try to change the number of columns with an 8bit palette.

1 Like

Whops! Didn’t test that. I neither test the output with 8 bit mode… feedback please.
https://github.com/Effer/img2pok/blob/master/Binaries/Latest.zip

Kindly suggested by @trelemar:
Sprite get the name from the image filename. Then you can edit as you need.
There’s no check on valid symbol name.

Latest version always here:
https://github.com/Effer/img2pok/blob/master/Binaries/Latest.zip

3 Likes

That was quick. Thanks so much! It’ll speed up a tedious step of renaming the array every time I update the art.

1 Like

@HomineLudens : I think i’ve found a bug

In the 0.4 version (but also latest v0.7), if I open a flat red 8x8 pixel indexed color .bmp square, the right and bottom edges are blurred. This blur only comes from the img2pok program, the .bmp itself is fine

It’s a “feature” of the paint panel :grin:
Not sure if I can fix it. Anyway output is not affected it’s just a visual artifact. Thanks for reporting.