Couldn't you use JAVA to do it instead of CF, I think ImageMagick uses the
underlying Java Image manipulation methods, maybe you could take a look and
see how they do it.

Russ

-----Original Message-----
From: Rick Root [mailto:[EMAIL PROTECTED] 
Sent: 14 December 2006 15:19
To: CF-Talk
Subject: Re: ImageCFC 2.10 Now Available

Andy Matthews wrote:
> Word to your mom Rick! I was hoping you'd get that in there.

The gaussian and box blurs are nearly unusable because of the speed. 
Coldfusion just can't handle doing that much math.

For example, in the gaussian blur.... to do an image of 400x300, you're
dealing with 120,000 pixels.  If your radius is 5, then you're grabbing the
RGB values of the nearest 5 pixels and applying a normal distribution to
compute the new RGB value of the center pixel.  so that's 600,000
iterations.

And then you have to do it again for the vertical pass.

1.2 million iterations ...

I just did some performance testing and I've discovered that doing my RGB
separation calcs in a UDF is a *BAD* idea.

I just modified the gaussianFilter.cfc to *NOT* use the separateRGB() udf
and cut the processing time for an image from 96 to 77 seconds. 
It's still ridiculously slow, but that's still a 20% performance
improvement.  I guess there's a little overheard hitting a UDF 1.2 million
times.

I'm going to update the box blur too... and maybe also develop an object
oriented interface to imagecfc

<cfscript>
objImage = createObject("component","imageObject");
objImage.init("C:\Inetpub\wwwroot\myimage.gif");
objImage.resize(400,300);
objImage.addText(fontDetails,"Sample Text"); objImage.save(compression=95);
objImage.saveAs(filename="C:\Inetpub\wwwroot\myimage.gif",compression=95);
<cfscript>

I think it might simplify use... but I don't want to mess with the main CFC.

Sure would be nice if Coldfusion allowed multiple methods with the same name
and different argument types, like java does...

ooImage.init(filename); // initialize from a file ooImage.init(400,300); //
initialize a blank image ooImage.init(bufferedImage); //initialize with a
bufferedImage object

Rick



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264053
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to