![]() it doesn't worked out at all here (why? T_T). I' had to "per-pixel alpha blend" an image into a solid background, as seen on the very concise example from "barnabas at kendall dot NOSPAM dot net": an alpha blended. To solve this use the following function: If it is set to false, only the transparency of the second image is respected, causing no parts of the first image to be shown. If imagealphablending os set to true and you want to merge two images, you are left with no transparency. You could go on and extract some of the values as parameters (80 is the transparency start value, $height / 2 is the reflection area.). Imagesetpixel ( $reflected, $x, $src_height + $y - 1, $rgba ) ![]() $rgba = imagecolorallocatealpha ( $reflected, $rgba, $rgba, $rgba, $alpha ) ![]() $rgba = imagecolorsforindex ( $src_img, $rgba ) $alpha = max ( $alpha, 47 + ( $y * $alpha_step )) I have not performance-tested this with large image files, for thumbnails it works fine (requires PHP 4.3.2 or above, or PHP5). I have written a function that takes an image as parameter and returns the same image with a reflection effect (often seen in WEB 2.0 sites). Imagesetpixel($destImg, $x, $y, $dstRGB) $dstRGB = imagecolorallocatealpha($destImg, $dstR, $dstG, $dstB, 0) Reduced processing time from ~0.17s to ~0.06s on 216x145px images.įunction alphaOverlay($destImg, $overlayImg, $imgW, $imgH) I rewrote the code given below to skip calculations and pixel setting when not needed (full opaque or full transparent pixels), as the content of my overlays is generally mostly transparent. Watermark can be png, with transparency, and the watermark can be placed anywhere on the image, using simple strings such as 'bottom-left', or 'center'. I have create a little function for putting a watermark on any picture. ![]() $c = imagecolorallocatealpha($s,$c,$c,$c,$t) To solve this use the following function:"ĭscharrer at gmail dot com offered this without a use example, so here is one: "If imagealphablending os set to true and you want to merge two images, you are left with no transparency. Finally, I have created the script by myself. I have been looking around for a while to find a script which does the following: generates image with text using specified font with given color, but with totally transparent background (by alpha-channnel, not via color transparency). Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Supported Protocols and Wrappers Security Introduction General considerations Installed as CGI binary Installed as an Apache module Session Security Filesystem Security Database Security Error Reporting User Submitted Data Hiding PHP Keeping Current Features HTTP authentication with PHP Cookies Sessions Dealing with XForms Handling file uploads Using remote files Connection handling Persistent Database Connections Command line usage Garbage Collection DTrace Dynamic Tracing Function Reference Affecting PHP's Behaviour Audio Formats Manipulation Authentication Services Command Line Specific Extensions Compression and Archive Extensions Cryptography Extensions Database Extensions Date and Time Related Extensions File System Related Extensions Human Language and Character Encoding Support Image Processing and Generation Mail Related Extensions Mathematical Extensions Non-Text MIME Output Process Control Extensions Other Basic Extensions Other Services Search Engine Extensions Server Specific Extensions Session Extensions Text Processing Variable and Type Related Extensions Web Services Windows Only Extensions XML Manipulation GUI Extensions Keyboard Shortcuts ? This help j Next menu item k Previous menu item g p Previous man page g n Next man page G Scroll to bottom g g Scroll to top g h Goto homepage g s Goto search
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |