• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

BMP image size is wrong

New Here ,
Oct 10, 2016 Oct 10, 2016

Copy link to clipboard

Copied

I use photoshop version CS6.

I created graphics and try to save 1 bit .bmp file.I gave specific size of the image in pixel with 512 width and 142 as length.

I saved image into .bmp file. I found wrong Image size.

I opened the .bmp file with Hex editor and checked in the header section x"003E" = 62 bytes of the header information and x" 2382" = 9090 bytes of image data.

If I calculate the Image data information manually I would expect 512x142 = 9088 x 8 bits = 9088 bytes.

I could clearly see that saving into .bmp file created something wrong by writing 2 additional bytes.

If I open with some other image editor and save then these two bytes are romoved and file size is image data + header data = 9088+ 62 = 9150 bytes.

I see this problem with only adobe photoshot. May I know is there any special settings I need to adapt or it is known problem?

Below image is .bmp header which indicates all the information.

bmp_format_check.jpg

Fixing this issue is really helpful for me.

TOPICS
Actions and scripting

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Oct 11, 2016 Oct 11, 2016

Copy link to clipboard

Copied

CS6 is as is.  Adobe does not support old versions of their software. Additionally your calculation may be wrong the color depth is 8bit. If the BMP RGB cokor that means 8bits for Red, 8bits for Green and 8bits for Blue so 24bit color.  http://www.di.unito.it/~marcog/SM/BMPformat-Wiki.pdf

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 12, 2016 Oct 12, 2016

Copy link to clipboard

Copied

Hi JJMack,

Thank you very much for looking into the problem.

I followed the link you provided and checked bits/pixel which is located in "1C"h it indicates 1 bit per pixel. I cross check several times before posting my question about my calculations.

Here is my explansion.


At address "02"h indicates file size which according my file is "23C0"h = 9152 byte.
At address "0A"h indicates the offset where the bitmap data (pixels) can be found is "003E"h = 62 bytes

At address "22"h indicates the size of the raw BMP data(after header) "2382"h = 9090 bytes

If I combine both header size and raw data size 9090 + 62 = 9152 bytes, this is perfect for me.

But for me problem start when I check width and height of the pixels.

In the header it is clearly mention at "12"h width of the bitmap in pixels "0200"h = 512

at "16"h height of the bitmap in pixels "008E"h = 142

So total number Raw pixels I expect is 512 x 142 = 72704. As I mention "1C"h indicates bits/pixel which is "0001"h = 1 bit/pixel

I expect 72704 bits which is equal to 72704/8 = 9088 bytes. You can clearly see that 9090 bytes of the Raw data is written according to the header information, but I expect 9088 bytes. Which means 2 bytes more it indicates 16 pixels more raw data.

Even more suprise for me is if I open file which paint editor and close without modifying the file it is saved as 9150 bytes. Which is matching my calculation.

If new photoshop version solves this problem then I can use new version then I can ask my IT people.

Currently my verion information

Adobe Photoshop Version: 13.0.1 (13.0.1.3 20131024.r.34 2013/10/24:21:00:00) x64

Betriebssystem: Windows NT

Version: 6.2

May I Know until which version adobe supports.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 12, 2016 Oct 12, 2016

Copy link to clipboard

Copied

LATEST

You could try a trial of Creative Cloud Photoshop.  You may want to use a test machine though.  Creative Cloud broke my perpetual  CS6 install. CS6 update failed and showed I was back leveled to a broken version 13.0.    I reinstalled CS6 on top of the broken install to fix 13.0 the CS6 Update worked and Update my CS6 to subscription version 13.1.2. There are three versions of CS6.  Perpetual versions 13.0.1.3 Windows, 13.0.6 Mac and Subscription version 13.1.2.   The current Creative Cloud version of Photoshop is  CC 2015.5 there has been one updated to it and there are still many issues in CC 2015.5.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines