PhotoCD & UNIX? - PCD to TIFF?
David Haight
davidh8 at pogo.wv.tek.com
Wed Mar 9 20:13:03 EST 1994
Gee, I just joined the list and already I can reply to a question.
I joined as a "friend of GRASS users" and will have a few questions of my
own soon. I am a Technical Support Applications Engineer for the color
printer division of Tektronix.
The QUESTIONS from Ronald Thomas (ront at meeker.cfnr.colostate.edu)
>1) Can a PhotoCD be mounted on a UNIX system? If so, how?
> (I tried the standard "mount -r /dev/sr0 /cdrom", but no luck
> -- is it a specific file system type that needs to be noted?)
> I can attach the CD to either a SPARCclassic or an IPX.
>
You can mount a PhotoCD as iso9660. Be warned though, if it is a multi-
session you will only be able to read the first session.
>2) If # 1 is possible, can I just copy the *.pcd files I want to my
> SPARCclassic and use as they are, or do I need to run "dos2unix"
> on them?
>
You can copy them or you can just convert off your CDrom drive to your
hard disk.
>3) Is there a PCD to TIFF converter around, perhaps as a new addition
> to the PBMplus toolkit? (I'd like a straight, hi-resolution
> conversion of the PCD format to TIFF)
>
I use a routine, hpcdtoppm, I'll include the man page for iman page for it
at the end of this. I use it on an SGI Indigo and I'm not sure if I still
have the source but the author's email address is in the man page and I know
I got it off the net.
>4) Is there a UNIX (SunOS 4.1.3 or Sol 2.2) viewer of Kodak
> PhotoCD's, or a program that views/reads/converts the
> *.pcd format?
This one I don't know for sure. The SGI now has a viewer. You might check
the latest version ov XV (3.0 I think). You can certainly use XV on the
result of the conversion with hpcdtoppm. I'm pretty sure you can make hpcdtoppm
available to XV.
The man page follows at the end of this.
David Haight
Tektronix Technical Support
davidh8 at pogo.wv.tek.com
800-835-6100 x 7354
hpcdtoppm(1) USER COMMANDS hpcdtoppm(1)
NAME
hpcdtoppm v0.4 - convert a Photo-CD file into a portable
pixmap
SYNOPSIS
hpcdtoppm [options] pcd-file [ppm-file]
DESCRIPTION
Decodes a Photo-CD Image file or Overview file. Image files
you can find on the Photo-CD in photo_cd/images, they are
named as "imgnnnn.pcd", where nnnn is a 4-digit-number. The
Overview file is at photo_cd/overview.pcd . If there is no
output filename given, output will be printed to stdout.
hpcdtoppm stands for "Hadmut's pcdtoppm" to make it distin-
guishable in case someone else is building the same thing
and calling it pcdtoppm.
OPTIONS
-x Overskip Mode. Works on Base/16, Base/4, Base and
4Base. In Photo-CD images the luma channel is stored in
full resolution, the two chroma channels are stored in
half resolution only and have to be interpolated. In
the Overskip Mode the chroma channels of the next
higher resolution are taken instead of interpolating.
To see the difference, generate one ppm with and one
ppm without this flag. Use pnmarith to generate the
difference image of these two images. Call ppmhist for
this difference or show it with xv (push the HistEq
button in the color editor).
-s Apply simple sharpness-operator on the Luma-channel.
-d Do not show the complete image, but only the
decompressed difference. It works only on the 4Base
and the 16Base resolution. It does not have any deeper
sense, but it was simple to implement and it shows what
causes different sizes of image files.
-i Give some information from the fileheader to stderr. It
works only for Image files. (It is not working
correctly, just printing some strings.)
-m Show the phases of decoding to stderr.
-crop
Try to cut off the black frame which is sometimes
scanned at the image borders. The image size shrinks.
-pos Print the file relative start position of the data for
the current resolution.
-rep Try to jump over reading errors in Huffman code.
Sun Release 4.1 Last change: 16 March 1993 1
hpcdtoppm(1) USER COMMANDS hpcdtoppm(1)
-n Don't rotate the image.
-r Rotate the picture clockwise for portraits.
-l Rotate the picture counter-clockwise for portraits.
-a Try to find out the image orientation byself. This
doesn't work for overview files yet. It is very experi-
mental and depends on one byte. Please tell me if it
doesn't work.
-vert
Vertical flip.
-hori
Horizontal flip.
-rgb Write rgb image in IRIS RGB format.
-ppm Write rgb image in ppm-format.
-pgm Write grayscale image in pgm-format.
-ycc Write ycc image in ppm-format.
-ps Write rgb image in postscript.
-eps Write rgb image in encapsulated postscript.
-psg Write grayscale image in postscript.
-epsg
Write grayscale image in encapsulated postscript.
-pl f
Set left position of Postscript image to f.
-pb f
Set bottom position of Postscript image to f.
-pw f
Set width of Postscript image to f.
-ph f
Set height of Postscript image to f.
-c0 Don't correct the image.
-c- Do a correction (darker). Hardware and taste dependend.
-c+ Do a correction (brighter). Hardware and taste depen-
dend.
Sun Release 4.1 Last change: 16 March 1993 2
hpcdtoppm(1) USER COMMANDS hpcdtoppm(1)
-1 | -Base/16 | -128x192
Extract the Base/16 size picture (size 128x192 pixels).
Note that you can only give one size option.
-2 | -Base/4 | -256x384
Extract the Base/4 size picture.
-3 | -Base | -512x768
Extract the Base size picture.
-4 | -4Base | -1024x1536
Extract the 4Base size picture.
-5 | -16Base | -2048x3072
Extract the 16Base size picture.
-0 | -Overview | -O
Extract all pictures from an Overview file. A
ppmfilename must be given. If the given name is "foo",
the files are named "foonnnn", where nnnn is a 4-digit
number. Since they are stored in Base/16 format, they
are extracted in this format.
-C d Extract all pictures from an Overview file. A
ppmfilename must be given. If the given name is "foo",
the files are named "foonnnn", where nnnn is a 4-digit
number. Since they are stored in Base/16 format, they
are extracted in this format.
BUGS
hpcdtoppm seems to ignore the read protection. :-) The
informations i have are quite vague and this program was
developed by starring at the hex-dumps and the famous
trial-and-error-method. If anything doesn't work, please
send me a report and perhaps you could try to find out, why
it doesn't work.
SEE ALSO
ppm(5), ppmquant(1), ppmtopgm(1), ppmhist(1), pnmarith(1),
ppmtorgb3(1), xv(1)
AUTHOR
Copyright (c) 1992, 1993 by Hadmut Danisch
(danisch at ira.uka.de). Permission to use and distribute this
software and its documentation for noncommercial use and
without fee is hereby granted, provided that the above copy-
right notice appear in all copies and that both that copy-
right notice and this permission notice appear in supporting
documentation. It is not allowed to sell this software in
any way. This software is not public domain.
Sun Release 4.1 Last change: 16 March 1993 3
More information about the grass-user
mailing list