Title: WP Image Mask
Author: Bogdan Bendziukov
Published: <strong>2020 年 12 月 7 日</strong>
Last modified: 2026 年 5 月 21 日

---

搜索插件

![](https://ps.w.org/wp-image-mask/assets/banner-772x250.jpg?rev=3267791)

![](https://ps.w.org/wp-image-mask/assets/icon.svg?rev=3267792)

# WP Image Mask

 作者：[Bogdan Bendziukov](https://profiles.wordpress.org/barb0ss/)

[下载](https://downloads.wordpress.org/plugin/wp-image-mask.3.1.3.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-image-mask/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-image-mask/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/wp-image-mask/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/wp-image-mask/#developers)

 [支持](https://wordpress.org/support/plugin/wp-image-mask/)

## 描述

Select a custom mask for your Gutenberg image’s block or add a masked image anywhere
via shortcode `[wp-image-mask]`.

Shortcode attributes:

 * `src` – URL of the image;
 * `mask` – URL of the mask;
 * `fit` – how the mask should fit into the image. `cover`, `contain` (default `
   contain`);
 * `alt` – alt text for the image.

## 屏幕截图

[⌊Select your image (or add a new one from Gutenberg blocks).⌉⌊Select your image(
or add a new one from Gutenberg blocks).⌉[

Select your image (or add a new one from Gutenberg blocks).

[⌊Select the type of image mask from the block's settings.⌉⌊Select the type of image
mask from the block's settings.⌉[

Select the type of image mask from the block’s settings.

[⌊If you choose a custom image - click on the Choose mask image button to upload
your custom mask.⌉⌊If you choose a custom image - click on the Choose mask image
button to upload your custom mask.⌉[

If you choose a custom image – click on the Choose mask image button to upload your
custom mask.

[⌊Once you have selected the mask - it will apply to your image.⌉⌊Once you have 
selected the mask - it will apply to your image.⌉[

Once you have selected the mask – it will apply to your image.

[⌊If you choose SVG code - paste your SVG code in the textarea field.⌉⌊If you choose
SVG code - paste your SVG code in the textarea field.⌉[

If you choose SVG code – paste your SVG code in the textarea field.

[⌊Once you have pasted the code - it will apply to your image.⌉⌊Once you have pasted
the code - it will apply to your image.⌉[

Once you have pasted the code – it will apply to your image.

[⌊You can also apply image masks to gallery's images.⌉⌊You can also apply image 
masks to gallery's images.⌉[

You can also apply image masks to gallery’s images.

## 安装

Upload the WP Image Mask plugin to your site, activate it and start using.

## 常见问题

### Do I need to replace my images with some custom Gutenberg block to use an image mask?

No, this plugin attaches to the native Gutenberg image block, so no need to replace
your existing images.

### Can I apply my custom image mask?

Sure! You can select a custom image mask file or paste SVG code of your image mask.

### I don’t use Gutenberg – is there any other way to add an image with a mask?

Yes! You can use shortcode `[wp-image-mask src="https://url_of_your_image" mask="
https://url_of_your_mask_image"]`.

## 评价

![](https://secure.gravatar.com/avatar/a9737ef699783b8cd526ea536b6c92085c9b586db11a612add35e88829e30944?
s=60&d=retro&r=g)

### 󠀁[Works great](https://wordpress.org/support/topic/works-great-9078/)󠁿

 [yodergreg](https://profiles.wordpress.org/yodergreg/) 2023 年 12 月 22 日 1 回复

I needed a way to have irregular looking shapes for photos. I thought I might have
to create a custom solution, but was pleased that this plugin did exactly what I
needed. I was able to upload SVG images to use as masks to the site media library,
and then it was really easy to assign those to be used as masks to images using 
the default WP image block. I like how the plugin integrates directly into the image
block interface. Excellent! I will end up using this plugin on a lot more sites 
in the future.

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/wp-image-mask/reviews/)

## 贡献者及开发者

「WP Image Mask」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Bogdan Bendziukov ](https://profiles.wordpress.org/barb0ss/)

「WP Image Mask」插件已被翻译至 3 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/wp-image-mask/contributors)
为本插件所做的贡献。

[帮助将「WP Image Mask」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-image-mask)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-image-mask/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/wp-image-mask/)，或通过[RSS](https://plugins.trac.wordpress.org/log/wp-image-mask/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-image-mask/)。

## 更新日志

#### 3.1.3

 * Fixed security vulnerability

#### 3.1.2

 * Removed inline tags, applied image mask as inline css
 * Fixed Gutenberg view for custom image mask
 * Migrate to @wordpress/create-block

#### 3.1.1

 * Removed unnecessary wp-image-mask – CGB Block

#### 3.1

 * Add the ability to select mask fit in the Gutenberg block

#### 3.0

 * Stable release.
 * Add a shortcode to apply image mask.

#### 2.0

 * Stable release.
 * Fixed issues with applying custom masks to images.
 * Add the ability to paste SVG code for image masks.

#### 1.0

 * First release.

## 额外信息

 *  版本 **3.1.3**
 *  最后更新：**3 周前**
 *  活跃安装数量 **300+**
 *  WordPress 版本 ** 6.0 或更高版本 **
 *  已测试的最高版本为 **7.0**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-image-mask/) 、 [Spanish (Mexico)](https://es-mx.wordpress.org/plugins/wp-image-mask/)、
   [Spanish (Spain)](https://es.wordpress.org/plugins/wp-image-mask/) 和 [Spanish (Venezuela)](https://ve.wordpress.org/plugins/wp-image-mask/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/wp-image-mask)
 * 标签
 * [gutenberg](https://cn.wordpress.org/plugins/tags/gutenberg/)[image](https://cn.wordpress.org/plugins/tags/image/)
   [mask](https://cn.wordpress.org/plugins/tags/mask/)[shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-image-mask/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/wp-image-mask/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/wp-image-mask/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/wp-image-mask/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/wp-image-mask/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/wp-image-mask/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-image-mask/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-image-mask/reviews/)

## 贡献者

 *   [ Bogdan Bendziukov ](https://profiles.wordpress.org/barb0ss/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-image-mask/)