What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

4 bit BMP


Hey Bob,

If memory serves me, 2 to the power of 4 (4 bits) minus 1 = 15 colours - i.e. the maximum number of different objects that can digitally be represented by 4 bits is 15 - (2^0) + (2^1) + (2^2) + (2^3) = 1 + 2 + 4 +8 = 15. Thus, with my limited PS knowledge, you have two options - adjust the image mode to "Indexed color" and select the 15 colours you want to retain. Then it will allow you to save the image as a 4 bit one.

Or otherwise you can save it for the web/as a gif with 15 colours. This is easier in that it selects the colours for you - depending on the reduction algorithm used (perceptual, selective, etc.). Then open the gif file and save that as your 4 bit BMP image.

And Bob's your uncle!
 
Well, it works like this see (and there's probably a more concise and more technical explanation somewhere that's probably more correct too!):

Digital is either a one or a zero - binary/ two as base number - that is everything is expressed as a power of two. I.e. two different characters are used for representation. Hexadecimal - 16 base number, has 16 characters for each digit - 0..9, A..F

So to be able to express an unbroken sequence of numbers (0, 1, 2, 3, ... ), we build a binary string in terms of the base value - being two. First bit is 2 to the power of zero, second bit is two to the power of 1, third is 2 to the power of 2, etc. - the bit number being one less than the power applied to it to determine the decimal (base 10) value.

Thus for 4 bit representation we have:
Minimum value (all zeros) => 0000 = 0 x 1 + 0 x 2 + 0 x 4 + 0 x 8 = 0
Maximum value (all ones) => 1111 = 1 + 2 + 4 + 8 = 15.

A formula for this can be deduced by noting that adding a 1 in binary would take it to the next bit value => 10000 - decimally represented by 2 to the power of 4 (since it's the 5th bit).

So we can say the maximum value a bit representation of n (where n is a number) can have is 2 to the power of n minus 1 (in other words, one less than the value of the next number in our sequence).
 
Dodo, it's not that I don't understand binary, hexadecimal or any other numbering system it's the minus -1 that confuses me. What I have learned is that 4 bits is 16 values and therefore 16 colors and not 15. I just don't get it why you substract 1, please explain. \:]
 
You're right - I made a booboo - luckily you spotted it! [oops] I forgot to count 0 as an object too - normally in decimals it would be true - since you have a zero = 0 + 1 = 1 (so you forget about the zero effectively). But as far as objects go, a zero is an object too. Thus 0 - 15 colours = 16 colours in total.

I think my confusion results from the fact that even if I save a gif as 16 colours and open it again, PS won't allow me to save it as a 4 bit BMP. So I told myself - "hey, what about the minus 1"!

So it must be that the 0000/1111 value is used to indicate something else - end of file maybe? Hopefully one of the technically minded folks can help us out here.
 
Dodo said:
I think my confusion results from the fact that even if I save a gif as 16 colours and open it again, PS won't allow me to save it as a 4 bit BMP.
Yes Dodo, that's strange indeed [confused]
I'm going to do some research on that one. ;)
 
Strange, seems to work for me Dodo (and Bob).
I took an image, saved it as a GIF (for options look at screenshot), closed the file, opened it and the 4-bit option is available when I want to save it as a BMP.

I double checked, to make sure that I was still dealing with a 16 colors GIF file.

What version of Photoshop do you use, maybe that makes a difference. I use CS.

You might also find the solution if you compare your GIF options with mine. There must be a normal explantion for this behaviour, but I don't know of one (yet).
 
Seems to me an old bug when I read what Adobe's Chris Cox has to say about this;

"Hi.
I'm running into a strange problem. I need to make some 16 color/4-bit .bmp files (to put into an icon file). I make the image an indexed file with 16 colors, and save the file as a bitmap, choosing the 4 bit option. However, when I import in into another program, or check it's properties in the File Browser, it is shown as being an 8 bit file. What?!?

Help?
Message 2 in thread
From: Thee_DarkOverLord (mat@matsimons.co.uk)
Subject: Re: Can't save a 4-bit bitmap file!


View this article only
Newsgroups: adobe.photoshop.windows
Date: 2003-03-28 08:08:04 PST


I shouldnt worry about it, just go ahead and use them, will probably still work. Not a good answer i know, but is it realy a issue for you? of course it would be nice to know how. HAng arround and im sure you will get the answer.
Message 3 in thread
From: Chris Cox (member@adobeforums.com)
Subject: Re: Can't save a 4-bit bitmap file!


View this article only
Newsgroups: adobe.photoshop.windows
Date: 2003-03-28 20:07:29 PST


I think that's a known bug in the BMP plugin codem (that I fixed a few months ago)."





http://groups.google.ca/groups?hl=e...-8&selm=1de87ec8.-1%40WebX.la2eafNXanI&rnum=9[/b]
 
Thanks for going to all that trouble Elysian - obviously not just for me but for your own peace of mind! I use PS 7 - and tested it again just now - making sure my selections were the same as yours - still no 4 bit when at 16 colours - at 15, yes. Must be a bug then.

I guess this is one of those days I can count myself lucky for not needing to use 4 bit bitmaps!
 

Back
Top