Explaining the Scratch Off algorithm of the Hatching brush

JL VT pentalis at gmail.com
Sat Jun 19 18:22:14 CEST 2010

LukasT wrote:

> > Now, with respect to "boring, very regular" hatching, the current
> algorithm
> > (described in the GUI as trigonometry-algebra) has the problem that lines
> > thicken in incremental mode (opaque background off) and look jagged in
> wash
> > (opaque background on). Part of the jagging comes from the fact that the
> > tips in the borders of the lines look different than the inner parts, so
> > cutting those borders would help; that would have the extra benefit of
> > reducing thickening in incremental mode. But even so, the lines get
> > inherently out of sync when drawn little-chunk by little-chunk instead of
> > all at a time; I am sure that it is due to the rasterization step,
> because
> > I did the algebra carefully, and floating-point calculations aren't THAT
> > imprecise to cause such errors to arise (or are they?).
> You might revisit the rasterization code. Maybe try to write some debug
> code
> and see how is our rasterization code behaving and fix the problem, if you
> are
> able. I spent some time on rasterization when I was working on GSoC 2008,
> there were problems with lines so I left the code as it was.

I'll try to read that and see if I can do something.
I'm a bit intimidated by touching the existing codebase, as I think I may
break something.
I'm also very slow reading code, as I need to familiarize with many things I
don't know, though I'm getting faster.

> > I believe the "no jagging and less thickening" benefit is remarkable, it
> > would make the hatching generated look almost as clean if it were made by
> a
> > filter, but it would be generated in real time and directly on the canvas
> > by the user, instead of requiring the user to mount an elaborate set of
> > layers and apply filters on it to get his final result (besides, the
> > GIMP's Newsprint filter isn't too versatile with the hatching, so it
> would
> > take the user many iterations and therefore a great deal of time to
> > achieve areas with different thickness or with crosshatching, using that
> > filter).
> > Endnote: with respect to Incremental and Wash: the dialogue the UI offers
> > for choosing between incremental and wash mode has different effects than
> > what I envisioned as the "opaque background" option, that's why I want
> both
> > to coexist. When I link the BrushTip dialogue I'll make a proof of
> concept.
> Would you document all those options you have in your paintop in the wiki?
> E.g. I did preliminary docs for spray [1] long time ago (older then
> Internet),
> it's not up-to-date, but you have inspiration.
> [1] http://wiki.koffice.org/index.php?title=Paintops/Spray_brush
> No problem, I will.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20100619/e3fbd11e/attachment.htm 

More information about the kimageshop mailing list