Number of colours in a GIF

DF
Posted By
Derek Fountain
Mar 20, 2005
Views
657
Replies
23
Status
Closed
I want to save an image as a GIF file (or PNG would do), without loosing any colours. Filesize is important. With 256 colours in the GIF it looks identical to the original as far as I can see. With 128 colours it might be identical, but my eyes might be playing tricks on me. How can I get a count of the actual number of colours in my image? Or, failing that, how can I set the GIF save such that I get as big a palette as I need to accurately save the image?


The email address used to post is a spam pit. Contact me at http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

EG
Eric Gill
Mar 20, 2005
Derek Fountain wrote in
news:423d3d66$0$2713$:

I want to save an image as a GIF file (or PNG would do), without loosing any colours. Filesize is important. With 256 colours in the GIF it looks identical to the original as far as I can see. With 128 colours it might be identical, but my eyes might be playing tricks on me. How can I get a count of the actual number of colours in my image? Or, failing that, how can I set the GIF save such that I get as big a palette as I need to accurately save the image?

What is it about ‘Save for Web’ that it never occurs to people saving graphics in web formats to use it?
I
iehsmith
Mar 20, 2005
On 3/20/05 4:09 AM, Derek Fountain uttered:

I want to save an image as a GIF file (or PNG would do), without loosing any colours. Filesize is important. With 256 colours in the GIF it looks identical to the original as far as I can see. With 128 colours it might be identical, but my eyes might be playing tricks on me. How can I get a count of the actual number of colours in my image? Or, failing that, how can I set the GIF save such that I get as big a palette as I need to accurately save the image?

OK, my take on this from PS 6.0.1/Mac:
If you have it set to Perceptual or Adaptive (whatever) with 256 colors selected and the Color Table uses all 256, then that’s the number of colors. When images don’t have 256 colors this will be reflected in the Color Table and just below it you’ll see the color count. If you need it to be smaller you should experiment with the Optimize menu which is accessed by an arrow to the right of Settings. Set a target image size (K) in Optimize to files size and see what it does. The number of colors will again be shown below the Color Table. This works with both GIF and PNG-8.

hth,
inez

(i don’t explain things too good sometimes;)
I
iehsmith
Mar 20, 2005
Oh, you can also select and delete colors in the Color Table, like when they are so similar as to be redundant.

K, it’s 4am, off to bed;
inez
I
iehsmith
Mar 20, 2005
On 3/20/05 5:08 AM, Eric Gill uttered:

What is it about ‘Save for Web’ that it never occurs to people saving graphics in web formats to use it?

Hey, so many people refuse to save as anything but JPEG (so they can cheat and squeeze them down to thumbnails), I’m just glad to see someone using GIF.

When an image is using 256 colors and gets ugly when reduced from there as GIF, sometimes JPEG does actually turn out to be better looking AND smaller too, depends on the image.

inez
(now really going to bed)
DF
Derek Fountain
Mar 20, 2005
What is it about ‘Save for Web’ that it never occurs to people saving graphics in web formats to use it?

That’s exactly what I am using.


The email address used to post is a spam pit. Contact me at http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>
T
Tacit
Mar 20, 2005
In article
<423d3d66$0$2713$>,
Derek Fountain wrote:

I want to save an image as a GIF file (or PNG would do), without loosing any colours. Filesize is important. With 256 colours in the GIF it looks identical to the original as far as I can see.

Go to Image->Mode->Indexed Color. If the dialog box that comes up reads any palette except "Exact," it is not possible to preserve all the colors. If an image has 256 or fewer colors, Photoshop will permit you to save with an "exact" palette; if it has more, Photoshop won’t.

If your image is a photographic picture, then the odds of you being able to save all the colors in a GIF are virtually zero. Remember, every shade of every color counts as a "color" in the 256-color limit; if you have fifteen shades of blue, each of which is very slightly different, they count as 15 color. Most photographic images contain thousands or millions of colors; it is virtually certain that if you save a photographic image as a GIF, you will lose colors.

