monks/image_rendering

The image-rendering CSS property sets an image scaling algorithm. The property applies to an element itself, to any images set in its other properties, and to its descendants.

Values

pub const auto_: #(String, String)
  • : The scaling algorithm is UA dependent. Since version 1.9 (Firefox 3.0), Gecko uses bilinear resampling (high quality).
pub const crisp_edges: #(String, String)
  • : The image is scaled with an algorithm such as “nearest neighbor” that preserves contrast and edges in the image. Generally intended for images such as pixel art or line drawings, no blurring or color smoothing occurs.
pub const inherit: #(String, String)
pub const initial: #(String, String)
pub const optimize_contrast: #(String, String)

optimize-contrast value of image-rendering

pub const optimize_quality: #(String, String)

optimizeQuality value of image-rendering

pub const optimize_speed: #(String, String)

optimizeSpeed value of image-rendering

pub const pixelated: #(String, String)
  • : The image is scaled with the “nearest neighbor” or similar algorithm to the nearest integer multiple of the original image size, then uses smooth interpolation to bring the image to the final desired size. This is intended to preserve a “pixelated” look without introducing scaling artifacts when the upscaled resolution isn’t an integer multiple of the original.> [!NOTE]> The values optimizeQuality and optimizeSpeed present in an early draft (and coming from its SVG counterpart {{SVGAttr(“image-rendering”)}}) are defined as synonyms for the smooth and pixelated values respectively.> [!NOTE]> The CSS images module defines a high-quality value for the image-rendering property to provide a preference for higher-quality scaling, however, this is not supported in any browsers.
pub fn raw(value: String) -> #(String, String)

Enter a raw string value for image-rendering

pub const revert: #(String, String)
pub const revert_layer: #(String, String)
pub const unset: #(String, String)
pub fn var(variable: String) -> #(String, String)

Enter a variable name to be used for image-rendering. It will be wrapped in var() and have -- prepended.

Search Document