Giter Site home page Giter Site logo

kosinix / grafika Goto Github PK

View Code? Open in Web Editor NEW
876.0 41.0 96.0 10.48 MB

An image processing library for PHP

Home Page: https://kosinix.github.io/grafika

License: MIT License

PHP 99.20% CSS 0.71% JavaScript 0.08%
image-processing smartcrop gd imagick animated-gif

grafika's People

Contributors

kosinix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafika's Issues

resizeFill with a gif file

When doing something like $handle->resizeFill($image, 800, 400) on a GIF, a transparent whitespace is being added. This doesn't occur when the exact same image is a JPEG:

image
image

Original files:
image
image

src/Grafika/Imagick/Editor.php

when i do with blend

    $image->getCore()->setImageOpacity($opacity);

php got an error,Call to undefined function setImageOpacity???

PHP Version 7.1.8
imagick module version 3.4.3
Imagick compiled with ImageMagick version ImageMagick 7.0.1-8 Q16 x86_64 2017-07-10

the blend function has a bug

the blend function 's opacity param must be 1, when is 1.0 and the image2 is a png,the result image is not right,the image2 will be white background color

grafika似乎没有设置字间距的方法

imagick库可以设置字间距

$draw->setTextKerning($kerning);

于是我在text方法中加入了setTextKerning方法,由于GD库没有这个方法,使用时可以判断是GD库还是imagick库,希望新版本能加上

Resizing image makes it blurry by default.

RE: Version pulled during April 2017.

When resizing an image the final size appears slightly blurry when output to JPEG even when quality is set to 100%. It seems as if the 100% value is being ignored and the default 75-80% is being applied. The blurriness happens even if the image is resized the slightest amount and when any acceptable format was the original source (JPEG, GIF, PNG).

The following screenshot compares a Photoshop resize to a Grafika resize of the same amount using the same source file. Both files were resized by 75%. Pay close attention to the wording at the top of the box "new", "take pills easily" etc. The Grafika version more blurry and is an issue with the stakeholders of my project.

While I do not expect Grafika to be Photoshop, this is an issue for presentation.

compare-grafika-photoshop

Has anyone experienced this too?

resizeFill Bug in Ubuntu 14.04 PHP Imagick

resizeFill is buggy in Imagick. Try opening /grafika/examples/resize-modes.php in Ubuntu with Imagick as the editor, results to a buggy resize. See sc1.png. Image 1 is 55x75 and 100x100

sc2.png shows correct results if GD as editor is used. Image 1 and 2 are both 200x200.

sc1
sc2
.

Seems like crop is adding the x and y offsets twice?

I t seems that in Grafika/Imagick/Editor.php lines 179 and 180 X and Y offsets are added to the $x and $y params.

But it seems that the offsets are already added at Grafika/Position.php on lines 119 and 120 right? Those values are used to initialize $x and $y later in the first place.

So Grafika/Imagick/Editor.php lines 179 and 180 can be just removed?

alpha value doesn't affect when using rotating

when I rotate png images colored border will appear according to rotation angle.
now I can set the color but it cant be transparent and with no color.
$color=new Color('ffffff',0.0);
$editor->rotate($image,$rotation[$i],$color);

$color=new Color('ffffff',1.0);
$editor->rotate($image,$rotation[$i],$color);

both are equal!

edited

original

How can rotate a image?

hi,

I want to rotate a image by use follow code, but the result is same, the rotate image same with original image. How worte this code?

Alex

open( "./images/list_1.jpg" ); $editor->rotate(90); $editor->save( "./images/list_1_rotate.jpg", null, 90 ); $editor->free();

图片水印添加中文字体

添加中文字体时,指定好中文字体文件了,但是生成好的图片有背景,这个怎么搞啊,还是这个里面的bug,所有的中文字体都是有背景的。

Add ability to set canvas color when creating a blank image.

Current API just creates a black image:

Grafika::createBlankImage(100,100);

With the new API, we add a third param Color. Below creates a blank canvas with a transparent white background:

use Grafika\Grafika;

$image = Grafika::createBlankImage(100,100, new Color('#FFFFFF', 0.0));

imagecolorat(): x,y is out of bounds

Hi,

There's an error thrown by Gd Editor when using smart crop on portrait images when the provided width of crop is equal or larger to that of the original image.

ex:

$image; // width = 200px, height = 500px
$image->crop($image->getWidth(), $image->getHeight());
// -> throws error

When I crop with $image->getWidth() - 1, it works, but then the image is 1px less than what I need
Also, it only does this with smart crop, other crop methods work.

Is it enough info?
Cheers!

Working with EXIF

Is there any functionality to work with EXIF data, for example deleting some info?

Call to undefined method GdImage::getPixelIterator()

I have a Laravel application that uses Grafika and had been working for months if not years.

Without touching anything in my code, I installed the ImageMagick php extension and now I get this error:

Error:
Call to undefined method GdImage::getPixelIterator()

  at /srv/www/iframe.xxxx.com/vendor/kosinix/grafika/src/Grafika/Imagick/Filter/Dither.php:60
  at Grafika\Imagick\Filter\Dither->diffusion()
     (/srv/www/iframe.xxxx.com/vendor/kosinix/grafika/src/Grafika/Imagick/Filter/Dither.php:40)
  at Grafika\Imagick\Filter\Dither->apply()
     (/srv/www/iframe.xxxx.com/vendor/kosinix/grafika/src/Grafika/Imagick/Editor.php:38)
  at Grafika\Imagick\Editor->apply()
     (/srv/www/iframe.xxxx.com/app/IFrame/Application.php:132)

The mere act of adding the ImageMagick extension (without modifying my code to use it in any way) has made this error appear.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.