Why is it necessary to preserve all the colors? If you can explain what you are attempting to do, and why, we may be able to help more.


Art, photography, shareware, polyamory, kink, and more!
www.xeromag.com/franklin.html
T
toby
Mar 21, 2005
Derek Fountain wrote:
… How can I get a count
of the actual number of colours in my image?

http://www.telegraphics.com.au/sw/#countcolours
DF
Derek Fountain
Mar 21, 2005
Why is it necessary to preserve all the colors? If you can explain what you are attempting to do, and why, we may be able to help more.

I was doing a rather (read "completely" :)) unscientific test of a new camera lens. I have a bunch of 256×256 image crops which I wanted to put up on the web in order that assorted experts can give me some feedback on my test, the lens and my conclusions.

I was particularly interested in contrast and sharpness. I didn’t want to save as JPEG because JPEG artifacts can look like blurring and therefore affect perception of the lens sharpness performance. So I decided to use GIF, but without reproducing all the colours correctly the dithering seemed to have the effect of reducing contrast. I whacked up the number of colours in the save for web dialog and got the image looking the same as the original as my inexperienced eye could tell, but then the file size was huge – several hundred KB. So I wanted to keep the GIF file but only use as big a colour table as is required in order to keep the filesize down.

In the end I thought "to hell with it" and uploaded a couple of big files. 🙂 The piece is online here:

http://www.derekfountain.org/17_40.php


The email address used to post is a spam pit. Contact me at http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>
T
Tacit
Mar 21, 2005
In article
<423e2b23$0$26198$>,
Derek Fountain wrote:

I was doing a rather (read "completely" :)) unscientific test of a new camera lens. I have a bunch of 256×256 image crops which I wanted to put up on the web in order that assorted experts can give me some feedback on my test, the lens and my conclusions.

I’m assuming the sections of the images you posted were not downsampled or resampled, as that would also introduce blurriness.

I was particularly interested in contrast and sharpness. I didn’t want to save as JPEG because JPEG artifacts can look like blurring and therefore affect perception of the lens sharpness performance. So I decided to use GIF, but without reproducing all the colours correctly the dithering seemed to have the effect of reducing contrast. I whacked up the number of colours in the save for web dialog and got the image looking the same as the original as my inexperienced eye could tell, but then the file size was huge – several hundred KB. So I wanted to keep the GIF file but only use as big a colour table as is required in order to keep the filesize down.

It looks to me like the images are black and white. If this is so, you could use Image->Mode->Grayscale, then save as GIF. A grayscale 8-bit image contains 256 shades of gray, and can be saved as a GIF with no loss whatsoever.


Art, photography, shareware, polyamory, kink, and more!
www.xeromag.com/franklin.html
J
jjs
Mar 21, 2005
"Derek Fountain" wrote in message
Why is it necessary to preserve all the colors? If you can explain what you are attempting to do, and why, we may be able to help more.

I was doing a rather (read "completely" :)) unscientific test of a new camera lens.

Sure is. Why did you even bother?
DF
Derek Fountain
Mar 21, 2005
I’m assuming the sections of the images you posted were not downsampled or resampled, as that would also introduce blurriness.

Correct. :o)

It looks to me like the images are black and white. If this is so, you could use Image->Mode->Grayscale, then save as GIF. A grayscale 8-bit image contains 256 shades of gray, and can be saved as a GIF with no loss whatsoever.

I thought about that but the images are actually colour – they just happen to be of a subject which is pretty much black and a white. The next experiment I do will not be of a newspaper, so will not offer a "Greyscale" opportunity. I concluded that that shortcut isn’t actually the answer to my problem.


The email address used to post is a spam pit. Contact me at http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>
DF
Derek Fountain
Mar 21, 2005
I was doing a rather (read "completely" :)) unscientific test of a new camera lens.

Sure is. Why did you even bother?

Because I don’t take my normal photographs in a scientifically controlled environment either.


The email address used to post is a spam pit. Contact me at http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>
R
RSD99
Mar 21, 2005
You could have used PNG …

