Re: pnm plugin

2000-05-03 Thread Marc Lehmann

On Tue, May 02, 2000 at 06:04:41PM -0700, Kevin Turner <[EMAIL PROTECTED]> 
wrote:
> > (pbm is known for some time, but gimp definitely writes a ppm file for
> > greyscale images).
> 
> that's not what "file" thinks about the attached files:

Hmm... I just took some gif, converted to grayscale and saved it... the
resulting file was a ppm. I'll look into this.

> > > In fact, any tool reading ppm will accept pgm or pbm as well, and
> > > automatically promote them.
> > 
> > Definitely _not_.
> 
> so this is, presumably, at least true for all the standard netpbm tools.

Which comes very short of "any tool". ImageMagick for example will refuse
to load a pgm image when you want to load a ppm file.

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED] |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |



Re: pnm plugin

2000-05-02 Thread Nick Lamb

On Wed, May 03, 2000 at 02:27:09AM +0200, Marc Lehmann wrote:
> ppm saving works. But I am unable to create pgm or pbm files with the gimp
> (pbm is known for some time, but gimp definitely writes a ppm file for
> greyscale images).

Nope, my routine Export tests for Gimp show PPM and PGMs being created
as appropriate. You're right that Gimp won't generate PBMs, but I don't
think it's an ideal tool for that job anyway.

IMHO pnm.c would ideally notice if you said "foo.pgm" for an RGB image,
and ask Export to recommend greyscale... but that's a lot of work for
a very small gain. So I don't prioritize doing that.

> However, saving a grayscale image resulted into a ppm file (with a pgm
> suffix).

Doesn't here. If you can't figure out what's wrong, try sending me
(private mail is fine) an XCF which you think should produce a PGM,
and I'll see what it does here.

> I think the pnm plug-in should be able to save greyscale as pgm, I don't
> care for pbm files.

Does in my last check out of Gimp, probably a few days old but hardly
out-of-date in PNM plug-in terms.

Nick.



Re: pnm plugin

2000-05-02 Thread Kevin Turner

On Wed, May 03, 2000 at 02:27:09AM +0200, Marc Lehmann wrote:
> ppm saving works. But I am unable to create pgm or pbm files with the gimp
> (pbm is known for some time, but gimp definitely writes a ppm file for
> greyscale images).

that's not what "file" thinks about the attached files:
pudding.pgm:  PGM image text
pudding2.pgm: PGM "rawbits" image data

various "pgm*" tools accept them as well.
Those were created from gimp 1.1.19, and lxr reports no substantial
changes to plug-ins/common/pnm.c in the last month.

> On Tue, May 02, 2000 at 02:55:46PM -0700, Kevin [...] wrote:
> > In fact, any tool reading ppm will accept pgm or pbm as well, and
> > automatically promote them.
> 
> Definitely _not_.

>From ppmtopgm(1):
man> Note that although there is a pgmtoppm program, it is not necessary
man> for simple conversions from pgm to ppm, because any ppm program can
man> read pgm (and pbm) files automagically.

so this is, presumably, at least true for all the standard netpbm tools.

-- 
Kevin Turner <[EMAIL PROTECTED]> | OpenPGP encryption welcome here
Plug-ins: They make GIMP do stuff.  http://gimp-plug-ins.sourceforge.net/
This list is archived at http://marc.theaimsgroup.com/?l=gimp-developer
To unsubscribe, mail [EMAIL PROTECTED]

 pudding.pgm
 pudding2.pgm


Re: pnm plugin

2000-05-02 Thread Marc Lehmann

On Tue, May 02, 2000 at 02:55:46PM -0700, Kevin Turner <[EMAIL PROTECTED]> 
wrote:
> B) I just tried it.  It works fine.  Even if you do want to consider it

ppm saving works. But I am unable to create pgm or pbm files with the gimp
(pbm is known for some time, but gimp definitely writes a ppm file for
greyscale images).

> In fact, any tool reading ppm will accept pgm or pbm as well, and
> automatically promote them.

Definitely _not_.

> Another two seconds of testing shows that gimp does indeed accept pgm
> and ppm as extensions when saving files.

However, saving a grayscale image resulted into a ppm file (with a pgm
suffix).

I think the pnm plug-in should be able to save greyscale as pgm, I don't
care for pbm files.

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED] |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |



Re: pnm plugin

2000-05-02 Thread Kevin Turner

On Tue, May 02, 2000 at 01:47:29PM +0200, DrMartin.Weber wrote:
> The pnm plugin can read the pnm, ppm, pbm and pgm format, but it cannot save to
> ppm, pbm and pgm.

Short version:
--

A) It's not a bug.

B) I just tried it.  It works fine.  Even if you do want to consider it
a bug, it's just not there.  (Unless someone broke the pnm filter
between .19 and .21, which seems highly improbable).

C) What are you smoking?  =)

Long version:
-

Here is my understanding of the pnmutils file formats:
pbm == Portable BitMap (black and white)
pgm == Portable GrayMap
ppm == Portable PixMap (color)

pnm == Portable aNy Map (any of the above)

A pnm tool can take any of pbm, pgm, or ppm as input.
In fact, any tool reading ppm will accept pgm or pbm as well, and
automatically promote them.
It may also be acceptable to use the name "pnm" for any file that
contains pbm, pgm, or ppm data.  (?)

One would assume that a pnm tool's output would depend on the content,
e.g. a GREYSCALE image would be saved as PGM, a RGB image would be saved
as PPM.  

And in fact, about two seconds worth of testing with gimp 1.1.19
demonstrates that this is in fact how it works.
Another two seconds of testing shows that gimp does indeed accept pgm
and ppm as extensions when saving files.

If you need to lower the bit depth, standard pnmutils include
ppmquant: for reducing the number of colors, possibly converting a
  truecolor ppm into an indexed one
ppmtopgm: color => gray
pgmtopbm: gray => bitmap

-- 
Kevin Turner <[EMAIL PROTECTED]> | OpenPGP encryption welcome here
Plug-ins: They make GIMP do stuff.  http://gimp-plug-ins.sourceforge.net/
This list is archived at http://marc.theaimsgroup.com/?l=gimp-developer
To unsubscribe, mail [EMAIL PROTECTED]

 Cold-hearted orb that rules the night
 Removes the colors from our sight
 Red is gray, and yellow white
 But we decide which is right
 And which is a quantization error.

-- ppmtopgm(1)