WideImage 1.0 branch (discontinued)

WideImage Wiki : opMerge

MainPage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Support This Project SourceForge.net Logo
Important notice: the development of WideImage 1.0 branch is discontinued. Please visit http://wideimage.sourceforge.net for the new version of library and documentation.
This web site will remain accessible to serve as documentation for the old versions of the library. For help on migration, please refer to the migration guide.
Most recent edit on 2007-07-01 15:30:30 by GasperKozak [extended notes]

Additions:
~- For alpha-transparent overlays, you should use $pct=100 (default) in order to have the desired effect. The alpha channel is used as the opacity for any given pixel. You can't combine alpha channel with merge opacity.

Deletions:
~- For alpha-transparent overlays, you should use $pct=100 (default) in order to have the desired effect.



Edited on 2007-03-04 07:21:18 by GasperKozak

Additions:
$new = $picture->merge($overlay, '50%', '25%', 40);

Deletions:
$picture->merge($overlay, '50%', '25%', 40);



Edited on 2007-03-04 07:20:58 by GasperKozak

Additions:
This will merge (blend) the overlay image onto the base image at location ($x, $y) with $pct opacity using imagecopymerge().

Deletions:
This will merge (blend) the image onto the $baseImage at location ($x, $y) with $pct opacity using imagecopymerge().



Edited on 2007-03-04 07:20:22 by GasperKozak

Additions:
wiImage::merge($overlay, $x = 0, $y = 0, $pct = 100)
$result = $picture->merge($overlay, 10, 10, 50);
$picture->merge($alpha_overlay, 10, 10)->saveToFile(...);
$picture->merge($overlay, '50%', '25%', 40);


Deletions:
wiImage::merge($baseImage, $x = 0, $y = 0, $pct = 100)
$result = $overlay->merge($picture, 10, 10, 50);
$alpha_overlay->merge($picture, 10, 10)->saveToFile(...);
$overlay->merge($picture, '50%', '25%', 40);




Edited on 2007-03-03 11:51:31 by GasperKozak

Additions:
~- For $pct=0, the method will return a true-color copy of $baseImage. For $pct=100, it will use imagecopy().

Deletions:

Special cases

For $pct=0, it will return a true-color copy of $baseImage. For $pct=100, it will use imagecopy().




Oldest known version of this page was edited on 2007-03-03 11:50:52 by GasperKozak []
Page view:

wiImage::merge()

See: List of operations

Signature

wiImage::merge($baseImage, $x = 0, $y = 0, $pct = 100)

Parameters



Description

This will merge (blend) the image onto the $baseImage at location ($x, $y) with $pct opacity using imagecopymerge().

Special cases

For $pct=0, it will return a true-color copy of $baseImage. For $pct=100, it will use imagecopy().

Notes


Examples

$overlay = wiImage::load('/path/to/watermark.png');
$picture = wiImage::load('/path/to/another/image.png');
$result = $overlay->merge($picture, 10, 10, 50);

// or with an image that has alpha channel
$alpha_overlay = wiImage::load('/path/to/alpha/overlay.png');
$alpha_overlay->merge($picture, 10, 10)->saveToFile(...);

// with percent string
$overlay->merge($picture, '50%', '25%', 40);



CategoryDocApi
WideImage - an Object-Oriented PHP Image Library for Image manipulation
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.0858 seconds