On Thu, 2004-11-25 at 14:59, Karl Ove Hufthammer wrote:

> The outlines shown when placing a stamp doesn't work as well as
> before (both for unscaled and scaled stamps).

I've noticed.

Rather than fixing it, I think the outline code should
be redone. As noted by a #define option, the current
code is slow. It also screws up on rectangles with
certain (odd? even?) sizes, leaving off one edge. So the
new problem is just one more reason to redo this code.

> And one of the higher scale factors doesn't give very smooth
> edges. You can see it on both the new tyre stamp and the updated
> grapes stamp. The tyre looks round and smooth with one scale
> factor, not with the next, but *with* the one after that one.
> 
> I of course know that doubling and quadrupling the size will get
> better result than arbitrary scaling, but my image program does
> seem to be able to handle the intermediate steps well, while Tux
> Paint does not. Something wrong with SDL's rescaling algorithm?

SDL isn't used for this. The thumbnail generator was modified to
do general stamp resizing. The algorithm is really, really, simple.
It simply grabs a square of pixels from the source, averages them,
and then fills in a square of pixels for the destination.

If linking against libfftw2 is OK, really nice arbitrary scaling
would be easy. (take FFT, truncate or zero-pad, inverse FFT)
Otherwise, maybe something like lanczos3. My notes on this:

---------------
accurate and slow: FFT/Chirp-z
http://www.worldserver.com/turk/computergraphics/ResamplingFilters.pdf
google for: fft image interpolation
http://www.mplayerhq.hu/DOCS/tech/swscaler_methods.txt
http://www.path.unimelb.edu.au/~dersch/interpolator/interpolator.html
lanczos3
---------------


_______________________________________________
Tuxpaint-dev mailing list
[EMAIL PROTECTED]
http://tux4kids.net/mailman/listinfo/tuxpaint-dev

Reply via email to