Active
Project:
ImageAPI
Version:
6.x-1.x-dev
Component:
ImageAPI GD
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2008 at 12:12 UTC
Updated:
4 Apr 2009 at 00:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
dopry commentedI would love to see layering primitives appear in ImageAPI. Add Layer / Merge Layers... Layers can also have properties such as stack depth, blend mode, which would be bonus, but not necessary. I'd much prefer to continue the development of ImageAPI by implementing more primitives so aggregate functions can be more easily built.
Comment #3
dman commentedFWIW, I've found the GD imagecopy function to be inadequate (broken) when merging alpha transparency, which is a useful requirement when thinking about watermarks.
Over in imagecache_actions are two implementations of an imageapi_gd_image_overlay() function that have been working pretty well in practice for the last year - but I'd appreciate any code review of it before nominating it for inclusion in imageapi.module - which is where it really deserves to live.
(there are two - one built-in, one algorithmic - to compensate for GD alpha problems)
The code
The watermark.inc algorithm
Comment #4
drewish commenteddman, bump / how about taking a look and seeing how this would fit into the current version of ImageAPI.
Comment #5
markDrupal commentedThis is definitely something I would like to see in Image API. I already have a hack in my code, but this looks better.
Comment #6
markDrupal commentedHere is a patch against image api 1.5. I also stopped the image from being destroyed if you pass an image. If you pass a file name the image will be destroyed.
BUT (That is a big but) my image creation time jumped 1000% when using this overlay. It went from 1 second pageload to 10 second page load. And didn't actually fix anything for me.
I won't be using this patch and I'll go back to:
imagecopy
imagecopymerge
Comment #7
markDrupal commentedhere is a better patch, Fixed the file path
Comment #8
dman commentedI did warn you in the comments! :-)
Seeing as it is imagecache and I needed proper transparency, I could live with it, but would love if someone could find the right way to blend transparent image + transparent image at % alpha using the built-ins.
I just kept getting jaggies and black lumps when I tried.
FWIW, the current generation of imagecache_actions has added a few small tweaks to that routine to try and support gifs and conflicts between background & forground size. May need a complete rewrite though.