🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.graphics.api.opengl
16 messages
16 total messages Started by Paul Richards Tue, 28 Dec 1999 00:00
OT: Looking for image file format that can handle 16b its per channel
#121
Author: Paul Richards
Date: Tue, 28 Dec 1999 00:00
12 lines
1539 bytes
Hi,
Does anyone know of a simple image file format that I can use that can
handle 16bits per channel?  In effect producing 48bit colour images?  I
mean simple in that it'll be easy for me to write the input/output
routines for in C++.

TIA
-- 
Paul Richards (Pauldoo) - http://www.pauldoo.co.uk

I've not run any Microsoft code for 2768877 seconds.
    How about you?
Re: OT: Looking for image file format that can handle 16b its per channel
#115
Author: Ron Natalie
Date: Tue, 28 Dec 1999 00:00
13 lines
1506 bytes

Paul Richards wrote:
> 
> Hi,
> Does anyone know of a simple image file format that I can use that can
> handle 16bits per channel?  In effect producing 48bit colour images?  I
> mean simple in that it'll be easy for me to write the input/output
> routines for in C++.
> 
Both TIFF and NITF can be set to run in that mode.  I'm fairly certain
that the Leffler/SGI libtiff.a will do it for you so you don't even
have to write the code to deal with the TIFF nitty-gritty.
Re: OT: Looking for image file format that can handle 16b its per channel
#116
Author: Oliver Kreylos
Date: Tue, 28 Dec 1999 00:00
23 lines
1606 bytes
Paul Richards wrote:
> 
> Hi,
> Does anyone know of a simple image file format that I can use that can
> handle 16bits per channel?  In effect producing 48bit colour images?  I
> mean simple in that it'll be easy for me to write the input/output
> routines for in C++.

There's also the Portable Network Graphics (PNG). It might not be the
easiest format to read/write, but it compresses well, is the coming
standard for WWW graphics, and C source code is available.

Have a look at

http://graphicswiz.com/png/

HTH,

  Oliver

-- 
Email: kreylos@cs.ucdavis.edu
WWW:   http://graphics.cs.ucdavis.edu/~okreylos
Re: OT: Looking for image file format that can handle 16b its per channel
#117
Author: Warren Young
Date: Tue, 28 Dec 1999 00:00
19 lines
2018 bytes
Oliver Kreylos wrote:
> 
> Paul Richards wrote:
> >
> > Does anyone know of a simple image file format that I can use that can
> > handle 16bits per channel?  In effect producing 48bit colour images?  I
> > mean simple in that it'll be easy for me to write the input/output
> > routines for in C++.
> 
> There's also the Portable Network Graphics (PNG). It might not be the
> easiest format to read/write, but it compresses well, is the coming
> standard for WWW graphics, and C source code is available.

In defense of PNG's encoding, the only other option suggested here is
TIFF, which uses a similar compression algorithm to PNG's -- PNG uses
LZH (?) and TIFF uses LZW.  And let's not forget the Unisys patent on
LZW: it applies to TIFF just as well as to GIF.
-- 
= Warren -- ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m
Re: OT: Looking for image file format that can handle 16b its per channel
#118
Author: Oliver Kreylos
Date: Tue, 28 Dec 1999 00:00
20 lines
1818 bytes
Warren Young wrote:
[snip]
> In defense of PNG's encoding, the only other option suggested here is
> TIFF, which uses a similar compression algorithm to PNG's -- PNG uses
> LZH (?) and TIFF uses LZW.  And let's not forget the Unisys patent on
> LZW: it applies to TIFF just as well as to GIF.

Right. Actually, the encoding mechanism used by PNG is called "deflate",
and it is based on the LZ77 sliding window algorithm and Huffman
encoding of literal/length and distance pairs.

As opposed to LZW, LZ77 is not patented itself; some implementations
using special "tricks" might be. But PNG uses a non-patented
implementation and is thus not endangered as is TIFF/GIF.

  Oliver

-- 
Email: kreylos@cs.ucdavis.edu
WWW:   http://graphics.cs.ucdavis.edu/~okreylos
Re: OT: Looking for image file format that can handle 16b its per channel
#119
Author: Paul Richards
Date: Tue, 28 Dec 1999 00:00
13 lines
1604 bytes
Paul Richards wrote:
> Hi,
> Does anyone know of a simple image file format that I can use that can
> handle 16bits per channel?
[snip]

I've just found out about 16bit greyscale TGA's.  Does anyone know how
these are coded or perhaps some documentation that would tell me?
-- 
Paul Richards (Pauldoo) - http://www.pauldoo.co.uk

I've not run any Microsoft code for 2770077 seconds.
    How about you?
