Archived

This topic is now archived and is closed to further replies.

Sickilla

converter

Recommended Posts

no, it wont work, its just like all the others, it only can convert to 24,8,4 and 2-bit color but no 16-bit. photoshop can convert it but it saves it into .psd or .RAW format and not in .bmp.

X4J

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Not exactly what you asked for, but if you don''t really need BMP format then consider writing your own converter to go from 24 bpp to 16 bpp. One Implementation: Divide each color component (R,G,B) value for each pixel by the maximum limit for a byte, 256. Store this as a float in the range [0..1]. Then scale this value to the range for color component values in 16 bit. If the format is 5-5-5, then its 2^5=32 max per color component. Store the return value in a byte. Then just bitshift together the color components for each pixel into a short, repeat for all pixels, are ur in 16-bit. I don''t think BMP supports 16-bit color natively, I''d just (for testing) dump to a raw file and see what you get when you render. For actual use, you could roll ur own format or find some format which does support 16-bit color.

Share this post


Link to post
Share on other sites
Worse comes to worse, just write your own little program (a simple console program will work fine).

Just write the bitmap header, (determine whether you want the 16 bit to be 555 or 565), and take each pixel and convert it.

Fortunately, converting a bitmap to another format (24 to 16), you don''t have to worry about flipping the image or the colors.
And 24 bit takes 3 bytes per pixel, where 16, takes 2.

Just take the byte value, change to the correct value, and add it to a 2 byte value using shifts.

Then just write the 2 byte value.

There''s plenty of info on how to do it on gamedev.

Share this post


Link to post
Share on other sites
I don''t think there is a 16 bit bitmap formap standard in any paint program. You''re probably (as has been suggested) going to have to write your own conversion utility. You''ll have to edit them in the paint program in whatever format you want, and then convert them before you load them into your game (you''ll of course have to write a function to load the 16 bit image from whatever format you use to save it).

It might be good to write a function to load standard 24 bit bitmaps as well, so you can use them for testing and when you release the game (ie: when data size really matters) you can convert them all and ship the converted images with the game. You will of course have to test extensively and make sure the converted format is read in correctly.

Share this post


Link to post
Share on other sites
It''s late and I didn''t really read all the posts, so if this sounds dumb please forgive, but...

If photoshop will convert it, use that, and then take the .psd or .RAW format that you are given and convert that to .bmp with Irfanview.

I really don''t know anything about this, but if you are just trying to convert one lousy file, that strikes me as a ghetto work around.

Share this post


Link to post
Share on other sites