Hi Mick,

Have you tried this on appspot? There's a known bug in the
dev_appserver whereby it ignores transparency for image.composite, but
it should work fine in production.

-Nick Johnson

On Sat, May 23, 2009 at 7:41 PM, Mick <[email protected]> wrote:
>
> Hello,
>
> I'm trying to create a watermark on an image by using the app engine
> images composite function. However the function doesn't seem to
> respect the transparency in my overlay image, which is just a
> copyright symbol. It fills the transparent area with white so the
> final output looks like this http://bayimg.com/image/eaaagaacb.jpg. I
> have tried all sorts of combinations for opacity and image types but
> nothing seems to work right. Please advise.
>
> [code]
>        def post(self):
>                im = avatar = self.request.get("image")
>                image = images.Image(im)
>
>
>                result = urlfetch.Fetch('http://upload.wikimedia.org/wikipedia/
> commons/5/58/Red_copyright.png')
>                copyright = result.content
>                new_image = images.composite([
>                                                                               
>  (im, 0 ,0, 1.0, images.TOP_LEFT),
>                                                                               
>  (copyright, 0 ,0, 0.5, images.CENTER_CENTER)],
>                                                                               
>  image.width,
>                                                                               
>  image.height,
>                                                                               
>  0,
>                                                                               
>  images.PNG)
>                self.response.headers['Content-Type'] = "image/png"
>                self.response.out.write(new_image)
>
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to