aboutsummaryrefslogtreecommitdiff
path: root/man/man1/crop.html
blob: 34a4eefb33f214e5ae01a31f5b4bc1dde7b855f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<head>
<title>crop(1) - Plan 9 from User Space</title>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
</head>
<body bgcolor=#ffffff>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=10><td>
<tr><td width=20><td>
<tr><td width=20><td><b>CROP(1)</b><td align=right><b>CROP(1)</b>
<tr><td width=20><td colspan=2>
    <br>
<p><font size=+1><b>NAME     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    crop, iconv &ndash; frame, crop, and convert image<br>
    
</table>
<p><font size=+1><b>SYNOPSIS     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>crop</font></tt> [ <tt><font size=+1>&#8722;c</font></tt> <i>red green blue</i> ] [ <tt><font size=+1>&#8722;i</font></tt> <i>n</i> | <tt><font size=+1>&#8722;x</font></tt> <i>dx</i> | <tt><font size=+1>&#8722;y</font></tt> <i>dy</i> | <tt><font size=+1>&#8722;r</font></tt> <i>minx miny
    maxx maxy</i> ] [ <tt><font size=+1>&#8722;t</font></tt> <i>tx ty</i> ] [ <tt><font size=+1>&#8722;b</font></tt> <i>red green blue</i> ] [ <i>file</i> ] 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <tt><font size=+1>iconv</font></tt> [ <tt><font size=+1>&#8722;u</font></tt> ] [ <tt><font size=+1>&#8722;c</font></tt> <i>chandesc</i> ] [ <i>file</i> ]<br>
    
</table>
<p><font size=+1><b>DESCRIPTION     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <i>Crop</i> reads an <a href="../man7/image.html"><i>image</i>(7)</a> file (default standard input), crops it,
    and writes it as a compressed <a href="../man7/image.html"><i>image</i>(7)</a> file to standard output.
    There are two ways to specify a crop, by color value or by geometry.
    They may be combined in a single run of <i>crop</i>, in which case the
    color value crop will be done first. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    The <tt><font size=+1>&#8722;c</font></tt> option takes a red-green-blue triplet as described in <a href="../man3/color.html"><i>color</i>(3)</a>.
    (For example, white is <tt><font size=+1>255 255 255</font></tt>.) The corresponding color is
    used as a value to be cut from the outer edge of the picture;
    that is, the image is cropped to remove the maximal outside rectangular
    strip in which every pixel has the specified color.
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    The <tt><font size=+1>&#8722;i</font></tt> option insets the image rectangle by a constant amount,
    <i>n</i>, which may be negative to generate extra space around the image.
    The <tt><font size=+1>&#8722;x</font></tt> and <tt><font size=+1>&#8722;y</font></tt> options are similar, but apply only to the <i>x</i> or
    <i>y</i> coordinates of the image. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    The <tt><font size=+1>&#8722;r</font></tt> option specifies an exact rectangle. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    The <tt><font size=+1>&#8722;t</font></tt> option specifies that the image&#8217;s coordinate system should
    be translated by <i>tx</i>, <i>ty</i> as the last step of processing. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    The <tt><font size=+1>&#8722;b</font></tt> option specifies a background color to be used to fill
    around the image if the cropped image is larger than the original,
    such as if the <tt><font size=+1>&#8722;i</font></tt> option is given a negative argument. This can
    be used to draw a monochrome frame around the image. The default
    color is black. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <i>Iconv</i> changes the format of pixels in the image <i>file</i> (default
    standard input) and writes the resulting image to standard output.
    Pixels in the image are converted according to the channel descriptor
    <i>chandesc</i>, (see <a href="../man7/image.html"><i>image</i>(7)</a>). For example, to convert a 4-bit-per-pixel
    grey-scale image to an 8-bit-per-pixel color-mapped
    image, <i>chandesc</i> should be <tt><font size=+1>m8</font></tt>. If <i>chandesc</i> is not given, the format
    is unchanged. The output image is by default compressed; the <tt><font size=+1>&#8722;u</font></tt>
    option turns off the compression.<br>
    
</table>
<p><font size=+1><b>EXAMPLE     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    To crop white edges off the picture and add a ten-pixel pink border,<br>
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        <tt><font size=+1>crop &#8722;c 255 255 255 &#8722;i &#8722;10 &#8722;b 255 150 150 imagefile &gt; cropped<br>
        </font></tt>
    </table>
    
</table>
<p><font size=+1><b>SOURCE     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>/usr/local/plan9/src/cmd/draw/crop.c<br>
    </font></tt>
</table>
<p><font size=+1><b>SEE ALSO    </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <a href="../man7/image.html"><i>image</i>(7)</a>, <a href="../man3/color.html"><i>color</i>(3)</a><br>
    
</table>
<p><font size=+1><b>BUGS     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <i>Iconv</i> should be able to do Floyd-Steinberg error diffusion or
    dithering when converting to small image depths.<br>
    
</table>

<td width=20>
<tr height=20><td>
</table>
<!-- TRAILER -->
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=15><td width=10><td><td width=10>
<tr><td><td>
<center>
<a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a>
</center>
</table>
<!-- TRAILER -->
</body></html>