ImageZ
Fixed up a few issues with using non-pre-multiplied alpha, but only for normal blending mode - I know all the other blending modes are still doing it wrong.Actually I can't really remember where I was at last time and how much i've done since then, it's all blurring into one long indistinct memory.
But I did work on what i've been calling a 'super affine tool'. It combines the various affine operations into a single tool in a way that should still be accessible.
A scaled, rotated and translated cat
I've been thinking about this for quite a while but finally sat down to nut it out. When you bring up the tool the following controls pop up in the middle of the image:
- Centre Disc
- This is the location of the image relative to the centre of the image. i.e. a simple translate.
- Inner Ring
- Sets the location of the rotation centre point on the source image.
- The two Parallelograms
- Adjust the shear in X or Y. The shapes move as you drag them in proportion to the shear amount.
- The two Rectangles
- Adjust the scaling in X or Y. The shapes scale as you drag the mouse in proportion to the scaling amount.
- Outer Ring
- Adjusts the rotation angle. Yes it probably needs some sort of indicator, although the moving image gives you that.
I'm still tweaking the affine transform matrix it produces to make it behave nicely. It applies the rotation, then the shear, scale and finally offset. This makes it behave mostly how you'd expect it to, although in some cases you'd have to run it multiple times to get exactly what you wanted. And it doesn't work properly if the view is zoomed ... and you can't actually commit the operation yet.
Damnation in hell Java is fast at this though - it must be accelerating it using the graphics card. I'm even using linear interpolation with alpha blending for the real-time preview and it's really nice and quick - at least when using one of the native layer types. Even a full-resolution image from my digital camera at 4288x2848 is flinging around at ~15-20fps.
I'm not entirely happy with the tool options on the left - there's a lot of numbers and spin buttons - but I guess it's not completely out of the question.
Actually I was also looking at putting tool options there which is why it's shown up there in the first place. But i'm not sure about that yet - if I do that then most tool options will really need to be per-image otherwise the behaviour will be a little odd. I'm not sure if this is desirable. For example if you set the tool to 'pen' you might reasonably expect it to be 'pen' on another window. Or maybe you might not - it probably doesn't matter either way.
No comments:
Post a Comment