Winop image WINOPIMAGE command¶
Commands in this namespace document the image subgroup of winop.
WINOPIMAGE is used below as a placeholder for:
::rbc::winop image
For example:
image create photo source -file input.png
image create photo rotated
::rbc::winop image rotate source rotated 30
The current subgroup provides:
convolve
gradient
readjpeg
resample
rotate
snap
subsample
Several of these also have direct ::rbc::winop forms. gradient and rotate are currently available only
through the image subgroup.
quantize, conversely, is currently a direct winop operation and is not part of WINOPIMAGE.
Gradients¶
WINOPIMAGE gradient writes a generated gradient into an existing Tk photo image. The photo’s current width
and height determine the output dimensions.
image create photo background -width 640 -height 480
::rbc::winop image gradient background navy white radial
The supported gradient types are:
Type |
Description |
|---|---|
|
Generates the built-in linear gradient form. |
|
Generates a gradient based on distance from the image center. |
|
Generates the built-in rectangular gradient form. |
|
Fills the image with opaque white. |
The left and right arguments must be valid Tk colors.
Rotation¶
WINOPIMAGE rotate rotates a source photo by a finite angle in degrees and writes the result to a destination
photo:
image create photo rotated
::rbc::winop image rotate source rotated 45
The angle is evaluated as a Tcl numeric expression:
::rbc::winop image rotate source rotated {360.0 / 8.0}
Angles are normalized modulo 360 degrees. The destination photo is resized to contain the rotated image.
Copyright (c) George Yashin