POV-Ray : Newsgroups : povray.windows : Single BMP, perhaps you all misunderstood my question Server Time
28 Jul 2024 12:28:21 EDT (-0400)
  Single BMP, perhaps you all misunderstood my question (Message 19 to 28 of 28)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Crunchy Frog
Subject: Gee guys!
Date: 7 Sep 1999 18:55:25
Message: <37D59872.22A4C470@montypython.co.uk>
All this talk over a simple question. And no one has posted an answer. I
know what I am doing. I know all about image format trade-offs, and load
times, and palettes, etc. I was just hoping for a pointer a nice little
app that solved my problem. Oh well, I'll write my own.

BTW: It doesn't matter if the images are stored vertically or
horizontally because the image must be moved to the video surface one
row at a time. The only time you can take advantage of contiguous memory
is when it exactly matches the pitch of the display surface, and when
your image is on a surface by itself. Neither of these will be the case
for me. In case anyone was wondering, the game is being written for
Windows 95/98/NT, DirectX 3+, and will most likely be 16-bit or greater
colors. But I want to allow for any depth BMP file to be loaded, so he
graphics will be potentially upgradable or user-swappable.


Post a reply to this message

From: Remco de Korte
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 19:46:19
Message: <37D5A4EC.539C4FA@xs4all.nl>
Nieminen Juha wrote:
> 
> Remco de Korte <rem### [at] xs4allnl> wrote:
> : Ehm, we're talking about a _game_ here. Like those things you can download 28Mb
> : demo's of.
> : Would it really be such an advantage to use PNGs instead of BMPs? I think not.
> : As a matter of fact I think PNG are seldomly used for that. There are all sorts
> : of custom formats around where multiple images are stored in one big
> : blob-data-file but if you want to make it simple on your self in programming a
> : game on a windows platform BMP is not such a bad choice.
> 
>   I quote myself: "Disk space is cheap but still limited".
>   This means that with current hard disks the size of one game doesn't matter
> at all. It could be 10 kilobytes or 1 Gigabyte. Big deal.
>   The problem is that you seldom play just one game and use just one program.
> Usually you have many of them on your disk. If everyone of them took 1
> Gigabyte, you will certainly complain. A 16 Gigabytes hard disk would be
> full quite soon.
>   It's good to think that your program is not the only program the end user
> will be using. Saving storage space for the other programs is polite, IMHO.
> 

We're talking about games, not politics.

> : If diskspace is a
> : consideration you might use RLE-compressed bitmaps
> 
>   RLE doesn't pack very well.
> 

Agreed. Same with PNG.

Cheers!

Remco


Post a reply to this message

From: Remco de Korte
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 19:48:22
Message: <37D5A568.4220BC2D@xs4all.nl>
Lutz Kretzschmar wrote:
> 
> Hi Remco de Korte, you recently wrote in povray.windows:
> 
> > That is a reasonable explanation.
> > The way I think this will work the whole image will be loaded into memory with
> > one single statement and then it's not really relevant anymore though.
> If the image is vertical, blitting from it will be better because the
> bitmap is in contiguous memory, i.e. the CPU cache will do a much
> better job of getting data, it could make it quite a good deal faster.
> 
> - Lutz

That is interesting. Thank you for this information! Any idea how big the
difference is? Is it more then trivial?

Remco


Post a reply to this message

From: Remco de Korte
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 20:01:07
Message: <37D5A864.37261F22@xs4all.nl>
Jon A. Cruz wrote:
> 
> Remco de Korte wrote:
> 
> > Jon A. Cruz wrote:
> > >
> > > 2) BMP for a game? I'd really suggest trying to stay away from BMP if at
> > > all possible. Store things as PNG and just convert to BITMAP as you read
> > > in.
> >
> > Again: why? What would be the advantage of PNG over BMP? It loads much slower.
> > >
> 
> "It loads much slower". That sounds like a start at premature optimization, which
> is the root of all evil. :-)
> 
> How much is "much slower". Tests should be made. I'm guessing on the order of
> perhaps a second at the extreme. Depends on your system. Disk speed is going to be
> a bottleneck anyway, and modern processors get quite fast. The main point would be
> to test it in context and see how it works overall.
> 

I agree about that. The only thing I can see about it is that my experience with
the different filetypes is that BMPs are read/written immediately while PNGs
tend to take some time. Try to do a batch conversion with 100 images. 