"Derek Fountain" wrote in message
Why is it necessary to preserve all the colors? If you can explain what you are attempting to do, and why, we may be able to help more.

I was doing a rather (read "completely" :)) unscientific test of a new camera lens. I have a bunch of 256×256 image crops which I wanted to put
up
on the web in order that assorted experts can give me some feedback on my test, the lens and my conclusions.

I was particularly interested in contrast and sharpness. I didn’t want to save as JPEG because JPEG artifacts can look like blurring and therefore affect perception of the lens sharpness performance. So I decided to use GIF, but without reproducing all the colours correctly the dithering
seemed
to have the effect of reducing contrast. I whacked up the number of
colours
in the save for web dialog and got the image looking the same as the original as my inexperienced eye could tell, but then the file size was huge – several hundred KB. So I wanted to keep the GIF file but only use
as
big a colour table as is required in order to keep the filesize down.
In the end I thought "to hell with it" and uploaded a couple of big files. 🙂 The piece is online here:

http://www.derekfountain.org/17_40.php


The email address used to post is a spam pit. Contact me at http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>
DF
Derek Fountain
Mar 21, 2005
RSD99 wrote:

You could have used PNG …

Indeed, as I said in my original post. But can you set the colour table of a PNG to have an exact defined number of colours, and if so, how would I know what the magic number is?


The email address used to post is a spam pit. Contact me at http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>
J
jjs
Mar 21, 2005
"Derek Fountain" wrote in message
I was doing a rather (read "completely" :)) unscientific test of a new camera lens.

Sure is. Why did you even bother?

Because I don’t take my normal photographs in a scientifically controlled environment either.

Strange. In any event, to enhance your web page’s content you might look back in a couple years and count the hours you have spent on technical issues and then revisit your rationalization for going digital over film. I believe you will find similar investments in learning time are necessary for each.
R
RSD99
Mar 21, 2005
IMHO: The question really should be … why do you think you want to convert the file to Indexed Color?

What is unsuitable about using a continuous color encoding scheme as it exists in the garden variety image file formats … such as TIF, PNG, TARGA, or even BMP … since your original statement of your objective was to

"… I want to save an image as a GIF file (or PNG would do), without loosing any
colours. …"

"Derek Fountain" wrote in message
RSD99 wrote:

You could have used PNG …

Indeed, as I said in my original post. But can you set the colour table
of a
PNG to have an exact defined number of colours, and if so, how would I
know
what the magic number is?


The email address used to post is a spam pit. Contact me at http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>
B
Brian
Mar 21, 2005
jjs wrote:

"Derek Fountain" wrote in message

I was doing a rather (read "completely" :)) unscientific test of a new camera lens.

Sure is. Why did you even bother?

Because I don’t take my normal photographs in a scientifically controlled environment either.

Strange. In any event, to enhance your web page’s content you might look back in a couple years and count the hours you have spent on technical issues and then revisit your rationalization for going digital over film. I believe you will find similar investments in learning time are necessary for each.
Actually, Mr opinionated know all (who never stops making negative statements to people in these newsgroups who are happy with what they are using, even if it does not conform to what you like to use!) – in the future it is most doubtful anyone will even remember what film was in the consumer world….it will be better than film ever was, with carry all of its inherant benefits.
Get up with the times and convenience jjs, or stay in the past and keep your opinion with it. I am sick of reading your posts having a go at everyone who has gone digital.
For the record, I am using film at the moment still and have a "toy" digital camera. As work becomes more demanding, I am definitely buying a pro digital slr. I already missed out on what would have been a good regular client because I did not have digital and he insisted on only dealing with a pro "digital" photographer. He had his reasons for that and they were valid ones! I was not willing to purchase a $3000+ camera at that time just to deal with him.

Brian.
J
jjs
Mar 21, 2005
"Brian" wrote in message
jjs wrote:

"Derek Fountain" wrote in message

I was doing a rather (read "completely" :)) unscientific test of a new camera lens.

Sure is. Why did you even bother?

Because I don’t take my normal photographs in a scientifically controlled environment either.

