⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0243-0248.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:




<HTML>

<HEAD>

<TITLE>Developer.com - Online Reference Library - 0672311623:SAMS TEACH YOURSELF LINUX IN 24 HOURS:Graphics Tools</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311623 //-->

<!-- TITLE=SAMS TEACH YOURSELF LINUX IN 24 HOURS //-->

<!-- AUTHOR=BILL BALL, STEPHEN SMOOGEN //-->

<!-- PUBLISHER=MACMILLAN //-->

<!-- IMPRINT=SAMS //-->

<!-- PUBLICATION DATE=1998 //-->

<!-- CHAPTER=16 //-->

<!-- PAGES=0243-0258 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->







<P><CENTER>

<a href="../ch15/0241-0242.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0249-0251.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-243"><P>Page 243</P></A>







<H3><A NAME="ch16_ 2">

Hour 16

</A></H3>





<H2>

<A NAME="ch16_ 3">

Graphics Tools

</A>

</H2>



<P>In this hour you'll be introduced to a variety of graphics programs and

utilities for Linux. This hour starts with a short discussion of different

graphics formats you'll find on your system, then shows you how to convert

graphics using filter programs and other graphic utilities. These programs are

useful for creating, editing, and translating graphics imported from other

computer systems.

</P>



<P>You'll find a treasure trove of great graphics programs on this book's

CD-ROM, and you're likely to be impressed with their usefulness and

versatility. You'll be able to translate nearly any type of graphic, and will be able to

perform sophisticated operations to transform your graphics files.

</P>



<H3><A NAME="ch16_ 4">

Understand Linux Graphics File Formats

</A></H3>



<P>There are many different types of graphics file formats, and examples

of several types are installed in your system. You may already be familiar

with several different formats, especially if you've used other computer

operating systems. However, when you use Linux, expect to run into graphics files

in formats you've never seen before.

</P>



<P>Many files can be recognized by the filename's extension, or letters

following

</P>



<A NAME="PAGENUM-244"><P>Page 244</P></A>





<P>

a period in the filename. For example, you may recognize .GIF, .PCX, .TIF, or .JPG

as common extensions. In Linux, you'll also find files in formats such as .xbm or .xpm

installed on your system. The

/usr/X11R6/include/X11/bitmaps directory contains nearly 100

different bitmap files, and the

/usr/X11R6/lib/X11/xfm directory contains more than 100

black-and-white bitmap icons, as well as  more than 110 color pixmap icons.

</P>



<P>Table 16.1 is a list of some of the graphics formats, along with

relevant conversion programs you'll find on your system. To convert a graphic image from one format

to another, see the manual page for the relevant

conversion program.

</P>



<P>Table 16.1. Linux graphics formats and conversion programs.

</P><BR>



<TABLE>



<TR><TD>

Format

</TD><TD>

Type

</TD><TD>

Conversion Program



</TD></TR><TR><TD>

.10x

</TD><TD>

Gemini 10X

</TD><TD>

pbmto10x



</TD></TR><TR><TD>

.3d

</TD><TD>

Red/Blue 3D pixmap

</TD><TD>

ppm3d



</TD></TR><TR><TD>

.asc

</TD><TD>

ASCII text

</TD><TD>

pbmtoascii



</TD></TR><TR><TD>

.atk

</TD><TD>

Andrew Toolkit raster

</TD><TD>

atktopbm<BR>

pbmtoatk



</TD></TR><TR><TD>

.bg

</TD><TD>

BBN BitGraph graphic

</TD><TD>

pbmtobg



</TD></TR><TR><TD>

.bmp

</TD><TD>

Windows, OS/2 bitmap

</TD><TD>

bmptoppm<BR>

ppmtobmp



</TD></TR><TR><TD>

.brush

</TD><TD>

Xerox doodle brush

</TD><TD>

brushtopbm



</TD></TR><TR><TD>

.cmu

</TD><TD>

CMU window manager bitmap

</TD><TD>

cmuwmtopbm<BR>

pbmtocmuwm



</TD></TR><TR><TD>

.ddif

</TD><TD>

