├── .gitignore ├── EasyImage.php ├── README.md ├── docs └── index.html └── examples ├── .DS_Store ├── ._.DS_Store ├── EasyImageLogo ├── index.php └── resources │ └── outrider.ttf ├── HTMLExample ├── index.php └── resources │ ├── AllerDisplay.ttf │ ├── CaviarDreams.ttf │ ├── background.jpg │ └── outrider.ttf ├── basicExample ├── index.php └── resources │ └── cat.jpeg ├── concatExample ├── index.php └── resources │ ├── ._kitty1.gif │ ├── ._kitty2.png │ ├── kitty1.gif │ └── kitty2.png ├── giftest ├── index.php └── resources │ └── test.gif ├── gradientExample └── index.php ├── gradientExample1 └── index.php ├── gradientExample2 ├── index.php └── resources │ └── face.png ├── infoExampe ├── index.php └── resources │ ├── ._apple.jpg │ └── apple.jpg ├── perspectiveExample ├── index.php └── resources │ ├── grid.gif │ └── grid.jpg ├── psdExample ├── index.php └── resources │ └── angelwings.psd ├── simpleTextExample ├── index.php └── resources │ └── OldStreetSigns.ttf └── textAlignExample ├── index.php └── resources └── OldStreetSigns.ttf /.gitignore: -------------------------------------------------------------------------------- 1 | /nbproject/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![EasyImage v2.8 Logo](https://i.imgur.com/Uj8V1YI.png) 2 | 3 | **By:** Robert Parham | 4 | **License:** wtfpl.net WTFPL | 5 | **Version:** 2.8 6 | 7 | [EasyImage](http://pamblam.github.io/EasyImage/) is an easy to use image manipulation library written entirely in PHP and implemented in a single PHP class. 8 | 9 | **This library is written for a tool that is hosted on a legacy system. Ideally, you should use a tool that implements ImageMagick.** 10 | 11 | ## It's Easy! 12 | The focus is on ease of use. 13 | * You need only include a single class file. 14 | * You **don't** need ImageMagick. *This means EasyImage is going to be slightly slower than an ImageMagick solution, but will be more portable.* 15 | * No clean up! Temporary resources are destroyed automagically. 16 | * Uses a single constructor for all image types, `EasyImage::Create($file)`, so you don't have to remember a bunch of different function names. 17 | * All editing methods are chainable, so you can achieve most image editing functionality in a single line. `$img = EasyImage::Create($file)->scale(100)->borderRadius();`. 18 | * Output is a breeze too. To send the image to the browser simply echo the class instance, EasyImage will take care of headers and everything. `echo EasyImage::Create($file)->greyScale();`. There are also options to save the image locally or force it as a download. 19 | * Works on ancient versions of PHP. 20 | 21 | ## It can do anything! 22 | (Almost...) 23 | * Reads and writes Animated gifs. 24 | * Reads Photoshop project files (PSD). 25 | * Writes to PDF format. 26 | * Resize, skew, layer, distort, replace colors, add watermarks, create text, create gradients, and a ton more. 27 | * Get information about the image such as size, mime type, a list of colors in the image, et cetera. 28 | * ~~Call and wish you a happy birthday.~~ *Feature still in beta.* 29 | 30 | Be sure to check out the docs [here](http://pamblam.github.io/EasyImage/) to see the complete list of features and functionality. -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | EasyImage Docs 11 | 12 | 13 | 14 | 21 | 22 | 23 | 27 | 28 | 29 | 30 | 31 | 71 | 72 | 73 |
74 |
75 |
76 | 77 | 78 |

Download

79 |

Download from GitHub.

80 |

EasyImage on GitHub

81 |
82 | 83 |

Info

84 |

Easy image is an easy to use image manipulation library written entirely in PHP and implemented in a single PHP class. It's intended to be used where ImageMagick is not available, and works on PHP 5.3 and up. It can be used to edit, apply filters, resize, animate, convert and get information about images in several formats.

85 |
86 | 87 | 88 | 101 | 113 | 126 | 138 | 139 |
89 |

90 | Input types: 91 |

    92 |
  • PNG file
  • 93 |
  • GIF file
  • 94 |
  • JPG file
  • 95 |
  • PSD file
  • 96 |
  • Animated Gif
  • 97 |
98 |

99 |                                             100 |
102 |

103 | as 104 |

    105 |
  • Base 64 string
  • 106 |
  • Image URL
  • 107 |
  • HTML
  • 108 |
  • Local File
  • 109 |
110 |

111 |                                             112 |
114 |

115 | Output types: 116 |

    117 |
  • PNG
  • 118 |
  • GIF
  • 119 |
  • JPG
  • 120 |
  • Animated Gif
  • 121 |
  • PDF
  • 122 |
123 |

124 |                                             125 |
127 |

128 | as 129 |

136 |

137 |
140 | 141 | 142 | 158 | 173 | 188 | 203 | 204 |
143 |

144 | Edit & Adjust Image: 145 |


156 |

157 |
159 |

160 |


171 |

172 |
174 |

175 |


186 |

187 |
189 |

190 |


201 |

202 |
205 | 206 | 207 | 218 | 228 | 238 | 248 | 249 |
208 |

209 | Get Image Info: 210 |


216 |

217 |
219 |

220 |

226 |

227 |
229 |

230 |

236 |

237 |
239 |

240 |

246 |

247 |
250 | 251 | 252 | 261 | 270 | 278 | 286 | 287 |
253 |

254 | Utilities & Helpers: 255 |

259 |

260 |
262 |

263 |

268 |

269 |
271 |

272 |

276 |

277 |
279 |

280 |

284 |

285 |
288 | 289 | 290 |
291 |

Usage

292 |

EasyImage was meant to be easy to use. To that end, most of it's methods are chainable, and the image can be sent to the browser by simply echoing the class. This allows you to generate and alter images in a single statement.

293 | 294 |
295 |

EasyImage::Create()

296 |

EasyImage has a universal constructor: EasyImage::Create(). This method is used to create your EasyImage object no matter what the input type.

297 | 298 |
299 | 300 |
301 |
302 |

Create from Local File

303 |
304 |
305 |
306 |
EasyImage::Create( $filepath [, $isTemp=false ] )
307 |
308 | 313 |
    314 |
  • $filepath - string A path to an image on the filesystem
  • 315 |
  • $isTemp - boolean (optional) If set to true, will delete the source image when the script completes
  • 316 |
317 |
$path = realpath(dirname(__FILE__));
echo EasyImage::Create("$path/image.png");
318 |
319 |
320 | 321 |
322 |
323 |
324 |

Create from URL

325 |
326 |
327 |
328 |
EasyImage::Create( $url )
329 |
330 |
    331 |
  • $url - string A URL for an image on the web
  • 332 |
333 |
echo EasyImage::Create("www.example.com/images/logo.jpg");
334 |
335 |
336 | 337 |
338 |
339 |
340 |

Create blank image

341 |
342 |
343 |
344 |
EasyImage::Create( $width, $height [, $background=null ] )
345 |
346 |
    347 |
  • $width - string Width of the image
  • 348 |
  • $height - string Height of the image
  • 349 |
  • $background - string|array A hex color or an array of hex colors to form a gradient
  • 350 |
351 |
echo EasyImage::Create(50, 50);
352 |
353 |
354 | 355 |
356 |
357 |
358 |

Create from Base64 String

359 |
360 |
361 |
362 |
EasyImage::Create( $b64 )
363 |
364 |
    365 |
  • $b64 - string A Base64 encoded image
  • 366 |
367 |
echo EasyImage::Create("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACg0lEQVR4nO3XTWhUVxQH8F+ipopgCVqTuFFLtQstwS+IChpXrbrr2iJ+rQviwi666aIFQRAFN7pzIyIBUXChKFW0UMGFdqWgLTRG0eBHaltjYro49zmTl3mZNxOhC/3DcGfOvef7vf+5wwe872hpUm8eVqITH+MJBnADL99NaBMxDTtwDaMYq/H5F+fxVVmjZSvQg+NYhmFcwSX045moyCJ8iTXJ7iXsxB9lgynCNyKzYRzBJ3XOL8VpUZFHWDcV59uSoYdNGNqGf/A3VjfjvEdk/hCLmzGAXlG5fnQ1otiKW0l5bZPOM+wRVTzRiNL2pHR4is4zXMUbdJdV+FlkP79KNhv7RW+L0Ia9IuvqN2yTSOhQGefteI2LOfmPKu/7hgLdvVVnvq6St+Ix7uYVWmsY6cZ0XM7Jh9I6hr8KAhgq+P5GVPUzwZxvMb2GkY609ufkB3AfD3CzIIDjGEwBXsjtZfY68HyyAOak9UVOPoqTBY4zjKGvYC9zOq4CtVowmNa5dZw1ioxBn9QLYCCtzZJPERapsOqk+Ej0sFafl2BhHf0VJlZvlqDkX+s5z9Anol2ek98Q43hmgV6XqOCxnDybKd+XDWBjUjibk68U8+EX4wdMC7aK0dtvfAXacE9UtbNsAHAuBbE7J+/FU5V+3q76fQef5s4fTXs/NOIcFohshrE5t9cuaPmMqMYp7BLZVmNfcn5dPFsNY5VgtBF8q/wNqk0l83sq5NYUvhAMOCYewi2YUXB2tpikv6fz14wfaBNQNqN5+ElcSqcJlryKPwXDZXfC9Sqv8cGk86qkj1L4PBn9zcQb8ajo9XcaKHmz/wsILugQ3D4oLqAjU7D3Af8P/gN1UJotAMKqGQAAAABJRU5ErkJggg==");
368 |
369 |
370 | 371 |
372 |
373 |
374 |

Create from Text

375 |
376 |
377 |
378 |
EasyImage::Create( $text, $font_size, $font_color, $font_file, [, $background=null [, $wrap_width=false [, $alpha=EasyImage::TEXT_ALIGN_LEFT [, $padding=5 [, $align=0 ] ] ] ] ] )
379 |
380 | 385 |
    386 |
  • $text - string A string of text to be drawn as an image
  • 387 |
  • $font_size - int The size of the font
  • 388 |
  • $font_color - mixed An image or color to be overlayed over the font
  • 389 |
  • $font_file - string Path to a trueType font file
  • 390 |
  • $background - mixed (optional) An image or hex color to be used as the background
  • 391 |
  • $wrap_width - int (optional) How wide to allow text to get before wrapping
  • 392 |
  • $alpha - int (optional) Transparency level (0-127)
  • 393 |
  • $padding - int (optional) padding around the text
  • 394 |
  • $align - int (optional) Text alignment. May be any of the following 395 |
      396 |
    • EasyImage::TEXT_ALIGN_LEFT - Left align text (default)
    • 397 |
    • EasyImage::TEXT_ALIGN_RIGHT - Right align text
    • 398 |
    • EasyImage::TEXT_ALIGN_CENTER - Center align text
    • 399 |
    • EasyImage::TEXT_ALIGN_JUSTIFY - Justify align text
    • 400 |
    401 |
  • 402 |
403 |
echo EasyImage::Create(
    "Hello, World",
    13,
    "#FF0000",
    "fancyFont.ttf"
);
404 |
405 |
406 | 407 |
408 |
409 |
410 |

Create from HTML

411 |
412 |
413 |
414 |
EasyImage::Create( $HTML, $fonts )
415 |
416 |
    417 |
  • $HTML - string HTML string
  • 418 |
  • $fonts - array An array of fonts where the keys are font title and the values are the path to the file
  • 419 |
420 | 440 |
$fonts = array("courier"=>"courier.ttf", "impact"=>"impact.ttf");
$HTML = "<span style='font-size:15;'>Hello, </span><span style='font-face:impact'>world</span>";
echo EasyImage::Create($HTLM, fonts);
441 |
442 |
443 | 444 |
445 |
446 |
447 |

Create Animated Gif

448 |
449 |
450 |
451 |
EasyImage::Create( $sources [, $delayTimes=5 [, $loops=0 [, $disposal=2 [, $transRed=0 [, $transGreen=0 [, $transBlue=0 ] ] ] ] ] ] )
452 |
453 |
    454 |
  • $sources - array An array of images to use as frames. Can be image paths, URLs, base64 strings, EasyImage objects or any combination
  • 455 |
  • $delayTimes - array|int (optional) Either an array of delay times for each frame, or a single delay time that will be applied to all frames
  • 456 |
  • $loops - int|bool (optional) The number of times to loop the image; 0=infinite; false=no loop
  • 457 |
  • $disposal - int (optional) Gif disposal method
  • 458 |
  • $transRed - int (optional) Transparent red color
  • 459 |
  • $transGreen - int (optional) Transparent green color
  • 460 |
  • $transBlue - int (optional) Transparent blue color
  • 461 |
462 |
$sources = array("frame1.gif", "frame2.gif", "frame3.gif"); 
echo EasyImage::Create($sources);
463 |
464 |
465 | 466 |
467 |

Editing

468 |

All the editing methods are chainable for convenience.

469 | 470 |
471 |
472 |
473 |

Border Radius

474 |
475 |
476 |
477 |
borderRadius( [ $radius=10 [, $colour="#FFFFFF" ] ] )
478 |
479 |
    480 |
  • $radius - int (optional) Radius of the corners
  • 481 |
  • $colour - string (optional) A hex color for the corners
  • 482 |
483 |
echo EasyImage::Create($file)->borderRadius();
484 |
485 |
486 | 487 |
488 |
489 |
490 |

Add Watermark

491 |
492 |
493 |
494 |
addWatermark( $text, $font_size, $color, $font_file [, $horizontal_pos=EasyImage::RIGHT [, $vertical_pos=EasyImage::BOTTOM [, $opacity=65 [, $padding=3 ] ] ] ] )
495 |
496 |
    497 |
  • $text - string Text for the watermark
  • 498 |
  • $font_size - int Size of font for the watermark
  • 499 |
  • $color - string Hex color for the image
  • 500 |
  • $font_file - string Path to trueType font file
  • 501 |
  • 502 | $horizontal_pos - string (optional) Horizontal position of the watermark 503 | 511 |
  • 512 |
  • 513 | $vertical_pos - string (optional) Vertical position of the watermark 514 | 522 |
  • 523 |
  • $opacity - int (optional) Opacity of the watermark
  • 524 |
  • $padding - int (optional) Padding around the watermark
  • 525 |
526 |
echo EasyImage::Create($file)->
    addWatermark(
        "uploaded to mysite.com",
        18,
        "#000",
        "courier.ttf"
    );
527 |
528 |
529 | 530 |
531 |
532 |
533 |

Change Opacity

534 |
535 |
536 |
537 |
makeOpaque( $alpha )
538 |
539 |
    540 |
  • $alpha - int Alpha level, a number 0 through 127
  • 541 |
542 |
echo EasyImage::Create($file)->makeOpaque(56);
543 |
544 |
545 | 546 |
547 |
548 |
549 |

Add Overlay

550 |
551 |
552 |
553 |
addOverlay( $image, $dst_x, $dst_y [, $src_w=null [, $src_h=null ] ] )
554 |
555 |
    556 |
  • $image - mixed An image URL, filepath, or EasyImage object
  • 557 |
  • $dst_x - int Destination x ordinate
  • 558 |
  • $dst_y - int Destination y ordinate
  • 559 |
  • $src_w - int (optional) Source width
  • 560 |
  • $src_h - int (optional) Source height
  • 561 |
562 |
echo EasyImage::Create($file)->addOverlay($overlay, 0, 0);
563 |
564 |
565 | 566 |
567 |
568 |
569 |

Convert to Black and White

570 |
571 |
572 |
573 |
blackAndWhite( )
574 |
575 |
echo EasyImage::Create($file)->blackAndWhite();
576 |
577 |
578 | 579 |
580 |
581 |
582 |

Crop an Image

583 |
584 |
585 |
586 |
crop( $new_width, $new_height [, $x=0 [, $y=0] ] )
587 |
588 |
    589 |
  • $new_width - int New image width
  • 590 |
  • $new_height - int New image height
  • 591 |
  • $x - int (optional) Starting x position
  • 592 |
  • $y - int (optional) Starting y position
  • 593 |
594 |
echo EasyImage::Create($file)->crop(32, 32);
595 |
596 |
597 | 598 |
599 |
600 |
601 |

Auto-Crop an Image

602 |
603 |
604 |
605 |
autoCrop( [ $threshold=50 [, $padding=3 ] ] )
606 |
607 |
    608 |
  • $threshold - int (optional) Color sensitivity
  • 609 |
  • $padding - int (optional) Padding of pixels around image
  • 610 |
611 |
echo EasyImage::Create($file)->autoCrop();
612 |
613 |
614 | 615 |
616 |
617 |
618 |

Transparent to Color

619 |
620 |
621 |
622 |
transparentToColor( $hexColor )
623 |
624 |
    625 |
  • $hexColor - string Hex color to remove
  • 626 |
627 |
echo EasyImage::Create($file)->transparentToColor($hexColor);
628 |
629 |
630 | 631 |
632 |
633 |
634 |

Remove a Color

635 |
636 |
637 |
638 |
removeColor( $hexColor )
639 |
640 |
    641 |
  • $hexColor - string Hex color to remove
  • 642 |
643 |
echo EasyImage::Create($file)->removeColor($hexColor);
644 |
645 |
646 | 647 |
648 |
649 |
650 |

Replace a Color

651 |
652 |
653 |
654 |
replaceColor( $oldColor, $newColor [, $threshold=50 ] )
655 |
656 |
    657 |
  • $oldColor - string Color to remove
  • 658 |
  • $newColor - string Color to replace with
  • 659 |
  • $threshold - int (optional) Color sensitivity
  • 660 |
661 |
echo EasyImage::Create($file)->replaceColor("#ff0000", "#00ffff");
662 |
663 |
664 | 665 |
666 |
667 |
668 |

Scale an Image

669 |
670 |
671 |
672 |
scale( $width [, $height=null [, $cover=EasyImage::FILL ] ] )
673 |
674 |
    675 |
  • $width - int Maximum new width of image
  • 676 |
  • $height - int (optional) Maximum new height of image
  • 677 |
  • 678 | $cover - string (optional) Scale mode 679 | 686 |
  • 687 |
688 |
echo EasyImage::Create($file)->scale(150);
689 |
690 |
691 | 692 |
693 |
694 |
695 |

Resize an Image

696 |
697 |
698 |
699 |
resize( $width, $height )
700 |
701 |
    702 |
  • $width - int New width of image
  • 703 |
  • $height - int New height of image
  • 704 |
705 |
echo EasyImage::Create($file)->resize(150, 200);
706 |
707 |
708 | 709 |
710 |
711 |
712 |

Rotate an Image

713 |
714 |
715 |
716 |
rotate( $degrees )
717 |
718 |
    719 |
  • $degrees - int Degrees to rotate image
  • 720 |
721 |
echo EasyImage::Create($file)->rotate(180);
722 |
723 |
724 | 725 |
726 |
727 |
728 |

Tile an Image

729 |
730 |
731 |
732 |
tile( $width, $height )
733 |
734 |
    735 |
  • $width - int Width to tile image to
  • 736 |
  • $height - int Height to tile image to
  • 737 |
738 |
echo EasyImage::Create($file)->rotate(500, 300);
739 |
740 |
741 | 742 |
743 |
744 |
745 |

Reverse Colors

746 |
747 |
748 |
749 |
reverseColors( )
750 |
751 |
echo EasyImage::Create($file)->reverseColors();
752 |
753 |
754 | 755 |
756 |
757 |
758 |

Tile an Image

759 |
760 |
761 |
762 |
greyScale( )
763 |
764 |
echo EasyImage::Create($file)->greyScale();
765 |
766 |
767 | 768 |
769 |
770 |
771 |

Adjust Brightness

772 |
773 |
774 |
775 |
adjustBrightness( $newBrightness )
776 |
777 |
    778 |
  • $newBrightness - int a number between 255 and -255
  • 779 |
780 |
echo EasyImage::Create($file)->adjustBrightness(150);
781 |
782 |
783 | 784 |
785 |
786 |
787 |

Adjust Contrast

788 |
789 |
790 |
791 |
adjustContrast( $newContrast )
792 |
793 |
    794 |
  • $newContrast - int New contrast level
  • 795 |
796 |
echo EasyImage::Create($file)->adjustContrast(150);
797 |
798 |
799 | 800 |
801 |
802 |
803 |

Edge Detect

804 |
805 |
806 |
807 |
edgeDetect( )
808 |
809 |
echo EasyImage::Create($file)->edgeDetect();
810 |
811 |
812 | 813 |
814 |
815 |
816 |

Emboss

817 |
818 |
819 |
820 |
emboss( )
821 |
822 |
echo EasyImage::Create($file)->emboss();
823 |
824 |
825 | 826 |
827 |
828 |
829 |

Gaussian Blur

830 |
831 |
832 |
833 |
gaussianBlur( )
834 |
835 |
echo EasyImage::Create($file)->gaussianBlur();
836 |
837 |
838 | 839 |
840 |
841 |
842 |

Selective Blur

843 |
844 |
845 |
846 |
selectiveBlur( )
847 |
848 |
echo EasyImage::Create($file)->selectiveBlur();
849 |
850 |
851 | 852 |
853 |
854 |
855 |

Sketch Filter

856 |
857 |
858 |
859 |
sketch( )
860 |
861 |
echo EasyImage::Create($file)->sketch();
862 |
863 |
864 | 865 |
866 |
867 |
868 |

Add Vignette

869 |
870 |
871 |
872 |
vignette( )
873 |
874 |
echo EasyImage::Create($file)->vignette();
875 |
876 |
877 | 878 |
879 |
880 |
881 |

Create Alpha Map

882 |
883 |
884 |
885 |
alphaMap( )
886 |
887 |
echo EasyImage::Create($file)->alphaMap();
888 |
889 |
890 | 891 |
892 |
893 |
894 |

Remove Transparency

895 |
896 |
897 |
898 |
removeTransparency( [ $newHexColor="#FFFFFF" ] )
899 |
900 |
    901 |
  • $newHexColor - string (optional) Hex color to replace transparent pixels with
  • 902 |
903 |
echo EasyImage::Create($file)->removeTransparency();
904 |
905 |
906 | 907 |
908 |
909 |
910 |

Add Perspective

911 |
912 |
913 |
914 |
perspective( [ $gradient=0.85 [, $angle=EasyImage::TOP ] ] )
915 |
916 |
    917 |
  • $gradient - float (optional) Gradient of perspective
  • 918 |
  • $angle - string (optional) Angle of perspective
  • 919 |
920 |
echo EasyImage::Create($file)->perspective();
921 |
922 |
923 | 924 |
925 |
926 |
927 |

Pixelate

928 |
929 |
930 |
931 |
pixelate( $blocksize [, $advanced=true ] )
932 |
933 |
    934 |
  • $blocksize - int New pixel size
  • 935 |
  • $advanced - boolean (optional) Use advanced method?
  • 936 |
937 |
echo EasyImage::Create($file)->pixelate(10);
938 |
939 |
940 | 941 |
942 |
943 |
944 |

Adjust Smoothness

945 |
946 |
947 |
948 |
adjustSmoothness( $level )
949 |
950 |
    951 |
  • $level - int New smoothness level
  • 952 |
953 |
echo EasyImage::Create($file)->adjustSmoothness(10);
954 |
955 |
956 | 957 |
958 |
959 |
960 |

Color Mask

961 |
962 |
963 |
964 |
colorMask( $MaskHexColor )
965 |
966 |
    967 |
  • $MaskHexColor - string A hex color
  • 968 |
969 |
echo EasyImage::Create($file)->colorMask("#FF000");
970 |
971 |
972 | 973 |
974 |
975 |
976 |

Colorize

977 |
978 |
979 |
980 |
colorize( $hexColor [, $alpha=0 ] )
981 |
982 |
    983 |
  • $hexColor - int Color to tint the image
  • 984 |
  • $alpha - int (optional) Alpha level to use
  • 985 |
986 |
echo EasyImage::Create($file)->colorize("#FF0000");
987 |
988 |
989 | 990 |
991 |
992 |
993 |

Color Fill

994 |
995 |
996 |
997 |
colorFill( $startx, $starty, $hexColor )
998 |
999 |
    1000 |
  • $startx - int Starting x ordinate
  • 1001 |
  • $starty - int Starting y ordinate
  • 1002 |
  • $hexColor - string Hex color string to remove
  • 1003 |
1004 |
echo EasyImage::Create($file)->colorFill(0, 0, "#FF0000");
1005 |
1006 |
1007 | 1008 |
1009 |
1010 |
1011 |

Merge Images

1012 |
1013 |
1014 |
1015 |
mergeImages( $src [, $dst_x=0 [, $dst_y=0 [, $src_x=0 [, $src_y=0 [, $src_w=null [, $src_h=null [, $pct=50 ] ] ] ] ] ] ] )
1016 |
1017 |
    1018 |
  • $src - mixed An Image file, base64 image string, or EasyImage object
  • 1019 |
  • $dst_x - int (optional) Destination x position
  • 1020 |
  • $dst_y - int (optional) Destination y position
  • 1021 |
  • $src_x - int (optional) Source x position
  • 1022 |
  • $src_y - int (optional) Source y position
  • 1023 |
  • $src_w - int (optional) Source width; will use full width if null
  • 1024 |
  • $src_h - int (optional) Source height; will use full height if null
  • 1025 |
  • $pct - int (optional) Percent of image to show thru
  • 1026 |
1027 |
echo EasyImage::Create($file)->mergeImages("myImage.psd");
1028 |
1029 |
1030 | 1031 |
1032 |
1033 |
1034 |

Flip Image

1035 |
1036 |
1037 |
1038 |
flip( [ $mode=EasyImage::HORIZ ] )
1039 |
1040 |
    1041 |
  • 1042 | $mode - string (optional) Image flip method 1043 | 1051 |
  • 1052 |
1053 |
echo EasyImage::Create($file)->flip();
1054 |
1055 |
1056 | 1057 |
1058 |
1059 |
1060 |

Convert Image Type

1061 |
1062 |
1063 |
1064 |
convertTo( $type )
1065 |
1066 |
    1067 |
  • 1068 | $type - string New image mime type 1069 | 1078 |
  • 1079 |
1080 |
echo EasyImage::Create($file)->convertTo(EasyImage::PDF);
1081 |
1082 |
1083 | 1084 |
1085 |
1086 |
1087 |

Concatenate Images

1088 |
1089 |
1090 |
1091 |
concat( $image [, $inline=EasyImage::HORIZ ] )
1092 |
1093 |
    1094 |
  • $image - mixed New image file, url, base64 string, or EasyImage object
  • 1095 |
  • 1096 | $inline - string Concat position 1097 | 1104 |
  • 1105 |
1106 |
echo EasyImage::Create($file)->concat($newImage);
1107 |
1108 |
1109 | 1110 |
1111 |

Getters

1112 |

The class exposes several methods that allow you to get information about the image.

1113 | 1114 |
1115 |
1116 |
1117 |

Get Colors in the Image

1118 |
1119 |
1120 |
1121 |
getColors( [ $hex=false ] )
1122 |
1123 |
    1124 |
  • $hex - bool If true, will return hex colors instead of GRB arrays
  • 1125 |
1126 |

Returns: An array containing all unique colors in the image. If the EasyImage object is an animated GIF, will return an array of arrays for each layer.

1127 |
$colors = EasyImage::Create($file)->getColors();
1128 |
1129 |
1130 | 1131 |
1132 |
1133 |
1134 |

Get GD Image Resource

1135 |
1136 |
1137 |
1138 |
getImageResource( )
1139 |
1140 |

Returns: The GD image resource for the current EasyImage object. If it's an animated GIF, it will return an array containing the GD resource for each layer of the GIF.

1141 |
$im = EasyImage::Create($file)->getImageResource();
1142 |
1143 |
1144 | 1145 |
1146 |
1147 |
1148 |

Get a color that doesn't exist in the image

1149 |
1150 |
1151 |
1152 |
getUniqueColor( [ $omitColors=array() ] )
1153 |
1154 |
    1155 |
  • $omitColors - array (optional) array of rgb colors to omit
  • 1156 |
1157 |

Returns: A color that does not exist in the current image, or false if it's an animated GIF.

1158 |
$color = EasyImage::Create($file)->getUniqueColor();
1159 |
1160 |
1161 | 1162 |
1163 |
1164 |
1165 |

Get Offsets after being auto-cropped

1166 |
1167 |
1168 |
1169 |
getOffsets( )
1170 |
1171 |

Returns: If the current image was autoCrop()'ed, it will return an array containing the offsets of the crop. If it's an animated GIF it will return an array for each layer/frame.

1172 |
$offsets = EasyImage::Create($file)->getOffsets();
1173 |
1174 |
1175 | 1176 |
1177 |
1178 |
1179 |

Get Original Filepath

1180 |
1181 |
1182 |
1183 |
getFilepath( )
1184 |
1185 |

Returns: Returns the filepath for the original image used to create the current EasyImage object. This may or may not be a temporary file. If it's an animated GIF, will return an array with the filepath foe each layer.

1186 |
$path = EasyImage::Create($file)->getFilepath();
1187 |
1188 |
1189 | 1190 |
1191 |
1192 |
1193 |

Get Image Width

1194 |
1195 |
1196 |
1197 |
getWidth( )
1198 |
1199 |

Returns: The width of the current image.

1200 |
$width = EasyImage::Create($file)->getWidth();
1201 |
1202 |
1203 | 1204 |
1205 |
1206 |
1207 |

Get Image Height

1208 |
1209 |
1210 |
1211 |
getHeight( )
1212 |
1213 |

Returns: The height of the current image.

1214 |
$height = EasyImage::Create($file)->getHeight();
1215 |
1216 |
1217 | 1218 |
1219 |
1220 |
1221 |

Get Image Mime Type

1222 |
1223 |
1224 |
1225 |
getMimeType( )
1226 |
1227 |

Returns: The mime type of the current image.

1228 |
$type = EasyImage::Create($file)->getMimeType();
1229 |
1230 |
1231 | 1232 |
1233 |
1234 |
1235 |

Get Orientation

1236 |
1237 |
1238 |
1239 |
getOrientation( )
1240 |
1241 |

Returns: Either the string "portrait" or "landscape".

1242 |
$orientation = EasyImage::Create($file)->getOrientation();
1243 |
1244 |
1245 | 1246 |
1247 |
1248 |
1249 |

Get Pixel Color Index

1250 |
1251 |
1252 |
1253 |
getPixelColorIndex( $x, $y )
1254 |
1255 |
    1256 |
  • $x - int X position of pixel
  • 1257 |
  • $y - int y position of pixel
  • 1258 |
1259 |

Returns: The color index of a color at the given coordinates, or an array containing the color at that index of each frame of the GIF.

1260 |
$color = EasyImage::Create($file)->getPixelColorIndex();
1261 |
1262 |
1263 | 1264 |
1265 |
1266 |
1267 |

Get Pixel Color FROM Index

1268 |
1269 |
1270 |
1271 |
getColorsFromIndex( $index )
1272 |
1273 |
    1274 |
  • $index - int Color index of the image
  • 1275 |
1276 |

Returns: The pixel color for a given color index.

1277 |
$color = EasyImage::Create($file)->getColorsFromIndex($index);
1278 |
1279 |
1280 | 1281 |
1282 |
1283 |
1284 |

Get Pixel RGBA Colors

1285 |
1286 |
1287 |
1288 |
getPixelRGBA( $x, $y )
1289 |
1290 |
    1291 |
  • $x - int The x position of the pixel
  • 1292 |
  • $y - int The y position of the pixel
  • 1293 |
1294 |

Returns: The GRBA color values of a given pixel.

1295 |
$color = EasyImage::Create($file)->getPixelRGBA(0, 0);
1296 |
1297 |
1298 | 1299 |
1300 |
1301 |
1302 |

Get Pixel HEX Color

1303 |
1304 |
1305 |
1306 |
getPixelHexColor( $x, $y )
1307 |
1308 |
    1309 |
  • $x - int The x position of the pixel
  • 1310 |
  • $y - int The y position of the pixel
  • 1311 |
1312 |

Returns: The HEX color values of a given pixel.

1313 |
$color = EasyImage::Create($file)->getPixelHexColor(0, 0);
1314 |
1315 |
1316 | 1317 |
1318 |
1319 |
1320 |

Get Layers of an animated GIF

1321 |
1322 |
1323 |
1324 |
getGifSources( )
1325 |
1326 |

Returns: An array of EasyImage objects for each layer of an animated GIF.

1327 |
$Layers = EasyImage::Create($AnimatedGIF)->getGifSources();
1328 |
1329 |
1330 | 1331 |
1332 |
1333 |
1334 |

Get a Base 64 encoded string of the image

1335 |
1336 |
1337 |
1338 |
getBase64( [ $output_mimetype=null ] )
1339 |
1340 |
    1341 |
  • 1342 | $output_mimetype - int (optional) Type of image to encode to; Defaults to the inputted image's mimetype 1343 | 1352 |
  • 1353 |
1354 |

Returns: The base 64 data URL of the image.

1355 |
$color = EasyImage::Create($file)->getBase64();
1356 |
1357 |
1358 | 1359 |
1360 |
1361 |
1362 |

Get Raw Image Data

1363 |
1364 |
1365 |
1366 |
getString( [ $output_mimetype=null ] )
1367 |
1368 |
    1369 |
  • 1370 | $output_mimetype - int (optional) Type of image to encode to; Defaults to the inputted image's mimetype 1371 | 1380 |
  • 1381 |
1382 |
$color = EasyImage::Create($file)->getString();
1383 |
1384 |

Returns: The image as a string.

1385 |
1386 | 1387 |
1388 |
1389 |
1390 |

Get a Copy of the Object

1391 |
1392 |
1393 |
1394 |
getCopy( )
1395 |
1396 |
$color = EasyImage::Create($file)->getCopy();
1397 |
1398 |

Returns: A copy of the current EasyImage object.

1399 |
1400 | 1401 |
1402 |

Utilities

1403 |

EasyImage provides some helper methods and utilities.

1404 | 1405 |
1406 |
1407 |
1408 |

Compare Two Colors

1409 |
1410 |
1411 |
1412 |
compareColors( $color1, $color2 )
1413 |
1414 |
    1415 |
  • $color1 - mixed A hex color or RGB color array
  • 1416 |
  • $color2 - mixed A hex color or RGB color array
  • 1417 |
1418 |

Returns: true if the two colors are the same, false else.

1419 |
$sameColor = EasyImage::compareColors("#FFF", array(255, 255, 255));
1420 |
1421 |
1422 | 1423 |
1424 |
1425 |
1426 |

Compare Two Colors' Luma

1427 |
1428 |
1429 |
1430 |
compareLuma( $color1, $color2 )
1431 |
1432 |
    1433 |
  • $color1 - mixed An RGB color array
  • 1434 |
  • $color2 - mixed An RGB color array
  • 1435 |
1436 |

Returns: 1 if the first color has a greater luma value than the second, else -1.

1437 |
$brighterColor = EasyImage::compareLuma("#FFF", "#FF0);
1438 |
1439 |
1440 | 1441 |
1442 |
1443 |
1444 |

Sort Colors by Luma

1445 |
1446 |
1447 |
1448 |
colorSortLuma( $colors )
1449 |
1450 |
    1451 |
  • $colors - array An array of RGB color arrays
  • 1452 |
1453 |

Returns: An array of colors, sorted by luma value.

1454 |
$colors = EasyImage::colorSortLuma($colors);
1455 |
1456 |
1457 | 1458 |
1459 |
1460 |
1461 |

Check if an image is an animated gif

1462 |
1463 |
1464 |
1465 |
isAnimatedGif( $file )
1466 |
1467 |
    1468 |
  • $file - string A file path to an image
  • 1469 |
1470 |

Returns: True if the image is an animated GIF, else false.

1471 |
echo EasyImage::isAnimatedGif($file) ? 
"Hoorah, animation!" :
"Boo, no animation." ;
1472 |
1473 |
1474 | 1475 |
1476 |
1477 |
1478 |

Sort Colors by Dominance

1479 |
1480 |
1481 |
1482 |
colorSort( $colors )
1483 |
1484 |
    1485 |
  • $colors - array An array of RGB color arrays
  • 1486 |
1487 |

Returns: An array of colors, sorted by color dominance value.

1488 |
$colors = EasyImage::colorSort($colors);
1489 |
1490 |
1491 | 1492 |
1493 |
1494 |
1495 |

Get Color Distance

1496 |
1497 |
1498 |
1499 |
getColorDistance( $color1, $color2 )
1500 |
1501 |
    1502 |
  • $color1 - array An array of RGB color arrays
  • 1503 |
  • $color2 - array An array of RGB color arrays
  • 1504 |
1505 |

Returns: Get the distance between any two given colors.

1506 |
$distance = EasyImage::getColorDistance($color1, $color2);
1507 |
1508 |
1509 | 1510 |
1511 |
1512 |
1513 |

Convert RGB to HEX Color

1514 |
1515 |
1516 |
1517 |
RGBToHex( $color )
1518 |
1519 |
    1520 |
  • $color - array An array of RGB colors
  • 1521 |
1522 |

Returns: The hex color string for the given RGB color array.

1523 |
$distance = EasyImage::RGBToHex($color);
1524 |
1525 |
1526 | 1527 |
1528 |
1529 |
1530 |

Convert HEX to RGB Colors

1531 |
1532 |
1533 |
1534 |
hexToRGB( $color )
1535 |
1536 |
    1537 |
  • $color - string A HEX color string
  • 1538 |
1539 |

Returns: The RGB color array for the given hex color string.

1540 |
$distance = EasyImage::hexToRGB($color);
1541 |
1542 |
1543 | 1544 |
1545 |
1546 |
1547 |

Get Colors in Gradient

1548 |
1549 |
1550 |
1551 |
gradientColors( $color1, $color2 [, $ColorSteps=10 ] )
1552 |
1553 |
    1554 |
  • $color1 - array Array of hex colors in gradient
  • 1555 |
  • $ColorSteps - int (optional) How many colors to return
  • 1556 |
1557 |

Returns: An array of colors in the gradient.

1558 |
$colors = EasyImage::gradientColors($color1, $color2);
1559 |
1560 |
1561 | 1562 |
1563 |

Output

1564 |

EasyImage provides several built-in methods for outputting the image.

1565 | 1566 |
1567 |
1568 |
1569 |

Output to Browser

1570 |
1571 |
1572 |

This is the most common type of output, and the easiest to use. To send the Image to the browser, simply echo or print it.

1573 |
echo EasyImage::Create($file);
1574 |
1575 |
1576 | 1577 |
1578 |
1579 |
1580 |

Save Image to the Server

1581 |
1582 |
1583 |
1584 |
save( $filename )
1585 |
1586 |
    1587 |
  • $filename - string filename to save to
  • 1588 |
1589 |
EasyImage::Create($image)->save("myImage.png");
1590 |
1591 |
1592 | 1593 |
1594 |
1595 |
1596 |

Force Download

1597 |
1598 |
1599 |
1600 |
download( $filename )
1601 |
1602 |
    1603 |
  • $filename - string filename to save as
  • 1604 |
1605 |
EasyImage::Create($image)->download("yourImage.png");
1606 |
1607 |
1608 | 1609 |
1610 |
1611 |
1612 | 1613 | 1614 | 1615 | 1616 | 1617 | -------------------------------------------------------------------------------- /examples/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/.DS_Store -------------------------------------------------------------------------------- /examples/._.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/._.DS_Store -------------------------------------------------------------------------------- /examples/EasyImageLogo/index.php: -------------------------------------------------------------------------------- 1 | $letter"; 30 | $htmlBlack .= "$letter"; 31 | } 32 | 33 | # make a base image and a colored one 34 | $image = EasyImage::Create($htmlBlack, array("font"=>$font))->resize(500, 100); 35 | $colored = EasyImage::Create($htmlColored, array("font"=>$font))->resize(500, 100); 36 | 37 | # drop the black one behind the colored one to make a shadow 38 | $image->addOverlay($colored, 4, 7); 39 | 40 | $text = "v$version"; 41 | $textbg = "v$version"; 42 | $beta = EasyImage::Create($textbg, array("font"=>$font))->resize(150, 25); 43 | $foreground = EasyImage::Create($text, array("font"=>$font))->resize(150, 25); 44 | $beta->addOverlay($foreground, 2, 3); 45 | $x = $image->getWidth() - $beta->getWidth() - 15; 46 | $y = $image->getHeight() - $beta->getHeight() - 6; 47 | $image->addOverlay($beta, $x, $y); 48 | 49 | # make a reflection image 50 | $reflection = 51 | $image->getCopy() 52 | ->flip(EasyImage::VERT) 53 | ->resize(500, 45) 54 | ->makeOpaque(100); 55 | 56 | # glue the reflection to the bottom 57 | $image->concat($reflection, EasyImage::VERT); 58 | 59 | //echo "
"; echo $image->getBase64(); exit;
60 | echo $image;


--------------------------------------------------------------------------------
/examples/EasyImageLogo/resources/outrider.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/EasyImageLogo/resources/outrider.ttf


--------------------------------------------------------------------------------
/examples/HTMLExample/index.php:
--------------------------------------------------------------------------------
 1 |  and 
elements with style parameters, as well as
11 | * Only the following styles are supported 12 | * background-color - Must be hex, ie #FFF, #FF000 - transparent by default 13 | * background-image - a local path or a URL 14 | * font-face - the name of the font, as passed into the $fonts array 15 | * font-size - the font size in pixels 16 | * color - The color of the text, must be in hex 17 | * disply - "block" or "inline" 18 | * width - The width of the text 19 | * opacity - 0-127 20 | * padding - element padding 21 | * nesting tags not supported 22 | */ 23 | 24 | // BG Image must be a full path or a URL 25 | $here = realpath(dirname(__FILE__)); 26 | $BGImage = "$here/resources/background.jpg"; 27 | 28 | // Make some HTML 29 | $html = "This text is not styled."; 30 | $html .= "This text is Styled"; 31 | $html .= "
Divs are block level elements
"; 32 | $html .= "And here's some tiny text"; 33 | $html .= "
This is a really lonfonasdf sodf
"; 34 | 35 | // Array of fonts with the name as the key and the filepath as the value 36 | // Any text that doesn't have a specified font will use the first font in the array 37 | // Must use TTF fonts only 38 | $fonts = array( 39 | "AllerDisplay" => "$here/resources/AllerDisplay.ttf", 40 | "Outrider" => "$here/resources/outrider.ttf" 41 | ); 42 | 43 | // Create the image 44 | echo EasyImage::Create($html, $fonts) 45 | ->removeTransparency(); // give it a white background -------------------------------------------------------------------------------- /examples/HTMLExample/resources/AllerDisplay.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/HTMLExample/resources/AllerDisplay.ttf -------------------------------------------------------------------------------- /examples/HTMLExample/resources/CaviarDreams.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/HTMLExample/resources/CaviarDreams.ttf -------------------------------------------------------------------------------- /examples/HTMLExample/resources/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/HTMLExample/resources/background.jpg -------------------------------------------------------------------------------- /examples/HTMLExample/resources/outrider.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/HTMLExample/resources/outrider.ttf -------------------------------------------------------------------------------- /examples/basicExample/index.php: -------------------------------------------------------------------------------- 1 | autocrop() 17 | ->crop(317, 317) 18 | ->borderRadius(150, "#000000"); -------------------------------------------------------------------------------- /examples/basicExample/resources/cat.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/basicExample/resources/cat.jpeg -------------------------------------------------------------------------------- /examples/concatExample/index.php: -------------------------------------------------------------------------------- 1 | colorize($red); 19 | $blueKitty = EasyImage::Create($kitty2)->colorize($blue); 20 | $greenKitty = EasyImage::Create($kitty2)->colorize($green); 21 | $pinkKitty = EasyImage::Create($kitty2)->colorize($pink); 22 | 23 | // concat the red and blue kittys horizontally for the top row 24 | $top = $redKitty->concat($blueKitty); 25 | 26 | // concat the green and pink kittys horizontally for the bottom row 27 | $bottom = $greenKitty->concat($pinkKitty); 28 | 29 | // concat the top an bottom images vertically for the full image 30 | $full = $top->concat($bottom, EasyImage::VERT); 31 | 32 | // let's put the original on top 33 | $pos = $full->getWidth() / 4; 34 | echo $full->addOverlay($kitty2, $pos, $pos); -------------------------------------------------------------------------------- /examples/concatExample/resources/._kitty1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/concatExample/resources/._kitty1.gif -------------------------------------------------------------------------------- /examples/concatExample/resources/._kitty2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/concatExample/resources/._kitty2.png -------------------------------------------------------------------------------- /examples/concatExample/resources/kitty1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/concatExample/resources/kitty1.gif -------------------------------------------------------------------------------- /examples/concatExample/resources/kitty2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/concatExample/resources/kitty2.png -------------------------------------------------------------------------------- /examples/giftest/index.php: -------------------------------------------------------------------------------- 1 | greyScale(); -------------------------------------------------------------------------------- /examples/giftest/resources/test.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/giftest/resources/test.gif -------------------------------------------------------------------------------- /examples/gradientExample/index.php: -------------------------------------------------------------------------------- 1 | "; 16 | foreach($gradientColors as $clr) echo "
$clr
"; -------------------------------------------------------------------------------- /examples/gradientExample1/index.php: -------------------------------------------------------------------------------- 1 | "; 12 | foreach($gradientColors as $clr) echo "
$clr
"; -------------------------------------------------------------------------------- /examples/gradientExample2/index.php: -------------------------------------------------------------------------------- 1 | removeColor("#FFFFFF"); 13 | echo EasyImage::Create($image->getWidth(), $image->getHeight(), array("#f0f0f0", "#7AA846")) 14 | ->addOverlay($image, 0, 0); -------------------------------------------------------------------------------- /examples/gradientExample2/resources/face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/gradientExample2/resources/face.png -------------------------------------------------------------------------------- /examples/infoExampe/index.php: -------------------------------------------------------------------------------- 1 | getColors(true); 18 | ?> 19 | 20 | Info Example 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
Image Preview
Original FilepathgetFilepath(); ?>
WidthgetWidth(); ?>
HeightgetHeight(); ?>
Mime TypegetMimeType(); ?>
OrientationgetOrientation(); ?>
Colors Used$color "; ?>
52 | 53 | -------------------------------------------------------------------------------- /examples/infoExampe/resources/._apple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/infoExampe/resources/._apple.jpg -------------------------------------------------------------------------------- /examples/infoExampe/resources/apple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/infoExampe/resources/apple.jpg -------------------------------------------------------------------------------- /examples/perspectiveExample/index.php: -------------------------------------------------------------------------------- 1 | perspective(0.22); 13 | $i->removeColor("#000000"); 14 | echo $i; -------------------------------------------------------------------------------- /examples/perspectiveExample/resources/grid.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/perspectiveExample/resources/grid.gif -------------------------------------------------------------------------------- /examples/perspectiveExample/resources/grid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/perspectiveExample/resources/grid.jpg -------------------------------------------------------------------------------- /examples/psdExample/index.php: -------------------------------------------------------------------------------- 1 | getCopy(); 14 | 15 | $new_width = $img1->getWidth() / 2; 16 | $new_height = $img1->getHeight(); 17 | 18 | $img2->crop($new_width, $new_height, $new_width)->reverseColors(); 19 | $img1->crop($new_width, $new_height)->concat($img2); 20 | 21 | echo $img1; -------------------------------------------------------------------------------- /examples/psdExample/resources/angelwings.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/psdExample/resources/angelwings.psd -------------------------------------------------------------------------------- /examples/simpleTextExample/index.php: -------------------------------------------------------------------------------- 1 | crop($width, $height); 33 | } 34 | 35 | if(!empty($rotate)) $img->rotate($rotate); 36 | 37 | echo $img; 38 | -------------------------------------------------------------------------------- /examples/simpleTextExample/resources/OldStreetSigns.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/simpleTextExample/resources/OldStreetSigns.ttf -------------------------------------------------------------------------------- /examples/textAlignExample/index.php: -------------------------------------------------------------------------------- 1 | 29 | 30 | 31 | 32 | Text Align Example 33 | 34 | 35 | " />
36 | 37 | 43 | 44 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /examples/textAlignExample/resources/OldStreetSigns.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pamblam/EasyImage/ad6bb9681349e362e5e985a0015f34f6b647e661/examples/textAlignExample/resources/OldStreetSigns.ttf --------------------------------------------------------------------------------