Strange. In any event, to enhance your web page’s content you might look back in a couple years and count the hours you have spent on technical issues and then revisit your rationalization for going digital over film. I believe you will find similar investments in learning time are necessary for each.

Actually, Mr opinionated know all (who never stops making negative statements

I wasn’t writing to you, and I doubt that Mr. Fountain would take my comment as being negative.

[…] – in the future it is most doubtful anyone will even remember what film was in the consumer world….

We are not talking about the future, but _today_.

Get up with the times and convenience jjs, or stay in the past and keep your opinion with it. I am sick of reading your posts having a go at everyone who has gone digital.

Now who is being terribly sensitive, Brian? Clearly, it is you who feels he must defend digital as if it were a child needing protection. Believe me, it doesn’t need you espousing virtues.

For the record, I am using film at the moment still and have a "toy" digital camera.

So goodie-goodie for you. If you had an open mind you might question what I do and what I use, but you run away with reflexive knee-jerks. I have DSLRs – four, in fact. I also shoot digital video – Canon XL1 – and I use MF and LF, and I’ve been in the ‘digital world’ since 1976, and in the film world since the early Sixties.

As work becomes more demanding, I am definitely buying a pro digital slr.

Of course you will, but you won’t escape the work part. You will still have to learn the same techniques you would with film, and then some.
B
Brian
Mar 22, 2005
jjs wrote:

"Brian" wrote in message

jjs wrote:

"Derek Fountain" wrote in message

I was doing a rather (read "completely" :)) unscientific test of a new camera lens.

Sure is. Why did you even bother?

Because I don’t take my normal photographs in a scientifically controlled environment either.

Strange. In any event, to enhance your web page’s content you might look back in a couple years and count the hours you have spent on technical issues and then revisit your rationalization for going digital over film. I believe you will find similar investments in learning time are necessary for each.

Actually, Mr opinionated know all (who never stops making negative statements

I wasn’t writing to you, and I doubt that Mr. Fountain would take my comment as being negative.

[…] – in the future it is most doubtful anyone will even remember what film was in the consumer world….

We are not talking about the future, but _today_.

Get up with the times and convenience jjs, or stay in the past and keep your opinion with it. I am sick of reading your posts having a go at everyone who has gone digital.

Now who is being terribly sensitive, Brian? Clearly, it is you who feels he must defend digital as if it were a child needing protection. Believe me, it doesn’t need you espousing virtues.

For the record, I am using film at the moment still and have a "toy" digital camera.

So goodie-goodie for you. If you had an open mind you might question what I do and what I use, but you run away with reflexive knee-jerks. I have DSLRs – four, in fact. I also shoot digital video – Canon XL1 – and I use MF and LF, and I’ve been in the ‘digital world’ since 1976, and in the film world since the early Sixties.

As work becomes more demanding, I am definitely buying a pro digital slr.

Of course you will, but you won’t escape the work part. You will still have to learn the same techniques you would with film, and then some.

Well, I have probably don’t have a "lot" of learning to do at all. Even though I shoot film, I have it scanned and work digitally anyway (a lot of the time), so I have been digital in that regard for the last 8 years.

As far as knee-jerk reactions go, think about my comments! All I am basically saying is…Stop crapping on to people about choosing to go digital!! I keep reading thread after thread, jjs criticising everyone who is choosing to use a digital camera. Now you are telling me you use one (4 actually). Are you some sort of psychopath? You sure sound like it.

You are always out to impress, too. You don’t impress me, you are all mouth. Post some of your images and let’s see what a fantastic photographer you are, seeing that you are always criticising people’s choices. Show us some of your work!

Brian.
B
Brian
Mar 22, 2005
jjs wrote:

"Brian" wrote in message

jjs wrote:

"Derek Fountain" wrote in message

I was doing a rather (read "completely" :)) unscientific test of a new camera lens.

Sure is. Why did you even bother?

Because I don’t take my normal photographs in a scientifically controlled environment either.

Strange. In any event, to enhance your web page’s content you might look back in a couple years and count the hours you have spent on technical issues and then revisit your rationalization for going digital over film. I believe you will find similar investments in learning time are necessary for each.

