> For the complete documentation index, see [llms.txt](https://imgo.gitbook.io/cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://imgo.gitbook.io/cn/api/mosaic.md).

# Mosaic

给图像打马赛克。

## 参数

<table><thead><tr><th>参数名</th><th width="208.18338610093963">类型</th><th>说明</th></tr></thead><tbody><tr><td>size</td><td><code>int</code></td><td>马赛克像素大小</td></tr><tr><td>x1</td><td><code>int</code></td><td>马赛克区域左上角坐标 x 轴</td></tr><tr><td>y1</td><td><code>int</code></td><td>马赛克区域左上角坐标 y 轴</td></tr><tr><td>x2</td><td><code>int</code></td><td>马赛克区域右下角坐标 x 轴</td></tr><tr><td>y2</td><td><code>int</code></td><td>马赛克区域右下角坐标 y 轴</td></tr></tbody></table>

## 返回值

`*imgo.Image` 类型的实例。

## 例子

```go
package main

import "awesomeProject/imgo"

func main() {
    imgo.Load("gopher.png").
        Mosaic(5, 60, 50, 120, 100).
        Save("out.png")
}
```
