imageclipper

package module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 12 Imported by: 0

README

imageclipper

介绍

图像裁剪器 - 瓦片化图片指定区域再分割,形成新的瓦片化图片。

例如将 10 x 10 的图像,按照指定的左上角坐标,切成 9 x 9 的图像。

每个瓦片大小固定在 2448 x 2048 或者 2048 x 2048

转换前会自动检测所有的图片的大小都一致

转换前和转换后的瓦片尺寸保持一致。

这是一个 Go 的 模块级程序,不能独立运行,仅支持被其他程序引用。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(file_path, tmp_path string, x, y, width, height int) (err error)

瓦片化图像裁剪器入口

  1. 将已经是瓦片化的图片, 通过设置指定区域进行再分割的处理,形成新的瓦片化图片
  2. 新的瓦片化图像, 一定是小于原始瓦片化图像的, 并且每张图符合 2448 x 2048 大小规格 例如: 可以将 10 x 10 的图像,裁剪成 9 x 9 的图像
  3. 操作方法, 只需要指定左上角坐标以及目标图像大小即可 params: file_path: 源图像文件夹 tmp_path: 临时目录 (模块自动创建, 无需预先创建) x, y: 准备裁剪的左上角坐标 width, height: 裁剪区域 (不能超过实际原图大小) returns: err: error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL