]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/resample
stdio: fix putc(), plan9 version
[plan9front.git] / sys / man / 1 / resample
1 .TH RESAMPLE 1
2 .SH NAME
3 resample, resize - resample a picture
4 .SH SYNOPSIS
5 .B resample
6 [
7 .B -x
8 .I size
9 ] [
10 .B -y
11 .I size
12 ] [
13 .I file
14 ]
15 .br
16 .B resize
17 [
18 .B -n
19 ]
20 [
21 .B -x
22 .I size
23 ] [
24 .B -y
25 .I size
26 ] [
27 .I file
28 ]
29 .SH DESCRIPTION
30 .I Resample
31 and
32 .I Resize
33 resamples its input image (default standard input) to a new size.
34 .I Resample
35 uses a Kaiser window which produces high quality results and
36 .I resize
37 uses bilinear interpolation which is faster but produces more
38 fuzzy images.
39 By specifying the
40 .B -n
41 option,
42 .I resize
43 can also use nearest neighbour interpolation which preserves the individual pixels and is appropriate for pixel art or
44 .IR qr (1)
45 output.
46 .PP
47 The size of the resampled image can be specified
48 with the
49 .B -x
50 and
51 .B -y
52 options.
53 An unadorned value sets the number of pixels of that dimension; a
54 suffixed percent sign specifies a percentage.
55 If only one of
56 .B -x
57 or
58 .B -y
59 is given, the other dimension is scaled to preserve
60 the aspect ratio of the original image.
61 Thus,
62 .B -x50%
63 will reduce the image to half its original dimension in both
64 .B x
65 and
66 .BR y .
67 .PP
68 The input should be a Plan 9 image
69 as described in 
70 .IR image (6),
71 and the output will be a compressed 24-bit
72 .B r8g8b8
73 image.
74 To uncompress the image or change the pixel format, use
75 .I iconv
76 (see
77 .IR crop (1)).
78 .PP
79 .SH SOURCE
80 .B /sys/src/cmd/resample.c
81 .br
82 .B /sys/src/cmd/resize.c
83 .SH "SEE ALSO
84 .IR crop (1),
85 .IR image (6)