2011-03-30 13:49:47 +00:00
|
|
|
.TH RESAMPLE 1
|
|
|
|
.SH NAME
|
2011-10-06 18:54:56 +00:00
|
|
|
resample, resize - resample a picture
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.B resample
|
|
|
|
[
|
|
|
|
.B -x
|
|
|
|
.I size
|
|
|
|
] [
|
|
|
|
.B -y
|
|
|
|
.I size
|
|
|
|
] [
|
|
|
|
.I file
|
|
|
|
]
|
2011-10-06 18:54:56 +00:00
|
|
|
.br
|
|
|
|
.B resize
|
|
|
|
[
|
2018-03-20 20:31:25 +00:00
|
|
|
.B -n
|
|
|
|
]
|
|
|
|
[
|
2011-10-06 18:54:56 +00:00
|
|
|
.B -x
|
|
|
|
.I size
|
|
|
|
] [
|
|
|
|
.B -y
|
|
|
|
.I size
|
|
|
|
] [
|
|
|
|
.I file
|
|
|
|
]
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
.I Resample
|
2011-10-06 18:54:56 +00:00
|
|
|
and
|
|
|
|
.I Resize
|
2011-03-30 13:49:47 +00:00
|
|
|
resamples its input image (default standard input) to a new size.
|
2011-10-06 18:54:56 +00:00
|
|
|
.I Resample
|
|
|
|
uses a Kaiser window which produces high quality results and
|
|
|
|
.I resize
|
|
|
|
uses bilinear interpolation which is faster but produces more
|
|
|
|
fuzzy images.
|
2018-03-20 20:31:25 +00:00
|
|
|
By specifying the
|
|
|
|
.B -n
|
|
|
|
option,
|
|
|
|
.I resize
|
|
|
|
can also use nearest neighbour interpolation which preserves the individual pixels and is appropriate for pixel art or
|
|
|
|
.IR qr (1)
|
|
|
|
output.
|
2011-03-30 13:49:47 +00:00
|
|
|
.PP
|
|
|
|
The size of the resampled image can be specified
|
|
|
|
with the
|
|
|
|
.B -x
|
|
|
|
and
|
|
|
|
.B -y
|
|
|
|
options.
|
2011-10-06 18:54:56 +00:00
|
|
|
An unadorned value sets the number of pixels of that dimension; a
|
|
|
|
suffixed percent sign specifies a percentage.
|
2011-03-30 13:49:47 +00:00
|
|
|
If only one of
|
|
|
|
.B -x
|
|
|
|
or
|
|
|
|
.B -y
|
|
|
|
is given, the other dimension is scaled to preserve
|
|
|
|
the aspect ratio of the original image.
|
|
|
|
Thus,
|
|
|
|
.B -x50%
|
|
|
|
will reduce the image to half its original dimension in both
|
|
|
|
.B x
|
|
|
|
and
|
|
|
|
.BR y .
|
|
|
|
.PP
|
|
|
|
The input should be a Plan 9 image
|
|
|
|
as described in
|
|
|
|
.IR image (6),
|
|
|
|
and the output will be a compressed 24-bit
|
|
|
|
.B r8g8b8
|
|
|
|
image.
|
|
|
|
To uncompress the image or change the pixel format, use
|
|
|
|
.I iconv
|
|
|
|
(see
|
|
|
|
.IR crop (1)).
|
|
|
|
.PP
|
|
|
|
.SH SOURCE
|
|
|
|
.B /sys/src/cmd/resample.c
|
2011-10-06 18:54:56 +00:00
|
|
|
.br
|
|
|
|
.B /sys/src/cmd/resize.c
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH "SEE ALSO
|
|
|
|
.IR crop (1),
|
|
|
|
.IR image (6)
|