You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add bmp to extra formats and as option for zip file.
most game engines and libraries all support bmp and it is more performant.
you could reuse most code from the C style export.
according to wikipedia, using the OS/2 1.x BITMAPCOREHEADER format,
you could use the following c-pseudocode:
typedef struct {
// header
uint16 Signature,
uint32 Filesize,
uint32 Reserved,
uint32 DataOffset,
// spec says i should make this two structs, but i'm lazy
// we use OS/2 BITMAPCOREHEADER because otherwise no transparent
// OS/2 BITMAPCOREHEADER (not 2)
uint32 BitmapheaderSize,
int32 Width,
int32 Height,
uint32 Planes,
// we could do palletised, but i'm lazy (plus the code is already there)
uint16 BitCount,
uint32 Compression,
uint32 ImageSize,
// these specify the DPI but in a metric kind of way
int32 XpixelsPerM,
int32 YpixelsPerM,
uint32 ColorsUsed,
uint32 ColorsImportant
} header_t;
// i don't know if users can specify their DPI, but pass it through anyway
int makeBMP(int32 Width, int32 Height, int32 pixelsPerM, char* imagedata, int outfile) {
#define fullheadersize
#define datasize (Width * Height * 4)
header_t header;
header.Signature = 'BM'; // spec says so
header.Filesize = datasize + fullheadersize;
header.Reserved = 0;
header.dataOffset = fullheadersize + 1;
header.BitmapheaderSize = 16; // spec says so
header.Width = Width;
header.Height = Height;
header.Planes = 1; // spec says so
header.BitCount = 32; // no palet, transparent
header.Compression = 0; // no compression
header.ImageSize = datasize; // could set this to 0, but we're kind
header.XpixelsPerM = pixelsPerM;
header.YpixelsPerM = pixelsPerM;
header.ColorsUsed = 0; // default
header.ColorsUsed = 0; // default
write(header, fullheadersize, outfile);
/////////////////////////////////////////////////////////////////
// WARNING: //
// i am assuming that the ABRG that piskel uses is compatible. //
// you may need to do some byte swapping. //
/////////////////////////////////////////////////////////////////
write(imagedata, datasize, outfile);
return 0;
}
Please let me know.
The text was updated successfully, but these errors were encountered:
Add bmp to extra formats and as option for zip file.
most game engines and libraries all support bmp and it is more performant.
you could reuse most code from the C style export.
according to wikipedia, using the OS/2 1.x BITMAPCOREHEADER format,
you could use the following c-pseudocode:
Please let me know.
The text was updated successfully, but these errors were encountered: