How Can We Help You?

Flipping

The input image is flipped vertically, horizontally, or both ways in this operation. This is also known as "image mirroring." Simply add a new hash named flip to your request JSON to flip (or mirror) your images. Flip takes two Boolean parameters horizontal and vertical and these are self-explanatory.

<?php

/**
* Instantiate new `$picsmize` by calling a constructor
*/

$picsmize = new Picsmize('your-api-key');

/**
* Provide a publicly available image URL with fetch(string) method,
* and flip the image horizontally
*/

$picsmize
->fetch('https://www.example.com/image.jpg')
->flip(Picsmize::FLIP_HORIZONTAL)
->toJSON(function ($response) {
if ($response['status'] == false) {
throw new Exception($response);
}

/**
* You'll find the full JSON metadata array within the `$response` variable.
* Remember to always check if the `status` property is set to `true`.
*/

if ($response['status'] == true) {
print ($response['output']['src']);
} else {
print ($response['message']);
}
});
curl -X POST \
https://api.picsmize.com/image/process \
-H "apikey: your-api-key" \
-H "content-type: application/json" \
-d '{
"img_url": "https://www.example.com/image.jpg",
"process": {
"flip": {
"horizontal": true
}
}
}'
									
										package main

										import (
											"fmt"

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

										func main() {

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

											/**
											* Provide a publicly available image URL with fetch(string) method,
											* and flip the image horizontally
											*/

											res, err := pics.Fetch("your-image-url").
												Flip("horizontal").
												ToJSON()

											if err != nil {
												panic(err)
											}

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

											fmt.Println(res)
										}
									
								
Given the input image 750px × 300px
Resizing An Image Online
Flip the image horizontally
Compressor Photo
The resulting image is a 750px × 300px image flipped horizontally