Resizing An Image Online Compressor Photo Image Online Resize

Plugins, integrations, and SDKs

Compress Jpeg
Compressing An Image
Compress The Photo
  1. / picsmize-go
  2. Version: 1.0
  3. License: MIT
The official GoLang facade for Picsmize API

Click Here to go Picsmize API docs for full API reference.

Quick Installation

To install the Picsmize library, the syntax for installing the command line goes like this;

									$ go get github.com/picsmize/picsmize-golang
								
Quick Example

If you don't have your API Key just yet, you can Sign Up for a free account.

This Picsmize GoLang module allows all the operations available with the Picsmize API. The following example uses image Fetch, Compress, Resize and Filter with different mode and get the output file directly with ToJSON() method:

									
										package main

										import (
											"fmt"

											"github.com/picsmize/picsmize-go"
										)

										func main() {

											pics, err := picsmize.Init("your-api-key")
											if err != nil {
												panic(err)
											}

											/**
											* Use of Fetch() method
											*/

											res, err := pics.Fetch("https://www.example.com/image.jpg").

												/**
												* Use of Compress() method with low mode
												*/

												Compress(picsmize.Options{
													"level": "low",
												}).

												/**
												* Use of Resize() method with auto mode
												* and width set to 400
												*/

												Resize("auto", picsmize.Options{
													"width": 400,
												}).

												/**
												* Use of Filter() blur method with gaussian mode
												* and value set to 10
												*/

												Filter("auto", picsmize.Options{
													"mode": "gaussian",
													"value": 10
												}).

												/**
												* Call ToJSON() on the final step and return the JSON response
												*/

												ToJSON()

											if err != nil {
												panic(err)
											}

											/**
											* You'll find the full JSON metadata within the `res` variable.
											*/

											fmt.Println(res)
										}