Mobile app version of vmapp.org
Login or Join
Cugini998

: Why is my 1-bit, 8x8 bitmap saving larger than 8 bytes in photoshop? I want my 8x8 to come out as raw binary; it should be 8 bytes, or 64 bits. However, it is coming out much larger than

@Cugini998

Posted in: #AdobePhotoshop #Bitmap #FileSize #Save

I want my 8x8 to come out as raw binary; it should be 8 bytes, or 64 bits. However, it is coming out much larger than that; saving as a PNG gave me 154 bytes; saving as a BMP gave me 64 bytes (8 times bigger than it should be.)

When I created a new image, Photoshop told me it would be 8 bytes, clearly this is not the case after saving.

The very, very lowest I could get it was 12 bytes, by using save for web and saving as wbmp, but I want it to be 8 bytes. It needs to be raw binary data. How can I solve this issue?

EDIT: And for that matter, other low bit amounts come out higher than expected. Why does a 4-bpp 80x16 image come out as 714 bytes instead of 640?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cugini998

1 Comments

Sorted by latest first Latest Oldest Best

 

@Kimberly620

File formats contain a lot of stuff. While its true that your bitmap may be 8 bytes but the container its stored in is not.

For example a PNG file structure needs all kinds of additional data such as a fingerprint, file structure info, compression scheme, and metadata. Even tough much of this can be stripped, Photoshop is by no means optimal, the file will still be much larger than 8 bytes.

Real world analog would be a a bucket. While the bucket is pretty light say 300g its proportional weight is quite small if you fill the bucket with 10 liters of water (3%) or sand (2% lose gravel). However, the relative weight of the container is pretty significant if you want to transport a centiliter of water (3000%).

All containers have a overhead. For example the size of the array must be told somewhere and that alone eats up as such as your image data. On this note its also worth noting that due to the way drives work each file will use up a fixed amount of space say from 512 bytes to several kilobytes or so having ultra small separate files does not make sense.

So what to do?


Encode all your image data into a single image file, called an image atlas.
Write your image data into your source code. It will still be bigger than 8 bytes due to need of storing the array length. This may be impractical though.
Write your own format, but you still get to the container problem. Again best to put multiple datasources into one storage file.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme