同步操作将从 Gitee 极速下载/Caire 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Caire is a content aware image resize library based on Seam Carving for Content-Aware Image Resizing paper.
Original image | Energy map | Seams applied |
---|---|---|
Key features which differentiates from the other existing open source solutions:
$ go get github.com/esimov/caire/cmd/caire
$ go install
$ caire -in input.jpg -out output.jpg
$ caire --help
The following flags are supported:
Flag | Default | Description |
---|---|---|
in |
n/a | Input file |
out |
n/a | Output file |
width |
n/a | New width |
height |
n/a | New height |
perc |
false | Reduce image by percentage |
blur |
1 | Blur radius |
sobel |
10 | Sobel filter threshold |
debug |
false | Use debugger |
In case you wish to reduce the image size by a specific percentage, it can be used the -perc
boolean flag, which means you need only to specify that you want to deal with percentages instead of concrete values. In this case the values provided for width and height will be expressed as percentage. Here is a sample command using -perc
:
caire -in input/source.jpg -out ./out.jpg -perc=1 -width 20 -height 20 -debug false
which reduces the image width & height by 20%.
The CLI command can process all the images from a specific directory too.
$ caire -in ./input-directory -out ./output-directory
Original | Shrinked |
---|---|
Original | Extended |
---|---|
This project is under the MIT License. See the LICENSE file for the full license text.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。