Change image size & transform tool
Casper Boemann
cbr at boemann.dk
Thu Jun 23 10:43:18 CEST 2005
On Thursday 23 June 2005 07:45, Michael Thaler wrote:
> I had a brief look at Caspers code and it looks very clean. However, from
> what I have seen, I don't think it implements the Mitchell algorithm
> correctly.
Well it doesn't do filtering yet, so you are kind of right.
But I think mine does implement 2-pass scaling and yours does not.
Mine takes (m+n)*x*y step (when filtering is done)
I think (have not checked 100% though) that yours take m*n*x*y
I would like to know if you agree that that's the case, or if I'm just
misreading your code (havn't looked that carefully)
Anyway mine is prepared for doing scale, shear, translate and rotate in one
go, making it a lot faster in those cases.
Hower that means that no precalulation is possible
> I think the transform tool should use the Mitchell algorithm,
> but if you compare the results with the results from "Change Image
> size...", the results from "Change Image size..." are much better.
Indeed yours looks better at the moment. As I said no filtering is done in
mine.
> Casper,
> since you have written that code, what are your thoughts about this?
> What should we do about it? Should I try to rewrite my old code and make it
> use iterators? I hope that would speed up the code a lot,
I would actually like it better if you would help implementing filtering code
in the transform visitor instead.
The first step would be to make the filter classes work on integers (actually
fixed point of some sort). That would speed up a lot I think, and could
benefit us both. Please use the filter classes in transform visitor as I've
improved them slightly (shorter names and support() method)
The next step (please commit before) would be to acually use it, and feel free
to do that as well:
- Only filter in x direction when doing x scaling (and y for y).
- No precalculation of weights as that would not work with shearing.
- Superimpose weights derived from shearing when filtering.
- Use the colorstrategy function to mix colors.
- Do all math in integers.
With all those things to consider we should at least email and exchange ideas
before too much coding is done. Perhabs we could take this in smaller steps,
to make it more managable and ensure that we have the same goal.
I would really appreciate it if you would help out.
--
best regards / venlig hilsen
Casper Boemann
More information about the kimageshop
mailing list