[comp.windows.x] Problem Converting Mac PICT file to Portable Bitmap

larryc@poe.jpl.nasa.gov (Larry Carroll) (12/28/90)

I'm testing 'pbmplus' program 'picttopbm' & have a problem.

I created a Macintosh PICT file using PixelPaint and transferred it to a Sun3
in the subdirectory containing 'picttopbm' using TOPS. (Later I used the Mac
'File Exchange Program' to copy the same PICT file to an IBM AT & used FTP to
copy it to the Sun3.  Then I did a compare of the two versions of the Mac 
file & found no differences.)

However, when I run 'picttopbm' on the file I get the following message. 
     picttopbm: unknown PICT2 opcode - 0x0c00 - cant't handle

Can some experienced users of 'pbmplus' tell us what's wrong, or suggest how 
we should attempt to do this conversion?  Should we use something beside 
PixelPaint to create the PICT file, for instance?  Or should we create a 
Macintosh TIFF file, perhaps, instead of PICT?

				Larry Carroll

raja@bombay.cps.msu.edu (Narayan S. Raja) (12/28/90)

In article <10860@jpl-devvax>, (Larry Carroll) writes:


< I created a Macintosh PICT file using PixelPaint and transferred it to a Sun3
  [...]
< However, when I run 'picttopbm' on the file I get the following message. 
<      picttopbm: unknown PICT2 opcode - 0x0c00 - cant't handle

picttopbm handles only PICT1, not PICT2
(so far as I know).


< Can some experienced users of 'pbmplus' tell us what's wrong, or suggest how 
< we should attempt to do this conversion?  Should we use something beside 
< PixelPaint to create the PICT file, for instance?  Or should we create a 
< Macintosh TIFF file, perhaps, instead of PICT?

TIFF is another troublesome format -- some
Mac programs seem to produce TIFFs which
are not acceptable to the TIFF programs in
libtiff (and libtiff-based filters like
the ones in FBM, ImageMagick, or tiff2ras).

We do the conversion on the Mac itself,
using GifConverter.  TIFF files produced by
GifConverter seem to be politically correct
according to libtiff.  However, for some
unknown reason GifCoverter seems to produce
only 8-bit color TIFF files.  You can also 
convert to GIF.


Narayan Sriranga Raja.

nazgul@alphalpha.com (Kee Hinckley) (12/29/90)

In article <10860@jpl-devvax.JPL.NASA.GOV> larryc@poe.jpl.nasa.gov (Larry Carroll) writes:
>
>I'm testing 'pbmplus' program 'picttopbm' & have a problem.
I've had a number of "unknown upcode" and other problems with picttopbm.
For some reason it doesn't always get all the pels it expects and I
can't figure out the PICT2 docs enough to figure out why.  I once even
got a picture where every N scan lines were shifted to the right.  There
also seems to be a bug in pbmtopict, that the width and height stored
in the file aren't always correct.  Some programs on the Mac just look
at the data and ignore this, others pay attention to what it says and
will treat the image as though it were truncated.

						-kee
-- 
Alphalpha Software, Inc.	|	motif-request@alphalpha.com
nazgul@alphalpha.com		|-----------------------------------
617/646-7703 (voice/fax)	|	Proline BBS: 617/641-3722

I'm not sure which upsets me more; that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

larryc@porter.jpl.nasa.gov (Larry Carroll) (01/03/91)

In article <deleted> larryc@poe.jpl.nasa.gov (Larry Carroll) writes:
>
>I'm testing 'pbmplus' program 'picttopbm' & have a problem.

Thanks for all the suggestions.  For several reasons I won't go into (they
relate to the specific task I've been given to do) I took the followng
suggestion.

I got the various files supporting 'picttoppm' & 'ppmtopict' from
cayuga.cs.rochester.edu (in file pict-ppm.tar.Z) & added them to my pbmplus
subdirectory 'ppm'.  I added those two program names (and their respective
'man' file names) to the Imakefile in 'ppm' & reran xmkmf to create a new
Makefile.  Then I did a rebuild.

I used PixelPaint on a Macintosh to create a new image file, by importing a
ClipArt file in MacPaint format into a PixelPaint/PICT2 file & adding about
20 colors to various figures.  I used Tops software to transfer the file to a
Sun3 into the 'ppm' directory.  (As a double-check I used Apple's file
interchange program to copy the image file to a 5 1/4" diskette, took that to
an IBM AT, and ftp'd the file to the Sun3.  The 'diff' program showed no
differences.)

After running 'picttoppm' & 'ppmtoxwd' I used 'xwud' to display the X window
dump version of the image file.  Despite two warning messages from
'picttoppm' about two opcodes the program didn't handle, the resulting image
seemed to be a faithful reproduction of the Macintosh image.  (Out of
curiosity, I used 'ppmtorast' & 'xloadimage' & got an apparently identical
image on the Sun3.)
					Larry Carroll