Golang capture the core image of a picture to create a new map of custom dimensions and margins

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

I. Overview of PPGO_CLIIMG

Ppgo_cliimg is a picture interception processing tool, based on the Golang language implementation of the Image Interception processing tool.

You can cut out images that are white or other solid colors and output according to custom dimensions and margins.

Effect similar to another Python project: https://github.com/george518/CoreImage

Ii. What is the use of ppgo_cliimg?

1. Quickly cut the core of the image and customize the size and margins to create new images

2, commonly used in e-commerce platform Picture batch processing.

3, contains the Golang commonly used picture package use method, may use as the Golang Picture study reference

Three, ppgo_cliimg the picture effect of the interception

Original image (for easy viewing, here the basemap color is light green?) ):

Intercept a height of 200px, width 300px, the margin is 10px, the position is centered picture as follows:

Iv. How to install

1. Download

Go get github.com/george518/ppgo_clipimg

2. Operation

Go Build

V. How to use

Examples of Use:

./ppgo_clipimg-f=./example/images/image.jpg-p=center-h=300-w=200-m=10

Parameter interpretation

Flag needs an argument:-husage of./ppgo_clipimg:-F string Picture address or Picture folder address-h int new picture height (default)-M int Edge From (default)-P string top|bottom|left|right|center (default "center")-W int new picture width (default 300)

You can also use the./ppgo_cliimg-h to view incoming parameters

Vi. Address of GitHub

Https://github.com/george518/PPGo_ClipImg

603 reads ∙2 likes
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.