Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ErikGelfat
Pages: [1]

1
General Discussion / Photoshop BMP saved not correctly?
« on: September 07, 2019, 01:54:11 pm »
So I am making a program for DOS (don't question why), and I am using BMP files to print stuff on the screen, the thing is that the size of the file is very important to me because I am decoding every single byte, that's why I am using BMP.
Now, by default, for an 8 bit BMP, it should have 54 bytes for the header of the file, 256 * 4 bytes for the palette, and the reset is every single byte for every pixel of the picture for example if the picture is 40 by 40, the bytes of the files should be 54 + 256 * 4 + 40 * 40 which will be 2678 bytes.54 + 256 * 4 + 40 * 40

 

BUT for some reason photoshop save these files in two bytes more then they should, I guess they add something in the header, but I can fix it by opening the file in MS paint and saving it again, but the problem is now I have a file which is a 75*176 8 bit BMP file, which is 14,454 bytes, when it should be 14,278, and even MS paint can't fix it, I could copy the image from psd to ms paint and it saves correctly, but then the pallete is not whole which means I have a file which is less than 14,278 bytes.

 

What should I do?

 

 

Thanks, Erik

Pages: [1]