shape-image-threshold

Jump to: navigation, search

shape-image-threshold

This page has been flagged with the following issues:

High-level issues:


W3C Editor's Draft

Summary

Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque.

Overview table

Initial value 0.0
Applies to Floats
Inherited No
Media visual
Computed value As specified, clamped to a 0.0-1.0 range
Animatable Yes
CSS Object Model Property

Syntax

  • shape-image-threshold: <threshold>


Values

<threshold>
A numeric value used to set the opacity threshold used for extracting a shape from an image. Any values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) will be clamped to this range.


Examples

View live exampleNote: Depends upon an image previously specified by shape-outside.

CSS

/*
Extract a shape from an image by enclosing all pixels greater than 25% opacity
*/
#myimg {
  shape-image-threshold: 0.25;
}

Usage

Currently implemented as an experimental feature in WebKit and Blink. This can be used with a -webkit- prefix in WebKit nightly builds and with a -webkit- prefix in Chrome Canary builds with experimental-webkit-features enabled: chrome://flags/#enable-experimental-webkit-features


Related specifications

Specification Status Related Changes
CSS Shapes Module Level 1 Editor's Draft

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ?

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?

See also

Other articles

shape-outside