Framing, Masks & Reflection Labs
How you frame an image defines how users experience it. Here, we tackle the art of image framing: locking down responsive aspect ratios, anchoring focal points to protect portraits from bad mobile crops, and layering alpha gradient masks for seamless visual transitions.
Image Focal Point & Positioner
object-position & Crop PinningInteractive visual crosshair reticle to pin image focal points with object-position and background-position, with live multi-aspect crop simulations.
Image Fit & Aspect Ratio
object-fit & PositioningInteractive object-fit (cover, contain, fill, scale-down) and focal object-position coordinates with container aspect-ratio locking.
Image Mask & Alpha Gradient Studio
mask-image & ShapesApply CSS mask-image gradients, vignettes, spotlights, and SVG polygon shape cutouts to images with alpha channel transparency.
Product Reflection & Floor Shadow
-webkit-box-reflect & 3D ShadowCommercial hardware showcases with Apple-style mirror floor reflections, gradient fade masks, and radial 3D contact shadows.
Responsive <picture> & srcset Builder
AVIF/WebP & Art DirectionGenerate production-ready responsive <picture> and <img srcset> markup with AVIF/WebP next-gen formats, art-directed crops, and automated sizes attributes.
Eliminating Layout Shift (CLS) and Preserving Focal Centers
Proper media framing requires two principles: reserving layout geometry before images download (aspect-ratio), and guaranteeing that the primary subject remains in frame across diverse responsive aspect ratios (object-position focal pinning).
Frequently Asked Questions
How does object-position eliminate awkward cropping?
Default object-fit: cover crops to the exact center (50% 50%). For tall portraits or wide landscapes, faces or subjects get chopped off. Specifying object-position coordinates locks the crop anchor directly to the subject coordinates.
Does -webkit-box-reflect require duplicated HTML markup?
No. The -webkit-box-reflect property instructs the GPU paint engine to mirror the rendered element downwards, pairing it with a linear alpha gradient mask to produce seamless Apple-style hardware product showcases.
How do I mask an image into a custom shape using CSS mask-image?
Use mask-image: url("shape.svg"); -webkit-mask-image: url("shape.svg"); with mask-size: cover; and mask-repeat: no-repeat;. The alpha transparency of the SVG file cuts the image into the custom silhouette.
What is the difference between CSS clip-path and mask-image?
clip-path creates hard vector polygon boundaries with 100% on/off clipping. mask-image supports 8-bit alpha channels, allowing feathered edges, gradient dissolves, and textured grunge borders.
Why is my CSS mask-image not displaying in Chrome or Safari?
WebKit and Chromium browsers require the -webkit-mask-image vendor prefix. Always declare both -webkit-mask-image and mask-image in your stylesheet for universal cross-browser support.
How do I create an animated image reveal mask in CSS?
Animate mask-position or mask-size using CSS keyframes, or animate an SVG path inside the mask element to create organic paint-brush or liquid wipe transitions across the photo.
Can I use CSS linear gradients as image masks?
Yes. Setting mask-image: linear-gradient(to bottom, black 60%, transparent 100%); fades the bottom of an image seamlessly into your page background without using PNG overlays.