|
© Efflare Systems website : e-mail |
|
Watermarking is most often used to protect copyrighted images. Watermarking is typically used
on an intermediate sized image, not thumbnails, for convenient previewing of the
protected image. A good watermark fills enough of the image to protect it while remaining subtle.
Our watermark is a png with full alpha transparency. If shown on a white background it looks like the image to the right, otherwise the viewing application decides how to represent the transparency. Internet Explorer represents it with a shade of gray-blue, as you can probably see by viewing watermark.png. Once you have a watermark, the concept is simple »
Load an image...
Load the watermark... Paste the watermark into the image. The following code demonstrates this with our image, zoo.jpg : |
![]() |
|
<cfx_imageflare source="
b = Bitmap( '#expandpath('.\zoo.jpg')#' )
watermark = Bitmap( '#expandpath('.\watermark.png')#' )
b.paste( watermark, b.width/2-watermark.width/2, b.height/2-watermark.height/2, 128, 4 )
b.save( '#expandpath('.\example04a.jpg')#' )
">
<cfx_imageflare source="
b = Bitmap( '#expandpath('.\zoo.jpg')#' )
watermark = Bitmap( '#expandpath('.\watermark.png')#' )
if ( watermark.width/b.width > watermark.height/b.height ) then
watermark.resize( b.width, 0 )
else
watermark.resize( 0, b.height )
end
b.paste( watermark, b.width/2-watermark.width/2, b.height/2-watermark.height/2, 128, 6 )
b.save( '#expandpath('.\example04b.jpg')#' )
">
<cfx_imageflare source="
b = Bitmap( '#expandpath('.\zoo.jpg')#' )
watermark = Bitmap( '#expandpath('.\watermark.png')#' )
if ( watermark.width/b.width > watermark.height/b.height ) then
b.resize( watermark.width, 0 )
else
b.resize( 0, watermark.height )
end
b.paste( watermark, b.width/2-watermark.width/2, b.height/2-watermark.height/2, 128, 4 )
b.save( '#expandpath('.\example04c.jpg')#' )
">