Media · Gutenberg

Image Mask block for WordPress

Display an image through a decorative shape mask — circle, hexagon, blob, star, diamond, cross, heart, or pentagon.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Display an image through a decorative shape mask — circle, hexagon, blob, star, diamond, cross, heart, or pentagon.

Inspector panels on this block: Image, Shape, Shape Border, Shadow & Hover, Caption, Link. Those titles come from index.js, not from a shared template.

Behavior controls: “Image Focus Point” options: Center, Top, Bottom, Left, Right; “Hover Effect” options: Zoom In, Zoom Out, Rotate, None; “Caption Align” options: Left, Center, Right.

Where to find it

Gutenberg inserter → Media → search “Image Mask” (block name `blockenberg/image-mask` in block.json). Style it in the sidebar after insert.

How to use Image Mask block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Image Mask”, insert it. Category: Media.
  3. Configure inspector controls that exist on this block. Open Image. Set “Alt Text”, “Image Focus Point”, “Mask Shape”, “Size (px)”.
  4. Check the published page. The view script reads HTML data attributes: data-hover, data-scale. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Alt TextText field in the inspector. Saved as `imageAlt`.
Image Focus PointSelect control; the chosen value is saved on the block. Options: Center; Top; Bottom; Left; Right; Top Left; Top Right; Bottom Left; Bottom Right. block.json default: center center. Saved as `objectPosition`.
Mask ShapeSelect control; the chosen value is saved on the block. block.json default: circle. Saved as `shape`.
Size (px)Numeric range control in the inspector. Range 80–800. block.json default: 320. Saved as `size`.
Rotation (°)Numeric range control in the inspector. Range -180–180. block.json default: 0. Saved as `rotation`.
Show Border RingOn/off toggle in the inspector. Off by default. Saved as `showBorder`.
Border Width (px)Numeric range control in the inspector. Range 1–20. block.json default: 4. Saved as `borderWidth`.
Border Offset (px)Numeric range control in the inspector. Range 0–40. block.json default: 8. Saved as `borderOffset`.
Drop ShadowOn/off toggle in the inspector. On by default. Saved as `showShadow`.
Shadow Intensity (%)Numeric range control in the inspector. Range 5–70. block.json default: 30. Saved as `shadowIntensity`.
Hover EffectSelect control; the chosen value is saved on the block. Options: Zoom In; Zoom Out; Rotate; None. block.json default: zoom. Saved as `hoverEffect`.
Hover Scale (%)Numeric range control in the inspector. Range 80–150. block.json default: 108. Saved as `hoverScale`.
Transition (ms)Numeric range control in the inspector. Range 0–1000. block.json default: 400. Saved as `transitionDuration`.
Show CaptionOn/off toggle in the inspector. Off by default. Saved as `showCaption`.
Caption TextText field in the inspector. Saved as `caption`.
Caption AlignSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: center. Saved as `captionAlign`.
Caption Size (px)Numeric range control in the inspector. Range 10–24. block.json default: 14. Saved as `captionSize`.
Link URLText field in the inspector. Saved as `linkUrl`.
Open in New TabOn/off toggle in the inspector. Off by default. Saved as `linkNewTab`.
Border Ring ColorColor control in the inspector. block.json default: #6c3fb5. Saved as `borderColor`.
Shadow ColorColor control in the inspector. block.json default: #000000. Saved as `shadowColor`.
Caption ColorColor control in the inspector. block.json default: #374151. Saved as `captionColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Image Mask block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Image Mask”. It sits under Media. After insert, open Image and set “Alt Text”, “Image Focus Point”, “Mask Shape”, “Size (px)”.

What makes Image Mask different from other Blockenberg blocks?

Display an image through a decorative shape mask — circle, hexagon, blob, star, diamond, cross, heart, or pentagon. Inspector labels on this block include “Alt Text”, “Image Focus Point”, “Mask Shape”, “Size (px)”.

Is the Image Mask Gutenberg block free?

Yes. Image Mask ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Image Mask to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Image, Shape, Shape Border, Shadow & Hover).

Related media blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Image Mask from the Gutenberg inserter.

Get Blockenberg