Re: OT: Looking for image file format that can handle 16b its per channel
#109
Author: Victor Wagner
Date: Wed, 29 Dec 1999 00:00
12 lines
1341 bytes
Paul Richards <pauldoo@dunvegan1.demon.co.uk> wrote:
: Hi,
: Does anyone know of a simple image file format that I can use that can
: handle 16bits per channel?  In effect producing 48bit colour images?  I
: mean simple in that it'll be easy for me to write the input/output
: routines for in C++.

ppm

-- 
This is a test of the Emergency Broadcast System.  If this had been an
actual emergency, do you really think we'd stick around to tell you?
Re: OT: Looking for image file format that can handle 16b its per channel
#120
Author: Glenn Randers-Pehrson
Date: Wed, 29 Dec 1999 00:00
20 lines
1820 bytes
In article <38699999.9E9CC97D@mail.com>,
  Warren Young <tangent@mail.com> wrote:

> In defense of PNG's encoding, the only other option suggested here is
> TIFF, which uses a similar compression algorithm to PNG's -- PNG uses
> LZH (?) and TIFF uses LZW.  And let's not forget the Unisys patent on
> LZW: it applies to TIFF just as well as to GIF.

LZW is only one of the storage methods within TIFF and LZW support
has been dropped from the latest version of libtiff according to the
freshmeat announcement that appeared the other day.  I don't know
whether LZW-reading capability was retained, but I would assume so.

--
Glenn Randers-Pehrson
PNG/MNG Development Group


Sent via Deja.com http://www.deja.com/
Before you buy.
Re: OT: Looking for image file format that can handle 16b its per channel
#110
Author: Paul Richards
Date: Thu, 30 Dec 1999 00:00
18 lines
1795 bytes
Victor Wagner wrote:
> 
> Paul Richards <pauldoo@dunvegan1.demon.co.uk> wrote:
> : Hi,
> : Does anyone know of a simple image file format that I can use that can
> : handle 16bits per channel?  In effect producing 48bit colour images?  I
> : mean simple in that it'll be easy for me to write the input/output
> : routines for in C++.
> 
> ppm

PPM can't do 16bits per channel or 16bit greyscale which is what I'm
looking for.
-- 
Paul Richards (Pauldoo) - http://www.pauldoo.co.uk

I've not run any Microsoft code for 2907177 seconds.
    How about you?
Re: OT: Looking for image file format that can handle 16b its per channel
#111
Author: Oliver Kreylos
Date: Thu, 30 Dec 1999 00:00
31 lines
2064 bytes
Paul Richards wrote:
> 
> Victor Wagner wrote:
> >
> > Paul Richards <pauldoo@dunvegan1.demon.co.uk> wrote:
> > : Hi,
> > : Does anyone know of a simple image file format that I can use that can
> > : handle 16bits per channel?  In effect producing 48bit colour images?  I
> > : mean simple in that it'll be easy for me to write the input/output
> > : routines for in C++.
> >
> > ppm
> 
> PPM can't do 16bits per channel or 16bit greyscale which is what I'm
> looking for.

I think it can. The ASCII ppm format is rather flexible. AFAIK, you can
have arbitrarily large values per channel per pixel, you just should
give the maximal used value in the "maxValue" field.

The binary ppm format, on the other hand, supports only 8 bit values per
channel per pixel.

But since ASCII ppm is a horribly bloated format, I still suggest using
PNG. (ppm is *much* easier to read or write, though...)

  Oliver

-- 
Email: kreylos@cs.ucdavis.edu
WWW:   http://graphics.cs.ucdavis.edu/~okreylos
Re: OT: Looking for image file format that can handle 16b its per channel
#112
Author: Eero Pajarre
Date: Thu, 30 Dec 1999 00:00
34 lines
1778 bytes
Paul Richards wrote:
> 
> Victor Wagner wrote:
> >
> > Paul Richards <pauldoo@dunvegan1.demon.co.uk> wrote:
> > : Hi,
> > : Does anyone know of a simple image file format that I can use that can
> > : handle 16bits per channel?  In effect producing 48bit colour images?  I
> > : mean simple in that it'll be easy for me to write the input/output
> > : routines for in C++.
> >
> > ppm
> 
> PPM can't do 16bits per channel or 16bit greyscale which is what I'm
> looking for.
>

Huh?

The "ASCII" ppm format (with P3 tag) can contain 16 bits per channel.

Here is an example file: (4 pixels)
--------------------
P3
2 2
65535
65535 0 0
0 65535 0
0 0 65535
65535 0 65535
--------------------


		Eero
Re: OT: Looking for image file format that can handle 16b its per channel
#113
Author: Paul Richards
Date: Thu, 30 Dec 1999 00:00
32 lines
2422 bytes
Oliver Kreylos wrote:
> 
> Paul Richards wrote:
> >
> > Victor Wagner wrote:
> > >
> > > Paul Richards <pauldoo@dunvegan1.demon.co.uk> wrote:
> > > : Hi,
> > > : Does anyone know of a simple image file format that I can use that can
> > > : handle 16bits per channel?  In effect producing 48bit colour images?  I
> > > : mean simple in that it'll be easy for me to write the input/output
> > > : routines for in C++.
> > >
> > > ppm
> >
> > PPM can't do 16bits per channel or 16bit greyscale which is what I'm
> > looking for.
> 
> I think it can. The ASCII ppm format is rather flexible. AFAIK, you can
> have arbitrarily large values per channel per pixel, you just should
> give the maximal used value in the "maxValue" field.

