| image_apply_contrast | R Documentation |
Applies a contrast stretch (S-curve) to the RGB channels of a
rendered image. Formula: (value - 0.5) * contrast + 0.5,
clamped to [0, 1]. The default 1.0 means no change.
Values > 1.0 produce darker darks and lighter highlights.
image_apply_contrast(image, contrast = 1)
image |
An image list returned by |
contrast |
Contrast multiplier. Default 1.0 (no change). Typical values: 1.1–1.2 for subtle S-curve, 1.5 for strong. |
A new image list with contrast-adjusted pixel data.
cube <- generate_cuboid(c(0, 0, 0), c(1, 1, 1))
img <- render_mesh(cube$vertices, cube$triangles)
img <- image_apply_contrast(img, contrast = 1.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.