POV-Ray : Newsgroups : povray.general : Compression Server Time
8 Aug 2024 18:15:30 EDT (-0400)
  Compression (Message 8 to 17 of 37)  
<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Margus Ramst
Subject: Re: Compression
Date: 12 Jan 2001 20:20:56
Message: <3A5FADBC.FCCBD88D@peak.edu.ee>
Rune wrote:
> 
> I have some general questions about compression.
> 
[snip]

These are two different things.
The mesh compressor is specifically optimized for meshes; I believe it does
things like store coplanar faces as one larger face and maybe keep a separate
list of faces and vertices so coincident vertices are not duplicated (all this
is just my guess, of course).
ZIP and similar compressors use a generic algorithm; it basically looks for
recurring "patterns" in the input file and replaces the duplicates with pointers
to a "library of phrases".
POV can (with appropriate macros) read PCM files directly. ZIP files must first
be unpacked. I suppose it might be possible to make POV unpack and read zipped
files internally; and it shouldn't create serious portability issues. Whether or
not it would be worth the effort, I don't know.
Anyway, if you really want the smallest possible file size, first pass the mesh
through the mesh compresson and then zip it - you'll have the best of both
worlds.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg
Home page http://www.hot.ee/margusrt


Post a reply to this message

From: Rune
Subject: Re: Compression
Date: 12 Jan 2001 20:51:41
Message: <3a5fb4ad@news.povray.org>
"Margus Ramst" wrote:
> The mesh compressor is specifically optimized for meshes;
> ZIP and similar compressors use a generic algorithm;

But my point was that zip is far more effective.

> POV can (with appropriate macros) read PCM files directly.
> ZIP files must first be unpacked.

Yes, I think this is the real reason that PCM files are better.

> Anyway, if you really want the smallest possible file size,
> first pass the mesh through the mesh compresson and then zip
> it - you'll have the best of both worlds.

No, actually a zipped regular mesh is quite a bit smaller than a zipped PCM.
The reason is the separate lists of faces and vertices, which means that
there's less repeats of data for the zipper to work with.

Thanks you all for the replies!

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Chris Colefax
Subject: Re: Compression
Date: 12 Jan 2001 21:05:01
Message: <3a5fb7cd@news.povray.org>
Rune <run### [at] inamecom> wrote:
> I have some general questions about compression.
>
> I don't know much about different platforms. Is the .zip format accessible
> on all platforms? I always zip all my scene files before I upload them to
my
> website, but does that exclude some people from using them?
>
> If .zip is universally supported I have a question about mesh compression:
> what is the reason for the compression used by pcm and mesh2? Zipping a
mesh
> file is more efficient than using any of those formats, and a zipped
regular
> mesh is even smaller than a zipped pcm or mesh2.
>
> I have two guesses myself:
> 1) Zip is not universally supported.
> 2) The file size while sending the mesh over the net is not the reason for
> compression, but rather the file size on the local HD.

This is pretty much the case - ZIP may be an unofficial standard, but it's
not guaranteed to be available on all platforms, and to use the zipped file
you have to unzip it first (so the unzipped file plus the zipped file means
the disk space required while using the file is actually larger than the
uncompressed file!).

It was for these reasons that Warp first approached me with the idea of
creating a portable text format for meshes that could reduce the file size
without reducing functionality.  As it turned out, the format we eventually
developed offers *increased* functionality (deformations, hair growth,
subdivision surfaces, etc.) using the Compressed Mesh macros I and others
were able to create for the PCM format.

To clarify, Warp's Mesh Compressor does not (currently) reduce the number of
triangles in a mesh by replacing multiple, smaller faces with larger
triangles.  Instead it works like the ZIP format, reducing the amount of
repeated information in a file.  It does this firstly by removing common
elements (the triangle keyword, angled and curly brackets), and also by
searching for vertices shared by multiple triangles.

Certainly, it's not the most compact text format possible.  Warp and I
actually tried more compact forms, replacing digits with characters and
such, but found that parsing speed became unacceptably slow.  So, like many
things in POV, what we ended up with is a compromise that works at a
reasonable speed.

The mesh2 format works on the same principle as the PCM format, which (as I
understand it) is also found in other software that uses triangle mesh
surfaces.  In the end, the different compression formats have different
uses - if you have the disk space, an uncompressed mesh might the fastest
and easiest if you don't want to do anything fancy with it, whereas the PCM
gives you direct control over each vertex, and the mesh2 allows easy
conversion from other formats, such as UV-mapped models.


Post a reply to this message

From: David Fontaine
Subject: Re: Compression
Date: 12 Jan 2001 22:16:09
Message: <3A5FC751.D48A6E33@faricy.net>
Christoph Hormann wrote:

> I personnaly don't see much need to compress single pov code files, since
> otherwise you can directly view them and have less work when downloading.

