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)
- $overlay (wiImage): the overlay (watermark) image to merge on the base image.
- For alpha-transparent overlays, you should use $pct=100 (default) in order to have the desired effect.
$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)
- $baseImage (wiImage): the image to merge onto.
- For alpha-transparent images, you should use $pct=100 in order to have the desired effect.
$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
- $baseImage (wiImage): the image to merge onto.
- $x (int, string): x destination coordinate. Can be an integer or a percent string.
- $y (int, string): y destination coordinate. Can be an integer or a percent string.
- $pct (int) opacity (0..100)
- result (wiTrueColorImage): merged image
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
- For alpha-transparent images, you should use $pct=100 in order to have the desired effect.
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