DDIF image

</TD><TD>

pnmtoddif



</TD></TR><TR><TD>

.dxb

</TD><TD>

AutoCAD database file

</TD><TD>

ppmtoacad<BR>

sldtoppm



</TD></TR><TR><TD>

.dvi

</TD><TD>

TeX printer file

</TD><TD>

dvips<BR>

dvilj4<BR>

dvilj4l<BR>

dvilj2p<BR>

dvilj<BR>



</TD></TR><TR><TD>

.epsi

</TD><TD>

PostScript preview bitmap

</TD><TD>

pbmtoepsi



</TD></TR><TR><TD>

.epson

</TD><TD>

Epson printer graphic

</TD><TD>

pbmtoepson



</TD></TR><TR><TD>

.fits

</TD><TD>

FITS file

</TD><TD>

fitstopnm



</TD></TR></TABLE>



<A NAME="PAGENUM-245"><P>Page 245</P></A>







<TABLE>



<TR><TD>

Format

</TD><TD>

Type

</TD><TD>

Conversion Program



</TD></TR><TR><TD>

</TD><TD>

</TD><TD>

pnmtofits



</TD></TR><TR><TD>

.g3

</TD><TD>

Group 3 fax file

</TD><TD>

g3topbm<BR>

pbmtog3



</TD></TR><TR><TD>

.gif

</TD><TD>

Graphics Interchange

</TD><TD>

giftopnm<BR>

gif2tiff<BR>

ppmtogif



</TD></TR><TR><TD>

.go

</TD><TD>

Compressed GraphOn

</TD><TD>

pbmtogo



</TD></TR><TR><TD>

.gould

</TD><TD>

Gould scanner file

</TD><TD>

gouldtoppm



</TD></TR><TR><TD>

.icn

</TD><TD>

Sun icon

</TD><TD>

icontopbm<BR>

pbmtoicon



</TD></TR><TR><TD>

.ilbm

</TD><TD>

IFF ILBM file

</TD><TD>

ilbmtoppm<BR>

ppmtoilbm



</TD></TR><TR><TD>

.img

</TD><TD>

GEM image file

</TD><TD>

gemtopbm<BR>

pbmtogem<BR>

imgtoppm



</TD></TR><TR><TD>

.icr

</TD><TD>

NCSA ICR raster

</TD><TD>

ppmtoicr



</TD></TR><TR><TD>

.jpeg

</TD><TD>

JPEG

</TD><TD>

cjpeg<BR>

djpeg<BR>

jpegtran



</TD></TR><TR><TD>

.lj

</TD><TD>

HP LaserJet data

</TD><TD>

pbmtolj



</TD></TR><TR><TD>

.ln03

</TD><TD>

DEC LN03+ Sixel output

</TD><TD>

pbmtoln03



</TD></TR><TR><TD>

.mgr

</TD><TD>

MGR bitmap

</TD><TD>

mgrtopbm<BR>

pbmtomgr



</TD></TR><TR><TD>

.mitsu

</TD><TD>

Mitsubishi S340-10 file

</TD><TD>

ppmtomitsu



</TD></TR><TR><TD>

.mtv

</TD><TD>

MTV ray tracer

</TD><TD>

mtvtoppm



</TD></TR><TR><TD>

.pbm

</TD><TD>

Portable bitmap

</TD><TD>

pbm*



</TD></TR><TR><TD>

.pcl

</TD><TD>

HP PaintJet PCL

</TD><TD>

ppmtopjxl



</TD></TR><TR><TD>

.pcx

</TD><TD>

PCX graphic

</TD><TD>

pcxtoppm<BR>

ppmtopcx



</TD></TR><TR><TD>

.pgm

</TD><TD>

Portable graymap

</TD><TD>

pbmtopgm



</TD></TR></TABLE>



<!-- CODE SNIP //-->

<PRE>

                                                   continues

</PRE>

<!-- END CODE SNIP //-->







<A NAME="PAGENUM-246"><P>Page 246</P></A>





<P>

Table 16.1. continued

</P><BR>



<TABLE>



<TR><TD>

Format

