• Stars
    star
    151
  • Rank 238,429 (Top 5 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A PHP library for easy image handling. ๐Ÿ–ผ

GImage

Build Status Latest Unstable Version Total Downloads License

A PHP library for easy image handling. ๐Ÿ–ผ

GImage is a simple and small library based on PHP Image Processing and GD for processing images easily.

A simple presentation card with GImage

Presentation card built with GImage - View code example

Features

  • Load an image from a local path, URL or image resource.
  • Create shapes such as rectangles or ellipses with opacity.
  • Resize, scale or crop images proportionally.
  • Rotate images, shapes or texts.
  • Embed text with custom TTF fonts.
  • Compose a pool of images with Canvas.
  • Swap image formats such as JPEG, PNG or GIF.
  • Save images locally or output them on the browser.
  • Save several copies of the same image.
  • Render an image in memory and return its resource.

Requirements

GImage requires PHP 7.4 or a recent PHP version with the latest GD Extension.

Install

composer require joseluisq/gimage

Usage

Load an external PNG image and save it as JPG:

<?php

use GImage\Image;

// PNG image (600x199)
$url = 'https://i.imgur.com/G5MR088.png';

$arch = new Image();
$arch
    // Load from URL
    ->load($url)
    // Scale to 50% (300x99)
    ->scale(0.5)
    // Change the format to JPG
    ->toJPG()
    // Saving in local path
    ->save('arch.jpg');

See GImage Website for detailed usage instructions and more advanced examples.

Changelog

Check out the CHANGELOG.md file.

Examples

See code examples directory.

Development

Run tests

Via Composer

composer install
composer run-script test

Via Docker (multi PHP versions test)

make docker-tests

Contribution

Feel free to send some Pull request or file an issue.

License

This work is primarily distributed under the terms of the MIT license.

ยฉ2015-present Jose Quintana

More Repositories

1

gitnow

Speed up your Git workflow. ๐Ÿ 
Shell
328
star
2

alpine-php-fpm

Lightweight & optimized Multi-Arch Docker Images (x86_64/arm/arm64) for PHP-FPM (PHP 8.0, 8.1, 8.2) with essential extensions on top of latest Alpine Linux. ๐Ÿ˜
Dockerfile
129
star
3

rust-linux-darwin-builder

Use the same Docker image to cross-compile Rust x86_64/ARM64 programs for Linux and macOS (osxcross).
Dockerfile
94
star
4

printd

Print HTML elements or pages in modern browsers.
TypeScript
73
star
5

prelodr

A simple Material preloader inspired by Google Inbox.
JavaScript
68
star
6

awesome-bash-commands

A curated list of awesome Bash useful commands. Inspired by awesome-shell and bash-handbook.
Shell
52
star
7

macosx-sdks

Some Mac OS X SDKs for development purposes with osxcross.
51
star
8

paket

A simple and fast package manager for the Fish shell written in Rust. ๐Ÿ 
Rust
50
star
9

hyperapp-starter

Minimal Hyperapp, Typescript and Parcel starter. ๐Ÿ“ฆ๐Ÿš€๐ŸŽ‰
TypeScript
43
star
10

slendr

A responsive & lightweight (2KB gzipped) slider for modern browsers. [UNMAINTAINED]
TypeScript
38
star
11

ubigeos-peru

Datos JSON y SQL sobre departamentos, provincias y distritos del Perรบ.
PHP
34
star
12

sortboard

A small ES6 library for easy sorting and filtering of elements.
TypeScript
29
star
13

fastify-cluster-example

A simple example of how to running a Fastify server in multi-threaded mode.
TypeScript
22
star
14

timelite

String date and time utilities ๐Ÿ•™
TypeScript
17
star
15

vue-vform

Vue.js 2 form component that integrates jQuery Validation and Axios.
Vue
15
star
16

pokemons

Full JSON file with every Pokรฉmon basic info. Useful for prototyping.
13
star
17

go-tspath

A fast and persistent Typescript paths replacer written in Go.
Go
13
star
18

vue-input-number

A custom input number component for Vue.js 2
Vue
13
star
19

preact-starter

Minimal Preact, Typescript and Parcel starter. ๐Ÿš€
TypeScript
12
star
20

jquery.xfilterlist

[Deprecated] A simple jQuery grid list plugin for easy filter and sorting.
HTML
10
star
21

alpine-cgit

Multi-Arch Docker images for the hyperfast web frontend for Git repositories on top of Alpine and Nginx.
Dockerfile
10
star
22

awesome-mysql-queries-commands

๐Ÿฌ A curated list of awesome MySQL useful queries and commands.
10
star
23

printd-vue-component-example

Example of printing a Vue 2 component using Printd.
JavaScript
9
star
24

codeigniter3-hmvc-boilerplate

Boilerplate for creating CodeIgniter 3 HMVC with Propel 2 ORM and OAuth2
PHP
8
star
25

enve

Cross-platform tool to run a program in a modified environment providing a .env file.
Go
7
star
26

git-cheat-sheet

Another Git cheat sheet yet :octocat:
6
star
27

docker-mysql-client

MySQL 8 client programs with easy database export and import functionality.
Dockerfile
6
star
28

koa-graphql-rethinkdb

GraphQL API Server example using Koa, Apollo GraphQL Server & RethinkDB. ๐Ÿš€
TypeScript
6
star
29

git-useful-aliases

Small list of useful Git aliases.
Shell
6
star
30

karma-jasmine-typescript

Sample of Unit Testing using Karma, Jasmine and Typescript.
JavaScript
5
star
31

utetris

Custom Mootools web version of famouse Tetris game.
JavaScript
5
star
32

jquery.xrequest

[Deprecated] Simple plugin to Ajax Request
CSS
5
star
33

helipad

A cross-platform, lightweight and fast CI/CD Server/Client written in Rust (WIP).
Rust
5
star
34

vue-typescript-starter

Tiny Vue 2 & Typescript frontend starter. ๐Ÿš€
JavaScript
5
star
35

alpine-mysql-client

Docker MySQL (MariaDB) client with easy export and import tools.
Shell
5
star
36

react-prelodr

A React component based on Prelodr.
JavaScript
4
star
37

svexport

Small PHP character-separated values exporter (CSV and TSV).
PHP
4
star
38

micro-one-dark

One Dark colorcheme for Micro.
Lua
4
star
39

peru-geojson-datasets

Estructuras de datos geogrรกficos GeoJSON representando departamentos, provincias y distritos del Perรบ.
4
star
40

sprintfit

A fast 450b sprintf & vsprintf format specifier focused on strings with no dependencies. โšก๏ธ
TypeScript
4
star
41

ruta

A lightweight HTTP routing library for PHP 8+ without external dependencies. (WIP)
PHP
4
star
42

uFilterGrid

[Deprecated] A simple Mootools grid list plugin for easy filter and sorting.
HTML
4
star
43

laravel-ci-deployment

Laravel 5.4 + Circle CI + Deployer example
PHP
4
star
44

nano-crypto

Nano ID + Crypto utility functions with full Typescript support.
TypeScript
3
star
45

php-bitbucket-deployment

Simple PHP script to automatic Bitbucket deployment.
PHP
3
star
46

json-datasets

Example of various datasets in JSON format for different purposes.
3
star
47

cline

A fast and lightweight CLI package for Go without external dependencies.
Go
3
star
48

alpine-curl

An unofficial multi-arch cURL Docker image using latest Alpine Linux with Zstandard support.
Dockerfile
3
star
49

leap

A lightweight micro HTTP framework for PHP 8.1+ (experimental)
PHP
2
star
50

nginx-freebsd-server-configs

Small configs for run Nginx 1.10.1 on FreeBSD 10.2 + SSL
Nginx
2
star
51

gutr-css

Hackable gutters for your box model.
CSS
2
star
52

es6-browserify-gulp-boilerplate

A simple ES6 Babel, Browserify and Gulp boilerplate.
JavaScript
2
star
53

semver-aliases

A simple Go package to create deduplicated version aliases based on valid SemVer release names.
Go
2
star
54

lumen-restful-boilerplate

A simple boilerplate to start your first RESTfull API with PHP Lumen
PHP
2
star
55

lumen-54-boilerplate

Lumen 5.4 boilerplate for starting your first API.
PHP
2
star
56

grunt-deployit

Deploy your files easily using FTP.
JavaScript
2
star
57

fedora-sublime-text-3-sh-installer

Sublime Text 3 Shell Installer for Fedora Linux x64
Shell
2
star
58

kde-app-launcher-archlinux-icons

ArchLinux icon variants for KDE Plasma 5 application launcher.
2
star
59

video-source-url

Get video source from Youtube or Vimeo URL.
JavaScript
2
star
60

iterm2-material-theme

Material color theme for iTerm2 inspired in Sublime Material Theme.
2
star
61

slim3-todos-example

ToDo API example using PHP Slim 3, Laravel Eloquent and SQLite 3.
PHP
2
star
62

tslint-config-standard-plus

A TSLint config for JavaScript Standard Style with a plus of useful rules.
TypeScript
2
star
63

peru-elecciones-generales-2021-scraper

JSON Scraper de las Elecciones Generales Perรบ 2021.
Dart
2
star
64

fastify-dockerized-sample

Very bare sample of a dockerized Fastify server
JavaScript
1
star
65

gitd

Use Git to fetch all source files from any repository. :octocat:
JavaScript
1
star
66

deno-examples

Some Deno examples for NodeJS Meetup Leipzig #3
TypeScript
1
star
67

goipcc

A simple Unix IPC Socket client for Go. For more flexibility try joseluisq/gonetc instead.
Go
1
star
68

seqr

A small ES6 package for execute functions sequentially.
JavaScript
1
star
69

echo-dockerclient

Tiny Echo middleware for Go Docker Client.
Go
1
star
70

atom-essentials

Some essential packages for more friendly development in Atom.
Shell
1
star
71

php-oauth2-demo

Example using OAuth2
PHP
1
star
72

docker-alpine-nginx-php7

Docker Nginx & PHP 7 image on the top of Alpine Linux. ๐Ÿณ [UNMAINTENATED] Use instead https://github.com/joseluisq/alpine-php-fpm
Nginx
1
star
73

usize

Useful Mootools class for resize DOM objects
JavaScript
1
star
74

uslider

Simple Mootools CSS3 Adaptable Slider
JavaScript
1
star
75

sleep-non-blocking-function

Deno & Node examples implementing a non-blocking sleep function.
TypeScript
1
star
76

emitus

Small Typescript Event Emitter. โšก
TypeScript
1
star
77

node-sass-app-compiler

Aplicaciรณn Nodejs para compilar Sass usando Libsass y GruntJS.
JavaScript
1
star
78

composer-essentials

Some PHP Composer global packages.
Shell
1
star
79

umessagebox

Simple Mootools modal messagebox
JavaScript
1
star
80

rpasswd

A small and secure password generator and encryptor tool.
Go
1
star
81

ng-util-directives

Some Angular 1.x useful directives
JavaScript
1
star
82

react-app-boilerplate

Create React App bootstrap but customized + config files.
JavaScript
1
star
83

codeigniter-composer-boilerplate

A boilerplate for getting started with latest CodeIgniter using Composer.
1
star
84

golang-code-examples

Some code examples of my GoLang learning ๐ŸŽ“
Go
1
star
85

ffds

Small script for build a fast Front-End directory structure.
Shell
1
star
86

myftp

A PHP small class for FTP handling.
PHP
1
star
87

angular-apollo-client-starter

Example using Angular 4 & Apollo Client
TypeScript
1
star
88

hacker-news-stream

The Hacker News top stories but in Streams.
JavaScript
1
star
89

php-ga-tracking-redirect

Simple PHP Google Analytic Tracking with custom 301 redirection.
PHP
1
star
90

node-random-strings-demo

Random strings demo using Budo + Browserify
HTML
1
star
91

angular-fbxnd

Angular 1.x bindings for JavaScript Facebook SDK
1
star
92

awesome-medium-programming

A curated list of interesting Medium Programming Articles.
1
star
93

rust-tspath

A Typescript paths replacer written in Rust. โšก Supersed by https://github.com/joseluisq/go-tspath
Rust
1
star
94

minimal-boilerplate

Minimal Front-End boilerplate with npm run tasks built-in.
HTML
1
star
95

react-boilerplate

Another React boilerplate.
JavaScript
1
star
96

fedora-atom-sh-installer

Atom shell installer for Fedora Linux x86_x64
Shell
1
star
97

mydb

A small PHP Data Objects extension class for database handling.
PHP
1
star