Actually, Mr opinionated know all (who never stops making negative statements

I wasn’t writing to you, and I doubt that Mr. Fountain would take my comment as being negative.

[…] – in the future it is most doubtful anyone will even remember what film was in the consumer world….

We are not talking about the future, but _today_.

Get up with the times and convenience jjs, or stay in the past and keep your opinion with it. I am sick of reading your posts having a go at everyone who has gone digital.

Now who is being terribly sensitive, Brian? Clearly, it is you who feels he must defend digital as if it were a child needing protection. Believe me, it doesn’t need you espousing virtues.

For the record, I am using film at the moment still and have a "toy" digital camera.

So goodie-goodie for you. If you had an open mind you might question what I do and what I use, but you run away with reflexive knee-jerks. I have DSLRs – four, in fact. I also shoot digital video – Canon XL1 – and I use MF and LF, and I’ve been in the ‘digital world’ since 1976, and in the film world since the early Sixties.

As work becomes more demanding, I am definitely buying a pro digital slr.

Of course you will, but you won’t escape the work part. You will still have to learn the same techniques you would with film, and then some.
At the end of the day jjs, I have a suggestion for you. The next time you have typed a response to someone in need of help….just consciously ask yourself this before you hit the "send" button: Is this a helpful comment that may help the person solve, or better understand their probelm….or is this just a criticism and will not help anyone?

Have your opinions jjs, but keep them to yourself unless they directly assist in the answer to the problem. If someone wants to do an experiment, scientific or not, let them! What has it got to do with you? They do not need your blessing to do an experiment.

I don’t care if someone uses digital or film. You clearly do, but who cares? Let people do what they will.

Brian.
J
jjs
Mar 22, 2005
"Brian" wrote in message
At the end of the day jjs, I have a suggestion for you. […]
Have your opinions jjs, but keep them to yourself unless they directly assist in the answer to the problem.

Boy, don’t you ever try to put your words in my mouth (your ‘strawman’ proclivity to create issues that don’t exist) and don’t you ever try to preach to me. I’ve been here helping long before you showed up with your uptight, presumptuous, assholiness attitude and knowledge suitable for the shallow end. You have put your foot far enough into your mouth that you should be embarrassed. Read up. It must suck to be you.
MR
Mike Russell
Mar 22, 2005
jjs wrote:
"Brian" wrote in message
At the end of the day jjs, I have a suggestion for you. […]
Have your opinions jjs, but keep them to yourself unless they directly assist in the answer to the problem.

Boy, don’t you ever try to put your words in my mouth (your ‘strawman’ proclivity to create issues that don’t exist) and don’t you ever try to preach to me. I’ve been here helping long before you showed up with your uptight, presumptuous, assholiness attitude and knowledge suitable for the shallow end. You have put your foot far enough into your mouth that you should be embarrassed. Read up. It must suck to be you.

Translation: "No". 🙂


Mike Russell
www.curvemeister.com
B
Brian
Mar 22, 2005
Mike Russell wrote:

jjs wrote:

"Brian" wrote in message

At the end of the day jjs, I have a suggestion for you. […]
Have your opinions jjs, but keep them to yourself unless they directly assist in the answer to the problem.

Boy, don’t you ever try to put your words in my mouth (your ‘strawman’ proclivity to create issues that don’t exist) and don’t you ever try to preach to me. I’ve been here helping long before you showed up with your uptight, presumptuous, assholiness attitude and knowledge suitable for the shallow end. You have put your foot far enough into your mouth that you should be embarrassed. Read up. It must suck to be you.

Translation: "No". 🙂

Hahaha, that was good Mike!!

Ok, enough has been said on this matter. Do as you will jjs, you are setting your own reputation. I have nothing to be embarrassed about, I have a clear conscience. You know nothing about me, so you cannot comment on my knowledge in ANY field.

I will continue to help others if and when I can, and I will continue to learn from the great people in this NG. All the best,

Brian.

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

Related Discussion Topics

Nice and short text about related topics in discussion sections