</TD><TD>

Type

</TD><TD>

Conversion Program



</TD></TR><TR><TD>

</TD><TD>

</TD><TD>

pgmtoppm<BR>

ppmtopgm



</TD></TR><TR><TD>

.pi1

</TD><TD>

Atari Degas file

</TD><TD>

pi1toppm<BR>

ppmtopi1



</TD></TR><TR><TD>

.pi3

</TD><TD>

Atari Degas file

</TD><TD>

pbmtopi3<BR>

pi3topbm



</TD></TR><TR><TD>

.pict

</TD><TD>

Macintosh PICT file

</TD><TD>

picttoppm<BR>

ppmtopict



</TD></TR><TR><TD>

.pj

</TD><TD>

HP PaintJet file

</TD><TD>

pjtoppm<BR>

ppmtopj



</TD></TR><TR><TD>

.pk

</TD><TD>

PK format font

</TD><TD>

pbmtopk<BR>

pktopbm



</TD></TR><TR><TD>

.plot

</TD><TD>

UNIX plot file

</TD><TD>

pbmtoplot



</TD></TR><TR><TD>

.png

</TD><TD>

Portable Network Graphic

</TD><TD>

pngtopnm<BR>

pnmtopng



</TD></TR><TR><TD>

.pnm

</TD><TD>

Portable anymap

</TD><TD>

pnm*



</TD></TR><TR><TD>

.pnt

</TD><TD>

MacPaint file

</TD><TD>

macptopbm<BR>

pbmtomacp



</TD></TR><TR><TD>

.ppm

</TD><TD>

Portable pixmap

</TD><TD>

ppm*



</TD></TR><TR><TD>

.ps

</TD><TD>

PostScript (lines)

</TD><TD>

pbmtolps<BR>

pnmtops



</TD></TR><TR><TD>

.ptx

</TD><TD>

Printronix printer graphic

</TD><TD>

pbmtoptx



</TD></TR><TR><TD>

.qrt

</TD><TD>

QRT ray tracer

</TD><TD>

qrttoppm



</TD></TR><TR><TD>

.ras

</TD><TD>

Sun rasterfile

</TD><TD>

pnmtorast<BR>

rasttopnm



</TD></TR><TR><TD>

.sgi

</TD><TD>

Silicon Graphics image

</TD><TD>

pnmtosgi<BR>

sgitopnm



</TD></TR><TR><TD>

.sir

</TD><TD>

Solitaire graphic

</TD><TD>

pnmtosir



</TD></TR></TABLE>



<A NAME="PAGENUM-247"><P>Page 247</P></A>



<TABLE>



<TR><TD>

Format

</TD><TD>

Type

</TD><TD>

Conversion Program



</TD></TR><TR><TD>

</TD><TD>

</TD><TD>

sirtopnm



</TD></TR><TR><TD>

.sixel

</TD><TD>

DEC sixel format

</TD><TD>

ppmtosixel



</TD></TR><TR><TD>

.spc

</TD><TD>

Atari Spectrum file

</TD><TD>

spctoppm



</TD></TR><TR><TD>

.spu

</TD><TD>

Atari Spectrum file

</TD><TD>

sputoppm



</TD></TR><TR><TD>

.tga

</TD><TD>

TrueVision Targa file

</TD><TD>

ppmtotga

tgatoppm



</TD></TR><TR><TD>

.tiff

</TD><TD>

Tagged File Format

</TD><TD>

pnmtotiff

tifftopnm

ppmtotiff

tiff2ps



</TD></TR><TR><TD>

.txt

</TD><TD>

text file bitmap

</TD><TD>

pbmtext



</TD></TR><TR><TD>

.uil

</TD><TD>

Motif UIL icon

</TD><TD>

ppmtouil



</TD></TR><TR><TD>

.upc

</TD><TD>

Universal Product Code

</TD><TD>

pbmupc



</TD></TR><TR><TD>

.x10bm

</TD><TD>

X10 bitmap

</TD><TD>

pbmtox10bm



</TD></TR><TR><TD>

.xbm

</TD><TD>

X11 bitmap