ASCII PPM?  What do you mean by that?  The PPM's I currently can make
have the header in ASCII, and they do have a "maxValue" field but the
data is just raw binary.

Could you explain a little further on how these ASCII ones work?
-- 
Paul Richards (Pauldoo) - http://www.pauldoo.co.uk

I've not run any Microsoft code for 2926857 seconds.
    How about you?
Re: OT: Looking for image file format that can handle 16b its per channel
#114
Author: Oliver Kreylos
Date: Thu, 30 Dec 1999 00:00
36 lines
2170 bytes
Paul Richards wrote:
[snip]
> ASCII PPM?  What do you mean by that?  The PPM's I currently can make
> have the header in ASCII, and they do have a "maxValue" field but the
> data is just raw binary.
> 
> Could you explain a little further on how these ASCII ones work?

Well, I can try...

The header for an ASCII ppm is the code P3, followed by width, height
and maxValue, as usual. Note that the values for those fields are given
in ASCII - I mean, they are printed out.

In a "raw" or binary ppm file, the code is a P6, and the image data is
written as a series of bytes - three per pixel. In the ASCII format,
each pixel is written as three integer values - all spelled out.
Example:

P3
2 2 1000

   0    0    0       0 1000    0

1000    0    0    1000 1000 1000

The maxVal field can be arbitrarily large (well, let's say it *can* be
65535), so you can effectively store 16 bits per channel per pixel.

HTH,

  Oliver

-- 
Email: kreylos@cs.ucdavis.edu
WWW:   http://graphics.cs.ucdavis.edu/~okreylos
Re: OT: Looking for image file format that can handle 16b its per channel
#106
Author: Philip Staite
Date: Fri, 31 Dec 1999 00:00
15 lines
1874 bytes
Paul Richards wrote:

> ASCII PPM?  What do you mean by that?  The PPM's I currently can make
> have the header in ASCII, and they do have a "maxValue" field but the
> data is just raw binary.
>
> Could you explain a little further on how these ASCII ones work?
>

I guess you missed my reply on c.l.c++ so I'll repeat it.  Go to
http://www.wotsit.org/ and look up ppm in the graphics file formats.

You're probably used to using the smaller/faster "P6" variation of PPM.  The
original was "P3" and used whitespace delimited ascii numbers for the RGB pixel
values.
Re: OT: Looking for image file format that can handle 16b its per channel
#107
Author: Victor Wagner
Date: Fri, 31 Dec 1999 00:00
29 lines
2025 bytes
Paul Richards <pauldoo@dunvegan1.demon.co.uk> wrote:
: Victor Wagner wrote:
:> 
:> Paul Richards <pauldoo@dunvegan1.demon.co.uk> wrote:
:> : Hi,
:> : Does anyone know of a simple image file format that I can use that can
:> : handle 16bits per channel?  In effect producing 48bit colour images?  I
:> : mean simple in that it'll be easy for me to write the input/output
:> : routines for in C++.
:> 
:> ppm

: PPM can't do 16bits per channel or 16bit greyscale which is what I'm
: looking for.

P6 cannot, but P3 - ascii format PPM, can. Of course, files would be
_HUGE_.

Here is quote from man ppm(5)

       Note  that  this  raw  format can only be used for maxvals
       less than or equal to 255.  If you use the ppm library and
       try to write a file with a larger maxval, it will automat�
       ically fall back on the slower but more general plain for�
       mat.


-- 
"Help save the world!"              -- Larry Wall in README
Re: OT: Looking for image file format that can handle 16b its per channel
#108
Author: Paul Richards
Date: Fri, 31 Dec 1999 00:00
22 lines
2112 bytes
Philip Staite wrote:
> 
> Paul Richards wrote:
> 
> > ASCII PPM?  What do you mean by that?  The PPM's I currently can make
> > have the header in ASCII, and they do have a "maxValue" field but the
> > data is just raw binary.
> >
> > Could you explain a little further on how these ASCII ones work?
> >
> 
> I guess you missed my reply on c.l.c++ so I'll repeat it.  Go to
> http://www.wotsit.org/ and look up ppm in the graphics file formats.

Hehe, no I did get that post, but I only noticed specs for the "P6"
binary version.  I apologise if it was on the wotsit website and I
missed it.
-- 
Paul Richards (Pauldoo) - http://www.pauldoo.co.uk

I've not run any Microsoft code for 2981458 seconds.
    How about you?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads