All Projects → toughdeveloper → oc-imageresizer-plugin

toughdeveloper / oc-imageresizer-plugin

Licence: MIT License
October CMS Plugin to resize and compress images

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to oc-imageresizer-plugin

oc-imageresize-plugin
October Plugin - Image Resize
Stars: ✭ 13 (-70.45%)
Mutual labels:  image-resizer, october-cms
neural-imaging
[CVPR'19, ICLR'20] A Python toolbox for modeling and optimization of photo acquisition & distribution pipelines (camera ISP, compression, forensics, manipulation detection)
Stars: ✭ 109 (+147.73%)
Mutual labels:  image-compression
rszr
Fast image resizer for Ruby
Stars: ✭ 21 (-52.27%)
Mutual labels:  image-resizer
autoencoder based image compression
Autoencoder based image compression: can the learning be quantization independent? https://arxiv.org/abs/1802.09371
Stars: ✭ 21 (-52.27%)
Mutual labels:  image-compression
imagezero
Fast Lossless Color Image Compression Library
Stars: ✭ 49 (+11.36%)
Mutual labels:  image-compression
ImagePicker
Android library to choose image from gallery or camera with option to compress result image
Stars: ✭ 73 (+65.91%)
Mutual labels:  image-compression
image-optimizer
A free and open source tool for optimizing images and vector graphics.
Stars: ✭ 740 (+1581.82%)
Mutual labels:  image-compression
node-flif
A Node wrapper for the FLIF executable
Stars: ✭ 43 (-2.27%)
Mutual labels:  image-compression
frontend-image-encode
This is script and implementation of frontend image compression, convert, rotate, resize based on codecs in Google/Squoosh. All codecs are copy from the Squoosh repo without modifying. if you want to pre-process images before uploading them to the server, please use this repo for reference
Stars: ✭ 51 (+15.91%)
Mutual labels:  image-compression
qoix
Elixir implementation of the Quite OK Image format
Stars: ✭ 18 (-59.09%)
Mutual labels:  image-compression
xice7-imageKit
基于java语言实现的简单的图片处理
Stars: ✭ 23 (-47.73%)
Mutual labels:  image-compression
imgwizard
Simple server for On-the-Fly image processing in Go
Stars: ✭ 51 (+15.91%)
Mutual labels:  image-resizer
CAE-ADMM
CAE-ADMM: Implicit Bitrate Optimization via ADMM-Based Pruning in Compressive Autoencoders
Stars: ✭ 34 (-22.73%)
Mutual labels:  image-compression
reImage
Fast image resizing backend based on libvips, mozjpeg and pngquant
Stars: ✭ 107 (+143.18%)
Mutual labels:  image-resizer
svd-image-compression-demo
Demonstration of low rank matrix approximations via singular value decomposition
Stars: ✭ 23 (-47.73%)
Mutual labels:  image-compression
Fast-Image-Resizer
Javafx application to resize images and add them into folders automatically.
Stars: ✭ 27 (-38.64%)
Mutual labels:  image-resizer
api
docs.nekos.moe/
Stars: ✭ 31 (-29.55%)
Mutual labels:  image-compression
docker-imgproxy
🌐 An ultra fast, production-grade on-the-fly image processing web server. Designed for high throughput with Nginx caching. Powered by imgproxy.
Stars: ✭ 45 (+2.27%)
Mutual labels:  image-compression
Deep-Image-Compression-Video-Coding
Recent papers and codes related to deep learning/deep neural network based image compression and video coding framework.
Stars: ✭ 69 (+56.82%)
Mutual labels:  image-compression
TinyJPG
images jpg or jpeg compressed and watcher fsnotify
Stars: ✭ 73 (+65.91%)
Mutual labels:  image-compression

Image Resizer

Introduction

Resizes an image to the required dimensions. It accepts a string with a file path to the image or a October\Rain\Database\Attach\File object (you will have one of these if you have used the attachOne or AttachMany relationship)

Please note, the not found image can be overwritten via the settings in the admin area.

Available filters

resize(int $width [, int $height , array $options]), imageWidth(), imageHeight()

Using a string

Please note, if the filter alters the URL, you must apply resize afterwards

{{ 'assets/graphics/background.jpg' | theme | resize(500,500) }}

Using a variable

{{ property.image | resize(500) }}

resize(int $width [, int $height , array $options])

Resize an image according to the given params. If $width or $height is 0, that value is calculated using original image ratio

Options

Key Description Default Options
mode How the image should be fitted to dimensions auto exact, portrait, landscape, auto, fit or crop
offset Offset the resized image [0,0] [int, int]
extension The extension on the image to return auto auto, jpg, jpeg, gif, png
quality The quality of compression *requires cache clear 95 0-100
sharpen Sharpen the image across a scale of 0 - 100 *requires cache clear 0 0-100
compress Whether the image should be compressed or not. Only takes effect when TinyPng compression is enabled. true true,false

Usage in template

{{ property.image | resize(500, false, { mode: 'crop', quality: '80', extension: 'png' }) }}

Usage in PHP

The image resizer can also be used easily in PHP, as follows:

use ToughDeveloper\ImageResizer\Classes\Image;

$image = new Image('/path/to/image.jpg');
$image->resize(150, 200, [ 'mode' => 'crop' ]);

Usage in Backend List

The image resizer can also be used on backend lists with the type of thumb, e.g.

image:
    label: Image
    type: thumb

This works with:

  • AttachMany (uses first image) Docs
  • AttachOne Docs
  • Mediafinder Docs

You can also optionally pass width (default 50), height (default 50) and options as follows:

image:
    label: Image
    type: thumb
    width: 75
    height: 100
    options:
        mode: crop

imageWidth() - imageHeight()

Return current image width/height - useful if you need to know the size of an image resized only by one side.

{{ '/path/to/image.jpg' | resize(250) | imageHeight() }}

Image Compression via TinyPNG

The plugin integrates with the TinyPNG API to provide image compression. A developer API key is required, to obtain one visit https://tinypng.com/developers. Once obtained, enter it in the Image Resizer Settings area of October CMS backend.

TinyPNG offer 500 free compression per month, the plugin automatically caches resized images to save credits, an option to not compress certain images is also available.

If you are focussed on pagespeed, it is recommended to set your image quality at 70-80 to obtain the lowest filesize whilst still retaining high quality images.

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].