</TD><TD>

pbmtoxbm<BR>

xbmtopbm



</TD></TR><TR><TD>

.xim

</TD><TD>

Xim file

</TD><TD>

ximtoppm



</TD></TR><TR><TD>

.xpm

</TD><TD>

X11 pixmap

</TD><TD>

ppmtoxpm<BR>

xpmtoppm



</TD></TR><TR><TD>

.xv

</TD><TD>

xv thumbnail

</TD><TD>

xvminitoppm



</TD></TR><TR><TD>

.xvpic

</TD><TD>

xv thumbnail file

</TD><TD>

xvpictoppm



</TD></TR><TR><TD>

.xwd

</TD><TD>

X11 Window Dump

</TD><TD>

pnmtoxwd<BR>

xwdtopnm



</TD></TR><TR><TD>

.ybm

</TD><TD>

Bennet Yee face file

</TD><TD>

pbmtoybm<BR>

ybmtopbm



</TD></TR><TR><TD>

.yuv

</TD><TD>

Abekas YUV file

</TD><TD>

ppmtoyuv<BR>

yuvtoppm



</TD></TR><TR><TD>

.zeiss

</TD><TD>

Zeiss confocal file

</TD><TD>

zeisstopnm



</TD></TR><TR><TD>

.zinc

</TD><TD>

Zinc bitmap

</TD><TD>

pbmtozinc



</TD></TR></TABLE>



<H3><A NAME="ch16_ 5">

Converting and Viewing Graphics

</A></H3>



<A NAME="PAGENUM-248"><P>Page 248</P></A>







<P>There are a number of ways to convert graphics files to different formats using the

programs you'll find installed on your system. A number of painting or drawing programs

discussed in this hour translate graphics. Many programs in Table 16.1 also work as filters in

piped commands (see Hour 6, &quot;Using the Shell,&quot; for details) to translate graphics.

</P>



<P>You can use different combinations of these commands to convert files. The resulting

files, which may display and print the same, usually aren't the same file size, so a side

benefit of converting graphics may be to save disk space. Look at the following example:

</P>



<!-- CODE //-->

<PRE>

# xwd &gt;graphic.xwd

# xwdtopnm &lt;graphic.xwd | pnmtotiff &gt;graphic2.tiff

xwdtopnm: writing PPM file

pnmtotiff: computing colormap...

pnmtotiff: 6 colors found

# ls -l graphic.xwd graphic2.tiff

-rw-rw-r--   1 bball    bball      240380 Jan  5 15:15 graphic.xwd

-rw-rw-r--   1 bball    bball       15278 Jan  5 16:51 graphic2.tiff

</PRE>

<!-- END CODE //-->



<P>The first command line uses the xwd client to create an X11 window dump graphic

(after you select a window and press your left mouse button). Then the window dump file

is converted to a portable anymap format, and this stream is fed into the

pnmtotiff command to create a .tiff graphic. As you can see, the .tiff graphic file format is nearly 16 times

smaller than the X11 window dump graphic.

</P>



<P>There are also many graphics programs not listed in Table 16.1 that can be used to

alter graphic images. For example, the pnmrotate,

pnmsmooth, or pnmscale commands rotate, smooth, and resize graphic images. You can use a variety of these programs to not only

convert graphics, but change their appearance or orientation.

</P>



<P>If you're using pipes to convert a graphic, you also can change the image on the fly

by applying these filter programs. The previous example, now has a filter inserted during

the conversion:

</P>



<!-- CODE //-->

<PRE>

# xwd &gt;graphic.xwd

# xwdtopnm &lt;graphic.xwd | pnmflip -topbottom | pnmtotiff &gt;graphic.tiff

xwdtopnm: writing PPM file

pnmtotiff: computing colormap...

pnmtotiff: 6 colors found

</PRE>

<!-- END CODE //-->



<P>Here a window dump is created, and then, using the pnmflip program, it is turned

upside down and backwards before creating the .tiff version. Combinations of different

filters achieve different effects.

</P>



<P><CENTER>

<a href="../ch15/0241-0242.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0249-0251.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->









</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -