Rotation of Textoverlays in Batch Processor

Started by anmue, January 30, 2014, 08:43:25 PM

Previous topic - Next topic

anmue

Hi,

As I already posted here: https://www.photools.com/community/index.php?topic=1273.msg7560#msg7560, would it be possible to implement a rotation of a text overlay in the batch processor? At least in 90 degree steps?

Regards, Andreas.

Mario

This is doable but complex. IMatch renders text using XAML markup to give you precise control over formatting, font, weight etc. XAML cannot rotate text.
I would have to add a intermediate step which renders the markup into a bitmap, then rotates this bitmap. But since this is a bitmap operation and pixels are rotated, the output may loose some quality compared to the direct vector output of XAML.

For typical cases like studio logos, copyrights or watermarks I suggest preparing an image overlay externally with the required orientation and then using it as an image overlay in the Batch Processor.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

anmue

Hi Mario,

in my case it wouldn't be very efficient to create an image overlay, because it contains the filename of the image as reference. You can also think of any other individual meta data of the image. So I had to create that overlay for every image. The consequence is that I can not get any benefit of the Batch Processor in my use case.

So it would be helpful if Imatch could create that image overlay for me.

Regards Andreas

Mario

#3
If I add the rotate text overlay function, IMatch would naturally create the overlays internally automatically.

But I think I have good news on that because I've found a way. There are some undocumented operations I can use. I'll need to work on this but it should be doable.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

My idea did not work out    

I thought I could use the Rotation transform available in XAML markup to allow users to rotate text in the batch processor (a feature I really liked to have for my own purposes). I got it to work Sunday evening, but unfortunately the implementation in the toolkit I use for XAML is buggy. If a XAML block contains rotated text, the calculation of the size of the block fails - and IMatch needs that info in order to position text blocks in the batch processor. Also, the rotation center cannot be adjusted and this causes the text to rotate "out" of the text box.  Adding a second line to the text broke the text into random parts, spreading all over the text box. And more problems like that. Useless. I gave up after a couple of hours.

Since I was already that far and I had already fixed a number of bugs yesterday, I've implemented my initial idea with a temporary bitmap in which the batch processor renders the markup and then rotates the bitmap before combining it with the background. As usual the details were tricky because the batch processor can do so much, especially in the area of text, with partially transparent backgrounds and text fill colors, alignments, margins, padding etc. Quite a lot of code paths to check and support. Still, I'd like to have all that feature myself because it spares me (and many others) from creating separate watermark images, allows for use of variables etc.

To make a long story short, after ruining my Sunday evening, I now have implemented 90° left and 90° right text rotation. That's it for now. No arbitrary angles, but these are rarely needed anyway.




[attachment deleted by admin]
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook