This post is more than 2 years old.
I was playing with image rotation last night (I know, call me Mr. Excitement), and I found an interesting issue. Consider this code:
<cfset attr=StructNew()> <cfset attr.size=30> <cfset attr.style="bold"> <cfset attr.font="ArialMT">
<cfset ImageSetAntialiasing(textImage, "on")> <cfset ImageDrawText(textImage,"Paris",50,75,attr)>
<cfimage action="writeToBrowser" source="#textImage#">
I create a new blank image and then draw some black text and then rotate. I end up with this:
Notice the black background? I tried to fix it by using this for my image:
But it had no impact. Luckily I got some help from Adobe (thank you Hemant!) and he mentioned that if I switch my image type to ARGB instead of RGB, it will work. With that, I got this:
Not bad - but a bit ugly. The imageRotate function takes a 5th argument: interpolation. This basically sets the quality of the rotation. Adobe defaulted to the quickest method, "nearest." Switching to the highest, "bicubic", makes a real pretty rotation, but the leaves some "crud" on the sides:
Of course, I could crop that easily enough, but, still, a bit of a problem. The middle ground interpolation, bilinear, also leaves the same.