Yeah, I hate when single small files are zipped up (some with little size benefit
anyway). Then I have to open explorer and unzip it, and PKZip for windows is
incredibly slow to load up and close. Sometimes it's used more as a packaging tool
than a compression tool, which is ok I guess, but if there's an alternative use
it. (Like TI calculator games, just make an .86g or .89g or whatever file).

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Mark Wagner
Subject: Re: Compression
Date: 12 Jan 2001 23:30:01
Message: <3a5fd9c9$1@news.povray.org>
Gilles Tran wrote in message <3A5F7662.D8DFB100@inapg.inra.fr>...
>Pcm and mesh2 are text formats, not binary, which makes them portable and
>editable, which are too good reasons. I also guess that zip support is not
>royaltee-free (I could be wrong).


Zip support is free.

--
Mark


Post a reply to this message

From: Peter Popov
Subject: Re: Compression
Date: 13 Jan 2001 01:44:25
Message: <qltv5tcck288g0ugtp2o32eek70661k4cg@4ax.com>
On Fri, 12 Jan 2001 17:51:41 +0100, "Rune" <run### [at] inamecom>
wrote:

>I have some general questions about compression.
>
>I don't know much about different platforms. Is the .zip format accessible
>on all platforms? 

Yes. Well, on 16- and 32-bit platforms, that is :)

>I always zip all my scene files before I upload them to my
>website, but does that exclude some people from using them?

No.

>If .zip is universally supported I have a question about mesh compression:
>what is the reason for the compression used by pcm and mesh2? 

The file gets a) smaller b) better organised and c) readable by POV's
#read directive, which allows for some neat effects such as shown by
Chris' macros.

>Zipping a mesh file is more efficient than using any of those formats, 
>and a zipped regular mesh is even smaller than a zipped pcm or mesh2.

zip uses a Leimpfell-Ziff-Huffman compression algorithm very suitable
for text files. I don't recall if hash tables were a courtesy of LZW
but if not, this would be the explanation. A pcm file reorganises the
data into a more compact form with some data loss.

>I have two guesses myself:
>1) Zip is not universally supported.
>2) The file size while sending the mesh over the net is not the reason for
>compression, but rather the file size on the local HD.

Both guesses are off-the-point as the main purpose of the pcm file
format is to provide the POV parser with access to the mesh component
(vertices, faces, normals, uv indices etc.)


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Peter Popov
Subject: Re: Compression
Date: 13 Jan 2001 02:09:00
Message: <gjvv5t4ipvmdk9odlptse02p6159h8eksi@4ax.com>
On Fri, 12 Jan 2001 23:10:30 -0000, "Rick [Kitty5]" <ric### [at] kitty5com>
wrote:

>if your going toi use compression - and your should - zip is probably your
>best bet, its about the closest there is to a 'standard'
>
>much better to use zip than say RAR or ACE...

RAR is available for DOS, Windows, Mac and *x. What more is there? :)


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Christoph Hormann
Subject: Re: Compression
Date: 13 Jan 2001 04:28:56
Message: <3A601FD9.344A3AB9@gmx.de>
David Fontaine wrote:
> 
> Yeah, I hate when single small files are zipped up (some with little size benefit
> anyway). Then I have to open explorer and unzip it, and PKZip for windows is
> incredibly slow to load up and close. Sometimes it's used more as a packaging tool
> than a compression tool, which is ok I guess, but if there's an alternative use
> it. (Like TI calculator games, just make an .86g or .89g or whatever file).
> 

A fast solution for expanding ZIP with the windows explorer is to
associate them with a small batch file invoking regular unzip.exe.  I have
two menu items in the context menu, one for viewing, one for expanding in
a subdirectory named filename.zip.out 

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Rune
Subject: Re: Compression
Date: 13 Jan 2001 07:50:04
Message: <3a604efc@news.povray.org>
"Peter Popov" wrote:
> Both guesses are off-the-point as the main purpose of the
> pcm file format is to provide the POV parser with access
> to the mesh component (vertices, faces, normals, uv indices
> etc.)

I was not asking for the reason for the file format itself, but for the
compression used by that file format, so I think my second guess is not so
much off-the-point after all.

Thanks for the reply anyway. :)
Nice to know that .zip can be used by everybody.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Rune
Subject: Re: Compression
Date: 13 Jan 2001 07:50:06
Message: <3a604efe@news.povray.org>
"Chris Colefax" wrote:
> Rune wrote:
> > what is the reason for the compression used by pcm and mesh2?
> >
> > I have two guesses myself:
> > 1) Zip is not universally supported.
> > 2) The file size while sending the mesh over the net is not
> >    the reason for compression, but rather the file size on
> >    the local HD.
>
> This is pretty much the case - ZIP may be an unofficial standard,
> but it's not guaranteed to be available on all platforms, and to
> use the zipped file you have to unzip it first (so the unzipped
> file plus the zipped file means the disk space required while
> using the file is actually larger than the uncompressed file!).

Thank you for clarifying that.

> an uncompressed mesh might the fastest and easiest if you don't
> want to do anything fancy with it, whereas the PCM gives you
> direct control over each vertex, and the mesh2 allows easy
> conversion from other formats, such as UV-mapped models.

I've been experimenting with my own mesh macros, but I've encountered some
problems. The biggest one is about the uv_vectors in mesh2. See p.u.p.

My idea is to create a new format that combines the best from PCM and mesh2.
(It would not support bicubic_patches though.)

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>

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