Page 1 of 1
JPG vs PNG
Posted: Mon Oct 27, 2003 8:09 pm
by embrance
For games use,is jpg better thaN PNG?PNG IS SMALLER,and jpg bigger.
wich is the best chooice?
couse for an animation i made i used 35 frames*15kb(jpg)=1+mbs
Posted: Mon Oct 27, 2003 9:18 pm
by Tranquil
What you wrote is not realy true.
PNG is a graphic compression which does not lose and datas. That means, if you convert a BMP to a PNG it is exactly the same.
JPG reduces the data amount like mp3 with audiofiles. So afer converting a BMP to and JPG this is not the same picture anymore.
Both shemas are totaly different. But for games JPG should be enough.
Cheers
Mike
Re: JPG vs PNG
Posted: Mon Oct 27, 2003 10:09 pm
by freedimension
embrance wrote:For games use,is jpg better thaN PNG?PNG IS SMALLER,and jpg bigger.
You have to show me that, else I won't believe you.
JPG uses a lossy compression and hence produces much smaller files than PNG (OK, it may depend on the settings and the color depth).
There would be no need for two graphics formats if one is always better than the other. I.e. it depends on what you are needing them for.
For sprites with a small amount of colors PNG is almost everytime the better choice. For true color Pictures like Photos or Renderings JPG does the job.
Do you have one color that is supposed to be transparent (once more for sprites) you have to use PNG because JPG produces some background noise that can't be filtered with such a simple method.
Read a primer on PNG and on JPG for further information.
kind regards
freedimension
3D game studio pro
Posted: Mon Oct 27, 2003 10:21 pm
by embrance
i tested a 500x500 pics/I drawed some stufff so here are the results:
200kbs+ BMP format
6 kbs PNG format 8O
11 kbs jpg format

Posted: Mon Oct 27, 2003 10:30 pm
by freedimension
With JPG, what compression rate have you used? Try it once more with 20-50%.
It also depends on what you've drawn. How many colors does your image has? Are there large areas of the same color? And so on, and so on.
50posts!finally!
Posted: Mon Oct 27, 2003 10:58 pm
by embrance
ok.You are right.
However by loading about 500-1800 jpg giles around 5-10 kb each wouldnt require lots of memory?
Is there a wany to avoid this thing?
Re: 50posts!finally!
Posted: Mon Oct 27, 2003 11:00 pm
by LarsG
embrance wrote:ok.You are right.
However by loading about 500-1800 jpg giles around 5-10 kb each wouldnt require lots of memory?
Is there a wany to avoid this thing?
8O
You've got to load and free images as you go...
A very good&cheap greek web hosting company:]
Posted: Tue Oct 28, 2003 12:21 am
by embrance
yes i know that fact.BUT if i load them all at the beggining wont i get better speed when there will be tons of stuff in the screen?

Re: 50posts!finally!
Posted: Tue Oct 28, 2003 1:14 am
by freedimension
embrance wrote:ok.You are right.
However by loading about 500-1800 jpg giles around 5-10 kb each wouldnt require lots of memory?
Is there a wany to avoid this thing?
Whether you load a JPG or a PNG doesn't matter, they are both the same size once they are in the RAM. Compression only matters while they are on the harddisk, keep that in mind.
Re: A very good&cheap greek web hosting company:]
Posted: Tue Oct 28, 2003 10:24 am
by LarsG
embrance wrote:yes i know that fact.BUT if i load them all at the beggining wont i get better speed when there will be tons of stuff in the screen?

Yes, you would get better speed.. it's a kind of "no-no" to load stuff during gameplay (or whatever you're doing)..
But you can't load that many images into memory all at once... Lot's of pc's will choke... Just try adding the size of the files in .bmp and calculate how much memory it will eat up...
What you need to do, is make a loading routine between levels or screens (or whatever you're doing).. That way you're only having the currently used images loaded in memory, and the rest is free'd up... The speed will remain the same...
-Lars
50posts!finally!
Posted: Tue Oct 28, 2003 12:02 pm
by embrance
Wel i was thinking to load the basic tuff like decoration at the beggining and the other during battle etc.However thnx for your suggestion.I will follow it:]

Posted: Tue Oct 28, 2003 3:46 pm
by griz
PNGs :
Pros :
- great for images containing large areas of the same color
- image integrity/quality maintained at 100%
Cons :
- complex images like photographs do not compress well
JPGs :
Pros :
- great for complex images like photographs
Cons :
- image quality is directly reduced with increased compression
- creates image noise unsuitable for transparent sprite masks as freedimension pointed out
I do not see PNG competing with JPG at all. They co-exist perfectly and should be chosen based on the exact requirements of your project. An image ideally suited to JPG may look/compress worse as a PNG and vice versa.
Posted: Thu Oct 30, 2003 3:32 am
by kenet
Png include also an alpha channel...
that doesnt help much