> Another thing to consider is when will this apply?  Usually this slight slowdown
> would occur once at the begining of the program or level. While a splash screen is
> being displayed. Balance that with having the equivalent of keeping all your
> images ZIPped on disk the entire time the user has the game installed but is not
> playing it.
> 
A splashscreen would indeed typically be a large image which doesn't have to
load extremely fast, so PNG would do fine. Since this is about a series of
images I was thinking more about sprites, where speed is more of an issue.

> Also by taking that hit on speed at one point during startup you also buy the
> addition of transparency by color or by alpha channel, etc.

With BMPs you can use transparence by simply declaring a transparent color, as
in GIFs.
> 
> Anothing thing that had been mentioned was RLE BMP files. Problem is that RLE
> compression really sucks for most things (that's my professional opinion from
> having worked with RLE a lot :-)  Also, using it will make the BMP's incompatible
> with a lot of programs. But at least it's not quite as bad as "right-side-up"
> BMP files.

Yes, RLE is bad. I was trying to keep it at BMPs, but I might as well have
mentioned TGA, PCX (used quite frequently in older games at least) or GIF
(same). It depends on the colordepth you want to use.
> 

It looks as though I'm trying to prove PNG is a useless format which is not the
case. 
It's just that when someone asks a simple question about how to manipulate some
BMPs someone starts telling he shouldn't use BMPs at all, instead of giving a
simple answer. I don't think that is very helpful, I think it is more
something-I-can't-find-the-right-english-word-for.

Kind regards,

Remco


Post a reply to this message

From: Remco de Korte
Subject: Re: Gee guys!
Date: 7 Sep 1999 20:03:56
Message: <37D5A90D.1FCFE6AB@xs4all.nl>
Crunchy Frog wrote:
> 
> All this talk over a simple question. And no one has posted an answer. I
> know what I am doing. I know all about image format trade-offs, and load
> times, and palettes, etc. I was just hoping for a pointer a nice little
> app that solved my problem. Oh well, I'll write my own.
> 
Hold on! I said I had a program that did precisely what you want.
I use it for more or less the same purposes (check out the Frankenvic mentioned
in the animations-group). 
Still, writing your own can't be that much trouble.

Toedeledoki!

Remco


Post a reply to this message

From: Nieminen Juha
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 8 Sep 1999 07:45:01
Message: <37d64c3d@news.povray.org>
Remco de Korte <rem### [at] xs4allnl> wrote:
:>   RLE doesn't pack very well.

: Agreed. Same with PNG.

  PNG packs much better than RLE.
  Just compare a RLE-targa and a PNG.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Remco de Korte
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 8 Sep 1999 10:12:46
Message: <37D66FFF.1425367D@xs4all.nl>
Nieminen Juha wrote:
> 
> Remco de Korte <rem### [at] xs4allnl> wrote:
> :>   RLE doesn't pack very well.
> 
> : Agreed. Same with PNG.
> 
>   PNG packs much better than RLE.
>   Just compare a RLE-targa and a PNG.
> 

Sure.
But it also depends on the type of image you have.


Post a reply to this message

From: TonyB
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 8 Sep 1999 16:04:17
Message: <37D6B1F3.7D9FD97F@panama.phoenix.net>
> Sure.
> But it also depends on the type of image you have.

PNG would still kick RLE's butt.

--
Anthony L. Bennett
http://welcome.to/TonyB

Non nova, sed nove.


Post a reply to this message

From: Remco de Korte
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 8 Sep 1999 16:46:02
Message: <37D6CC25.6BDCCC0D@xs4all.nl>
TonyB wrote:
> 
> > Sure.
> > But it also depends on the type of image you have.
> 
> PNG would still kick RLE's butt.
> 

Yep, you're right.
PNG's compression is amazing for lossless compression.
I reckoned there would always be a weird case where it could be beaten by
another format (as with JPG vs GIF) but I wouldn't even know where to look. 
Man, does this bother me!
I hope it didn't frighten CrunchyFrog into loosing his or her crunchiness.
 
Ajeto!

Remco


Post a reply to this message

From: Crunchy Frog
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 8 Sep 1999 19:03:52
Message: <37D6EBEF.ACC64999@montypython.co.uk>
Remco de Korte wrote:
> 
> TonyB wrote:
> >
> > > Sure.
> > > But it also depends on the type of image you have.
> >
> > PNG would still kick RLE's butt.
> >
> 
> Yep, you're right.
> PNG's compression is amazing for lossless compression.
> I reckoned there would always be a weird case where it could be beaten by
> another format (as with JPG vs GIF) but I wouldn't even know where to look.
> Man, does this bother me!
> I hope it didn't frighten CrunchyFrog into loosing his or her crunchiness.

Crunch! I guess not, even in milk!


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.