sam2Postscript-0.44
所属分类:网络编程
开发工具:Visual C++
文件大小:4041KB
下载次数:88
上传日期:2009-05-05 14:26:51
上 传 者:
mumucom
说明: 将图片转换成ps文件(postscript)
(Ps the picture into a document (postscript))
文件列表:
sam2Postscript-0.44\appliers.cpp (94800, 2009-04-10)
sam2Postscript-0.44\at_bitmap.h (2331, 2003-02-05)
sam2Postscript-0.44\bts2.tth (98317, 2009-04-02)
sam2Postscript-0.44\cgif.c (51612, 2006-07-02)
sam2Postscript-0.44\cgif.h (9370, 2005-01-20)
sam2Postscript-0.44\config-vc6.h (4842, 2009-04-10)
sam2Postscript-0.44\config2.h (8887, 2005-04-12)
sam2Postscript-0.44\crc32.c (6078, 2002-12-11)
sam2Postscript-0.44\crc32.h (636, 2002-12-09)
sam2Postscript-0.44\Debug\111.bmp (4289334, 2009-03-03)
sam2Postscript-0.44\Debug\111.jfif (238794, 2009-04-03)
sam2Postscript-0.44\Debug\111.ps (833148, 2009-04-10)
sam2Postscript-0.44\Debug\222.jpg (28068, 2007-10-24)
sam2Postscript-0.44\Debug\222_222.ps (35979, 2009-05-05)
sam2Postscript-0.44\Debug\333.bmp (1739538, 2008-03-22)
sam2Postscript-0.44\Debug\appliers.obj (191265, 2009-04-10)
sam2Postscript-0.44\Debug\appliers.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\crc32.obj (3720, 2009-04-10)
sam2Postscript-0.44\Debug\crc32.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\encoder.obj (155758, 2009-04-10)
sam2Postscript-0.44\Debug\encoder.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\error.obj (56557, 2009-04-10)
sam2Postscript-0.44\Debug\error.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\gensi.obj (127823, 2009-04-10)
sam2Postscript-0.44\Debug\gensi.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\gensio.obj (134230, 2009-04-10)
sam2Postscript-0.44\Debug\gensio.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\image.obj (173292, 2009-04-10)
sam2Postscript-0.44\Debug\image.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\in_bmp.obj (21172, 2009-04-10)
sam2Postscript-0.44\Debug\in_bmp.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\in_gif.obj (45605, 2009-04-10)
sam2Postscript-0.44\Debug\in_gif.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\in_jai.obj (41921, 2009-04-10)
sam2Postscript-0.44\Debug\in_jai.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\in_jpeg.obj (38559, 2009-04-10)
sam2Postscript-0.44\Debug\in_jpeg.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\in_lbm.obj (22190, 2009-04-10)
sam2Postscript-0.44\Debug\in_lbm.sbr (0, 2009-04-10)
sam2Postscript-0.44\Debug\in_pcx.obj (18364, 2009-04-10)
... ...
sam2p -e:0 222.jpg 222_222.ps
±×PS
README for sam2p
by pts@fazekas.hu
at Sun Dec 30 19:30:17 CET 2001 -- Fri Mar 22 19:25:03 CET 2002
Sat Apr 27 00:39:12 CEST 2002
Wed Jul 3 01:20:40 CEST 2002
Wed Feb 5 19:46:51 CET 2003
grammatical corrections by Steve Turner at Mon Jan 10 00:53:46 CET 2005
This is the README file for sam2p, a raster to PostScript/PDF image
conversion program. This file contains a 5-minute turbo tutorial for new and
impatient users (search for the phrase `Turbo tutorial' in your text editor).
As of now, this README file is the only, and definitive, documentation of sam2p.
sam2p is a UNIX command line utility written in ANSI C++ that converts many
raster (bitmap) image formats into Adobe PostScript or PDF files and several
other formats. The images are not vectorized. sam2p gives full control to
the user to specify standards-compliance, compression, and bit depths. In
some cases sam2p can compress an image 100 times smaller than the PostScript
output of many other common image converters. sam2p provides ZIP, RLE and
LZW (de)compression filters even on Level1 PostScript devices.
A testimonial from Grant Ingram, UK: Anyway this is just a quick note to say
thanks for writing the sam2p utility which I am using to create EPS figures
of photographs for my thesis -- it works very well producing image sizes
that are some 3% of the ones produced by ImageMagick.
Does sam2p generate small EPS (and PDF) files?
A testimonial from Tom Schneider, US:
-rw------- 1 toms delila 88628 Mar 3 17:38 prototype-small.eps
-rw------- 1 toms delila 7979299 Feb 24 12:25 prototype.eps
Good GRIEF you have written a nice program!!!! The file is 90 fold
smaller than the one from Imagemagick's convert.
That image that was 90x smaller had been bugging me because it was so
large that xdvi would strongly hesitate while I passed by the page.
Now it just has a minor delay, thanks to you.
Many thanks to Steve Turner for reviewing and making corrections to this
documentation.
The author of sam2p recommends his program over other image converters
because of the following reasons:
-- sam2p produces much smaller output
-- sam2p gives the user complete control over the data layout of the output
image. This includes Compression, SampleFormat and TransferEncoding.
-- sam2p is fast
-- sam2p doesn't depend on external libraries. (But it does depend on external
programs for _reading_ JPEG, TIFF and PNG files.)
-- sam2p supports the mainstream image formats of today without compromise.
sam2p has many file format fine-tuning features that are missing from
most other converter utilities. For example:
TIFF ZIP compression, TIFF LZW compression, TIFF
JPEG compression, transparent PNG files, BMP RLE-4 and RLE-8
compression, etc.
-- sam2p supports all levels (versions) of the PostScript language and
output images have the smallest file size allowed by the LanguageLevel.
-- PostScript ZIP, RLE and LZW compression is provided for _all_
LanguageLevels (!), even for PSL1 (which appeared in 1***0). You can print
your ZIP-compressed images onto your ancient printer of the 1***0s.
-- sam2p supports all versions of PDF, and as with PostScript,
output images have the smallest file size allowed by the version.
-- output images of sam2p are always compliant to the standard selected by
the user
-- output images of sam2p are real-world compatible, i.e the author has
tested them with many common image processing programs, for example:
Ghostscript, pdfTeX, xpdf, Acrobat Reader, The GIMP, ImageMagick, xv,
Acrobat Distiller, QuarkXPress, InDesign. The author has also tested
PostScript files on HP and OkiData printers.
-- sam2p converts every pixel faithfully, preserving all the 24 RGB bits
intact. There is no quality or information loss unless you ask for it.
-- sam2p uses only a minimal number of libraries. You don't have to install
33Mb of ballast software to use sam2p. Image libraries (libtiff etc.) are
_not_ used, the math library is not used, libstdc++ is not used, zlib is
not used.
Long-term limitations:
-- only DeviceRGB color space, with the Indexed, Gray and RGB image types
-- Indexed images are limited to a maximum of 256 colors
-- alpha channel and transparency supported only for Indexed images: only
one color may be transparent
-- the entire input image is read into memory. During operation both the
input and the output images may be held in memory.
Status
~~~~~~
sam2p is currently beta software. It is available from:
http://www.inf.bme.hu/~pts/sam2p/
http://www.inf.bme.hu/~pts/sam2p-latest.tar.gz
http://sam2p.sf.net/
The documentation is incomplete, but -- together with the examples -- it is
quite useful. Please have a look at the home page to find articles and more
documentation (the PDF docs are much more eye-pleasing than this README).
The source code contains valuable comments, but they may be hard to find
unless you're deeply into developing sam2p.
The author is developing sam2p in his free time. (He is studying and
working in non-free time.)
The imaging model is complete. Image output routines are stable and
adequate. Reasonable defaults are provided for all command line options.
sam2p can usually find the best SampleFormat automatically. There is
an educated (but not perfect) default guess for the Compression.
See subsection {OutputRule combinations} about all planned formats.
The most important short-term limitations:
-- The code hasn't been extensively tested. The author welcomes bug reports.
-- The code hasn't been profiled for speed bottlenecks. (Although it seems
to be faster than ImageMagick convert(1) in most situations.)
Turbo tutorial
~~~~~~~~~~~~~~
Quick compilation instructions:
1. ./configure --enable-lzw --enable-gif
2. make
3. Copy the `sam2p' executable to your $PATH, or invoke it as `./sam2p'.
Quick try:
-- ./sam2p examples/pts2.pbm try.eps
-- ./sam2p examples/pts2.pbm try.pdf
-- ./sam2p examples/pts2.pbm try.ps
-- ./sam2p examples/pts2.pbm try.png
-- ./sam2p examples/pts2.pbm try.tiff
-- ./sam2p examples/pts2.pbm try.xpm
-- ./sam2p examples/pts2.pbm try.bmp
-- ./sam2p examples/pts2.pbm try.jpg
A really short User's guide
"""""""""""""""""""""""""""
To convert an image, call:
./sam2p
Example: ./sam2p examples/pts2.pbm try.eps
To print an image as a full PostScript page, call:
./sam2p [MARGIN-SPECS] ps: - | lpr
Example: ./sam2p -m:1cm examples/pts2.pbm ps: - | lpr
To convert an image to be included as EPS (Encapsulated PostScript) into
(La)TeX documents, call:
./sam2p
Example: ./sam2p examples/pts2.pbm test.eps
In file.tex: \usepackage{graphicx} ... \includegraphics{test}
To convert an image to be included as PDF into pdf(La)TeX documents, call:
./sam2p
Example: ./sam2p examples/pts2.pbm test.pdf
In file.tex: \usepackage{graphicx} ... \includegraphics{test}
If you have a large image file (possibly originating from dumb software),
you can reduce the image size and keep the same filename. (Please note that
some meta-information may be lost using this method.) This operation is
_DANGEROUS_ if you don't have a backup, because due to a software or
hardware problem, sam2p might clobber time image file so the actual image
gets lost. To overwrite a file in-place, call:
./sam2p --
Example: ./sam2p test.tiff --
You may specify a compression method (or supply other command line options)
to make a file even smaller, call:
./sam2p [OPTIONS]
Example: ./sam2p -c:zip test.tiff test2.tiff
See the detailed documentation of available command-line options elsewhere
in this document. You may also read section {FAQ} for more information.
Too see a list about the supported input and output image file formats, call:
./sam2p
Example output:
This is sam2p v0.39.
Available Loaders: JAI PNG JPEG TIFF PNM BMP GIF LBM XPM PCX TGA.
Available Appliers: XWD Meta Empty BMP PNG TIFF6 TIFF6-JAI JPEG-JAI JPEG PNM GIF89a XPM PSL1C PSL23+PDF PDF-JAI PSL2-JAI l1fa85g P-TrOpBb.
Usage: [...]
The list of ``Available Loaders'' lists the input image file formats. All
except for JAI are self-explanatory. JAI is JPEG-as-is, it means reading a
JPEG file and writing back the exactly same image into an other JPEG variant,
without quality loss.
From the list of ``Available Appliers'' one can derive the supported output
image file formats. XWD, BMP, PNG, TIFF6, JPEG, PNM, GIF89a and XPM are
self-explanatory. TIFF6-JAI, JPEG-JAI, PDF-JAI and PSL2-JAI are JPEG
variants into which JAI files (see above) can be saved. While the names of
the remaining appliers may be quite cryptic to the beginner user; most of
those appliers provide sam2p's excellent support for writing PS, EPS and
PDF files.
sam2p operation modes
~~~~~~~~~~~~~~~~~~~~~
sam2p is a command line utility (i.e, without a graphical user
interface), so it can be used by composing a command line with the
appropriate options and parameters, and launching it. See sections ``Turbo
tutorial'' and ``One-liner mode'' for more details.
sam2p is not interactive, it doesn't ask questions; thus it is completely
suitable for batch processing and automation. sam2p doesn't log errors, but
its STDERR can be redirected to a log file quite easily.
There are three modes sam2p can operate in:
-- one-liner mode: (since sam2p 0.37)
the user, perhaps, has to type a long command line, specifying the input
and the output file name, output file format, compression options, etc.
Most of the functionality of sam2p is available in a quite intuitive way
in one-liner mode. Users of the `convert' utility from ImageMagick and
`tiff2ps' and `tiffcp' will find that one-liner mode of sam2p is very
similar to them. This mode is recommended for impatient users.
Due to the nature of sam2p development, some new functionality of job mode
might be missing from one-liner mode. Please report this as a bug.
-- job mode: the user has to write a ``job'' file (recommended extension:
.job), which specifies all conversion parameters, including the input and
output file name. The name of the job file must be passed to sam2p. This
mode is recommended for expert users who want to retain full control of
all aspects of the final output. All functionality is available in job
mode. This is especially useful in repetative but time separated jobs.
-- GUI mode: This is completely experimental, and will be very probably
dropped in the near future. Try executing sam2p.tk (TCL/Tk is required).
Please don't use GUI mode, use one-liner mode instead! The flexability
of a one-liner (or job) mode is nearly imposible to encompas in a GUI.
No more documentation is provided for GUI mode.
There might be a Micro$oft Windoze version of sam2p available in the near
future, but very probably you won't get real GUI with radio boxes, lists
and file selection dialogs. You'll have to start sam2p from the DOS
prompt...
One-liner mode
~~~~~~~~~~~~~~
This section contains a reference-style summary for the one-liner mode.
The author knows that this section is quite incomprehensible, and a bit old.
He is planning to completely rewrite it to be readable for the novice user.
The order of the arguments and options is significant.
Input file extension is discarded. The file format is recognised by its
magic number.
Output file extension gives a hint for /FileFormat:
.ps :\
.eps : \ where PS: implies scale to fit page
.epsi : > PSL1 PSLC PSL2 PSL3 and
.epsf : / EPS: implies no scale changes
[E]PS::/ also see Q9 in FAQs below
.pdf : \ PDF1.0 PDF1.2 (and)
PDF: : / PDFB1.0 PDFB1.2
.gif : GIF89a
.pnm : PNM (for use with transparency)
.pbm : PNM /SampleFormat/Gray1
.pgm : PNM /SampleFormat/Gray8
.ppm : PNM /SampleForamt/Rgb8
.pam : PAM
.pip : PIP
.empty : Empty
.meta : Meta
.jpeg : JPEG
.jpg : "
.tiff : TIFF
.tif : "
.png : PNG
.xpm : XPM
.bmp : BMP /Compression/RLE
.rle : BMP /Compression/RLE
Options (case insensitive):
-- -j -j:job : display in-memory .job file
-- -j:warn : be verbose and display warnings about impossible combinations in
the .job file
-- -j:quiet : print only error and fatal error messages, suppress
warnings, notices etc. Must be put at the beginning of the
command line to suppress initial banners, too. For example,
`sam2p -j:quiet in.gif out.eps'.
-- -s:Indexed1:Indexed4:Indexed8: Try /SampleFormats in this order, and try
all others after these. Can be specified separately
(e.g `-s Indexed1 -s Indexed2:Indexed8')
-- -s:Indexed1:Indexed4:Indexed8:stop: Try only these /SampleFormats in
this order. Can be specified separately
(e.g `-s Indexed1:Indexed2 -s Indexed8:stop')
-- -s:Indexed1:Indexed4:Indexed8:stopq: Try only these /SampleFormats in
this order, be quiet (no warnings on failures). Can be
specified separately (e.g `-s Indexed1:Indexed2 -s Indexed8:stop')
-- -s:tr equivalent to `-s Transparent:Opaque:Mask:Transparent2:Transparent4:Transparent8'
-- -l:... : /LoadHints(...)
-- disabled: -a: /LoadHints(asis) extra /Compression/JAI; load JPEG files (and others as-is)
-- -1 -ps:1 PSL1: : [tiff2ps] hint /FileFormat/PSL1 among /PSL*
-- -1c -ps:1c -ps:c PSLC: : [pts] hint /FileFormat/PSLC among /PSL*
-- -2 -ps:2 PSL2: EPS2: : [tiff2ps,imagemagick] default hint /FileFormat/PSL2 among /PSL*
-- -3 -ps:3 PSL3: : [pts] hint /FileFormat/PSL3 among /PSL*
-- -pdf:b0 PDFB1.0: : [pts] hint /FileFormat/PDFB1.0 among /PDF*
-- -pdf:b2 PDFB1.2: : [pts] default hint /FileFormat/PDFB1.2 among /PDF*
-- -pdf:0 PDF1.0: : [pts] hint /FileFormat/PDF1.0 among /PDF*
-- -pdf:2 PDF1.2: : [pts] hint /FileFormat/PDF1.2 among /PDF*
-- EPS: EPSF: : [pts] hint /FileFormat/PSL2 or
/FileFormat/PSL3 (for /Compression/ZIP)
-- PDF: : [pts] hint /FileFormat/PDFB1.0 or
/FileFormat/PDFB1.2 (for /Compression/ZIP)
-- PS: : [pts] hint /Scale/RotateOK /FileFormat/PSL2 or
/FileFormat/PSL3 (for /Compression/ZIP)
-- PS2: : [imagemagick] hint /Scale/RotateOK
/FileFormat/PSL2. Deprecated, please use PS:.
-- -e:0 -e:none : /Scale/None
-- -e -e:1 -e:scale : /Scale/OK //×
-- -e:rot -e:rotate : /Scale/RotateOK //±90
-- GIF: GIF89a: : [imagemagick,pts] /FileFormat/GIF89a
-- JPEG: JPG: : [imagemagick,pts] /FileFormat/JPEG
-- TIFF: TIF: : [imagemagick,pts] /FileFormat/TIFF
-- PNG: : [imagemagick] /FileFormat/PNG
-- XPM: : [imagemagick] /FileFormat/XPM
-- BMP: : [imagemagick] /FileFormat/BMP
-- Empty: : [pts] /FileFormat/Empty
-- Meta: : [pts] /FileFormat/Meta
-- PIP: : [pts] /FileFormat/PIP
-- PAM: : [pts] /FileFormat/PAM
-- PNM: : [imagemagick] /FileFormat/PNM (for use with transparency)
-- PBM: : [imagemagick] /FileFormat/PNM /SampleFormat/Gray1
-- PGM: : [imagemagick] /FileFormat/PNM /SampleFormat/Gray8
-- PPM: : [imagemagick] /FileFormat/PNM /SampleFormat/Rgb8
-- -t:bin : [pts] hint /TransferEncoding/Binary (default unless /PS*)
-- -t:hex : [pts] hint /TransferEncoding/Hex (default for /PSL1 /PSLC)
-- -t:a85 : [pts] hint /TransferEncoding/A85 (default for /PSL2 /PSL3)
-- -t:ascii : [pts] hint /TransferEncoding/ASCII
-- -t:lsb1 -f:lsb2msb : [pts,tiffcp] hint /TransferEncoding/LSBfirst
-- -t:msb1 -f:msb2lsb : [pts,tiffcp] hint /TransferEncoding/MSBfirst
-- -c:none : [pts,tiffcp] non-default hint /Compression/None
-- -c:lzw : [pts,tiffcp] hint /Compression/LZW
-- -c:lzw:(1..99) : [pts] hint /Compression/LZW /Predictor ...
-- -c:zip : [pts,tiffcp] hint /Compression/ZIP
-- -c:zip:(1..99) : [pts] hint /Compression/ZIP /Predictor ...
-- -c:zip:(1..99):(-1..9) : [pts] hint /Compression/ZIP /Predictor ... /Effort ...
-- -c:(rle|packbits) : [pts,tiffcp] hint /Compression/RLE
-- -c:(rle|packbits):(0..) : [pts] hint /Compression/RLE /RecordSize ...
-- -c:fax : [pts] hint /Compression/Fax
-- -c:fax:(-1..) : [pts] hint /Compression/Fax /K ...
-- -c:dct : [pts] hint /Compression/DCT /DCT<<>>
-- -c:dct:... : [pts] hint /Compression/DCT /DCT<<...>>
-- -c:jpeg : [pts,tiffcp] hint /Compression/JAI, /Compression/IJG
-- -c:jpeg:(0..100) : [pts] hint /Compression/JAI, /Compression/IJG /Quality ...
-- -c:ijgi : [pts,tiffcp] hint /Compression/IJG
-- -c:ijg:(0..100) : [pts] hint /Compression/IJG /Quality ...
-- -c:g4 : [pts] equivalent to -c:fax:-1
-- -c:g3 -c:g3:1d : [pts] equivalent to -c:fax:0, -c:fax
-- -c:g3:2d : [pts] equivalent to -c:fax:-2
-- -c:jai : [pts] hint /Compression/JAI
-- -m:dpi:(dimen) : set /ImageDPI to `dimen'
-- -m:(dimen) \ : set all margins (/TopMargin,/BottomMargin, /LeftMargin, /RightMargin) to `dimen'
-m:all:(dimen) \ : /LeftMargin, /RightMargin) to `dimen'
-m:a:(dimen) :
-- -m:horiz:(dimen) \ : set /LeftMargin and /RightMargin to `dimen'
-m:h:(dimen) \ :
-m:x:(dimen) :
-- -m:vert:(dimen) \ : set /TopMargin and /BottomMargin to `dimen'
-m:v:(dimen) \ :
-m:y:(dimen) :
-- -m:left:(dimen) \ : set /LeftMargin to `dimen'
-m:l:(dimen) :
-- -m:right:(dimen) \ : set /RightMargin to `dimen'
-m:r:(dimen) :
-- -m:top:(dimen) \ : set /TopMargin to `dimen'
-m:t:(dimen) \ :
-m:up:(dimen) \ :
-m:u:(dimen) :
-- -m:bottom:(dimen) \ : set /BottomMargin to `dimen'
-m:b:(dimen) \ :
-m:down:(dimen) \ :
-m:d:(dimen) :
-- -- : if given as last arg, then OutputFile:=InputFile
-- -- : if given earlier than last arg, then treat other args as filenames
-- -transparent:(rgb) Change the all pixels having the specified RGB color
to transparent. Previously transparent pixels are not changed. See FAQ
answer A44 for an exampe.
Default and fallback compression types for each file format:
-- PSL1 PSLC : /RLE
-- PSL2 PDFB1.0 PDF1.0 : /JAI /RLE
-- PSL3 PDFB1.2 PDF1.2 : /JAI /ZIP
-- GIF89a : /LZW
-- XPM PNM PAM PIP Empty Meta : )/None)
-- JPEG : /JAI /IJG
-- TIFF : /JAI /LZW? /RLE
-- PNG : /ZIP
-- BMP : /RLE
Overview of job mode
~~~~~~~~~~~~~~~~~~~~
In the ``job mode'' sam2p doesn't accept any command line options. It must be
controlled from the ``job'' files. In ''job mode'' sam2p expects a single command
line argument: the name of the Job file (file format described in section
{Jobs}). sam2p runs that single job, prints debug, info, notice, warning and
error messages (etc.), and creates a single output file: a ... ...
近期下载者:
相关文件:
收藏者: