All Projects → contao → Imagine Svg

contao / Imagine Svg

Contao Imagine SVG Library

Projects that are alternatives of or similar to Imagine Svg

Picasso
Picasso is a high quality 2D vector graphic rendering library. It support path , matrix , gradient , pattern , image and truetype font.
Stars: ✭ 205 (+327.08%)
Mutual labels:  svg, image
Svg Filters
🔮 Fildrop. A set of custom SVG Filters
Stars: ✭ 251 (+422.92%)
Mutual labels:  svg, image
Contrast Swatch
🅰️ Image microservice for color contrast information
Stars: ✭ 210 (+337.5%)
Mutual labels:  svg, image
React Image Timeline
📆 An image-centric timeline component for React.js
Stars: ✭ 77 (+60.42%)
Mutual labels:  svg, image
Sharp
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
Stars: ✭ 21,131 (+43922.92%)
Mutual labels:  svg, image
Quick Picture Viewer
🖼️ Lightweight, versatile desktop image viewer for Windows. The best replacement for the default Windows photo viewer.
Stars: ✭ 237 (+393.75%)
Mutual labels:  svg, image
Python Barcode
㊙️ Create standard barcodes with Python. No external dependencies. 100% Organic Python.
Stars: ✭ 241 (+402.08%)
Mutual labels:  svg, image
Flutter advanced networkimage
flutter advanced network image provider
Stars: ✭ 282 (+487.5%)
Mutual labels:  svg, image
Borgert Cms
Borgert is a CMS Open Source created with Laravel Framework 5.6
Stars: ✭ 298 (+520.83%)
Mutual labels:  cms, image
Sqip
"SQIP" (pronounced \skwɪb\ like the non-magical folk of magical descent) is a SVG-based LQIP technique.
Stars: ✭ 3,074 (+6304.17%)
Mutual labels:  svg, image
Nuxt Optimized Images
🌅🚀 Automatically optimizes images used in Nuxt.js projects (JPEG, PNG, SVG, WebP and GIF).
Stars: ✭ 717 (+1393.75%)
Mutual labels:  svg, image
Html To Image
✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
Stars: ✭ 595 (+1139.58%)
Mutual labels:  svg, image
Ruby Gem Downloads Badge
Clean and simple gem downloads count badge, courtesy of http://shields.io/. You can checkout the application directly at the following URL:
Stars: ✭ 29 (-39.58%)
Mutual labels:  svg, image
Readme Pagespeed Insights
Google lighthouse stats of your website that you can put in readme
Stars: ✭ 45 (-6.25%)
Mutual labels:  svg
Mobius
Scripts to extract data from the COVID-19 Google Community Mobility Reports
Stars: ✭ 47 (-2.08%)
Mutual labels:  svg
Extended image
A powerful official extension library of image, which support placeholder(loading)/ failed state, cache network, zoom pan image, photo view, slide out page, editor(crop,rotate,flip), paint custom etc.
Stars: ✭ 1,021 (+2027.08%)
Mutual labels:  image
Eapd
CMS (Centers for Medicare and Medicaid Services) eAPD - Modernizing the APD experience
Stars: ✭ 44 (-8.33%)
Mutual labels:  cms
React Icomoon
It allows you to simply view the icons in the selection.json file provided by Icomoon.
Stars: ✭ 48 (+0%)
Mutual labels:  svg
Shcms
一个基于laravel的cms系统
Stars: ✭ 46 (-4.17%)
Mutual labels:  cms
Applicationinimageprocessing
application in image processing or searching
Stars: ✭ 43 (-10.42%)
Mutual labels:  image

Contao Imagine SVG library

This project implements the interfaces of Imagine and allows you to make simple modifications to SVG images. It is used in Contao to handle on-the-fly resizing of SVG images.

Installation

php composer.phar require contao/imagine-svg

Usage

use Contao\ImagineSvg\Imagine;
use Imagine\Image\Box;
use Imagine\Image\Point;

$imagine = new Imagine();

$imagine
    ->open('/path/to/image.svg')
    ->crop(new Point(50, 50), new Box(100, 100))
    ->resize(new Box(40, 40))
    ->save('/path/to/thumbnail.svg')
;

$image = $imagine->open('/path/to/image.svg');

$image->effects()
    ->gamma(1.5)
    ->negative()
    ->grayscale()
    ->colorize($color)
    ->sharpen()
    ->blur(2)
;

$image->save('/path/to/image.svg');

Because of the nature of SVG images, the getSize() method differs a little bit from other implementations. You can check the return value like in this example:

use Contao\ImagineSvg\Imagine;
use Contao\ImagineSvg\SvgBox;

$imagine = new Imagine();
$size = $imagine->open('/path/to/image.svg')->getSize();

if (SvgBox::TYPE_NONE === $size->getType()) {
    // The image has no defined size
} elseif (SvgBox::TYPE_ASPECT_RATIO === $size->getType()) {
    // The image has a relative size, $size->getWidth() and $size->getHeight()
    // should be treated as an aspect ratio
} else {
    // The image has a defined size like a regular image
    // $size->getType() would return SvgBox::TYPE_ABSOLUTE in this case
}
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].