All Projects → wapmorgan → Imagery

wapmorgan / Imagery

Licence: mit
Imagery simplifies image manipulations.

Projects that are alternatives of or similar to Imagery

Dockerfile Libvips
🌄 All libvips dependencies & libvips built from source
Stars: ✭ 26 (-3.7%)
Mutual labels:  image-processing
Cometa
Super fast, on-demand and on-the-fly, image processing.
Stars: ✭ 8 (-70.37%)
Mutual labels:  image-processing
Playpixels
Swift Playground Book for learning image processing.
Stars: ✭ 14 (-48.15%)
Mutual labels:  image-processing
Segmentation
Catalyst.Segmentation
Stars: ✭ 27 (+0%)
Mutual labels:  image-processing
Finite Transform Library
Fast transforms over finite fields
Stars: ✭ 7 (-74.07%)
Mutual labels:  image-processing
Compositor Api
Compositor is a lightweight utility API for compositing images quickly and efficiently in Unity.
Stars: ✭ 9 (-66.67%)
Mutual labels:  image-processing
Xdog Filter
Edge Detection with XDoG Filter
Stars: ✭ 26 (-3.7%)
Mutual labels:  image-processing
Detection Of Breast Cancer Using Neural Networks
This project is made in Matlab Platform and it detects whether a person has cancer or not by taking into account his/her mammogram.
Stars: ✭ 15 (-44.44%)
Mutual labels:  image-processing
Grafika
An image processing library for PHP
Stars: ✭ 838 (+3003.7%)
Mutual labels:  image-processing
St Cgan
Dataset and Code for our CVPR'18 paper ST-CGAN: "Stacked Conditional Generative Adversarial Networks for Jointly Learning Shadow Detection and Shadow Removal"
Stars: ✭ 13 (-51.85%)
Mutual labels:  image-processing
Imagescout
A Swift implementation of fastimage. Supports PNG, GIF, and JPEG.
Stars: ✭ 940 (+3381.48%)
Mutual labels:  image-processing
Sv Images
Image manipulation library with an HTTP based API.
Stars: ✭ 7 (-74.07%)
Mutual labels:  image-processing
Pymatting
A Python library for alpha matting
Stars: ✭ 860 (+3085.19%)
Mutual labels:  image-processing
Hnr
🌟 An off-line handwritten numeral recognition system
Stars: ✭ 26 (-3.7%)
Mutual labels:  image-processing
Handy Image Processor
A handy Image Processor for NodeJS. 📷📷📷
Stars: ✭ 14 (-48.15%)
Mutual labels:  image-processing
Sickzil Machine
Manga/Comics Translation Helper Tool
Stars: ✭ 934 (+3359.26%)
Mutual labels:  image-processing
Image Actions
A Github Action that automatically compresses JPEGs, PNGs and WebPs in Pull Requests.
Stars: ✭ 844 (+3025.93%)
Mutual labels:  image-processing
Metalpetal
A GPU accelerated image and video processing framework built on Metal.
Stars: ✭ 907 (+3259.26%)
Mutual labels:  image-processing
Fresco Processors
An Android image processor library providing a variety of image transformations for Fresco.
Stars: ✭ 884 (+3174.07%)
Mutual labels:  image-processing
Spark Edge Detection
Edge detection in Spark AR
Stars: ✭ 13 (-51.85%)
Mutual labels:  image-processing

Imagery simplifies image manipulations.

Imagery supports:

  • resizing
  • cropping
  • flipping and rotating
  • making collages
  • applying filters and effects

Composer package Latest Stable Version Total Downloads License

  1. Installation
  2. API

Installation

  • Composer package:
  composer require wapmorgan/imagery

API

Imagery

use Imagery\Imagery;

Opening

Create new Imagery object:

  • $image = Imagery::open($filename); - from a file.
  • $image = Imagery::create($width, $height); - new image
  • $image = new Imagery(imagecreatefrombmp('image.bmp')); - from a resource

Saving

  • public function save($filename, $quality = 75, $format = null) - saves image to disk. Quality is an integer value between 0 (worst) and 100 (best). Default is 75. Quality is applicable only to JPEG, PNG, WEBP. If $format can not be determined by filename extension, specifcy it explicitly.

Formats supports:

Operation Formats
Opening jpeg, png, gif, bmp, wbmp, xbm, xpm, webp (php >= 7.1.0)
Saving jpeg, png, gif, bmp, wbmp, xbm, webp (php >= 7.1.0)

Properties

  • $image->width - width of image
  • $image->height - height of image
  • $image->resource - original gd-resource of image (you can use it with gd-functions)

Resize && Zoom

  • public function resize(int $width, int $height) - resizes an image to $width X $height
  • public function zoomWidthTo(int $size) - changes proportionally image width to $size
  • public function zoomHeightTo(int $size) - changes proportionally image height to $size
  • public function zoomMaxSide(int $size) - zoomes proportionally larger side to $size, if needed

Crop

  • public function crop($x, $y, $x2, $y2) - cuts a rectangular piece of image
  • public function decreaseSide($side, int $size) - deletes a piece of image from specific side. For example, if $side=top and $size=100, 100px from top will be deleted.

Rotation && Mirroring

  • public function rotate($angle, $bgColor = 0) - rotates an image. True equals 90°, False equals -90°.
  • public function flip($horizontally = true) - flips an image horizontally or vertically.

Collage

  • public function appendImageTo($side, Imagery $appendix, int $modifiers) - appends an image ($appendix) to current image at $side (top|bottom|left|right). Modifiers:

    • Imagery::ZOOM_IF_LARGER - appendix' height will be zoomed (not resized) if it's larger than current image's one (when appending to left or right side); appendix' width will be zoomed (not resized) if it's larger than current image's one (when appending to top or bottom side);
  • public function placeImageAt($x, $y, Imagery $image) - places an image atop current image at $x X $y.

  • public function placeImageAtCenter(Imagery $image) - places an image in the center of current image.

Effects

  • public function filter($filter) - applies grayscale or negate filter. Pass Imagery::FILTER_NEGATE or Imagery::FILTER_GRAYSCALE as $filter.

    Grayscale:

    Original -> Grayscale

    Negate:

    Original -> Negate

  • public function changeContrast($newValue) - changes contrast of image. New values can be in range from 100 (max contrast) to -100 (min contrast), 0 means no change.

    Original -> Negate

  • public function changeBrightness($newValue) - changes brightness of image. New values can be in range from 255 (max brightness) to -255 (min brightness), 0 means no change.

    Original -> Negate

  • public function colorize($red, $green, $blue, $alpha = 127) - changes colors of image. Colors ($red, $green, $blue) can be in range from 255 to -255. $alpha from 127 to 0.

    Original -> Negate

  • public function blur($method) - blurs an image. Method can be Imagery::GAUSSIAN_BLUR or Imagery::SELECTIVE_BLUR.

    Original -> Negate

  • public function smooth($level) - smooths an image. Level of smoothness can be in range from 0 to 8. 8 is un-smooth.

    Original -> Negate

  • public function pixelate($blockSize = 5, $useModernEffect = true) - pixelates an image. $blockSize is size of pixel block.

    Original -> Negate

Tools

There's a tools class: Imagery/Tools.

  • static public function pHash(Imagery $image, $sizes = array(8, 8))

    Calculates Perceptual hash of image.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].