[cairo] Mac Tiger Core Image

Bill Spitzak spitzak at d2.com
Thu Mar 10 12:27:30 PST 2005



mental at rydia.net wrote:
> Quoting Bill Spitzak <spitzak at d2.com>:

>>In my opinion we only need the ability to turn off antialiasing
>>for individual straight lineto's, perhaps with a new
>>aliased-lineto call.
> 
> That is useful for some purposes like the ones you outline, though
> it seems a little odd API-wise.  I guess I'm ambivalent on it as I
> don't require it myself.

I believe this is the *only* way to fix the "antialiasing artifacts" you 
mentioned earlier while still allowing antialiasing around the outer 
boundary of the drawn object. Some triangles are going to be on the edge 
yet connect to interior triangles, they need this combined behavior.

>>Unlike several other posters, I do NOT think we want to be able
>>to turn off antialiasing for anything else, such as stroke,
>>letters, or curved portions of paths.
> 
> You might not need it.  I do.  My users (not to mention myself) need
> a renderer that can optionally produce high-resolution output
> without any antialiasing artifacts.

Any device where the resolution is higher than the spread of the 
individual pixels (ie any printer at 1000 dpi or higher) is not going to 
need antialiasing, so it should be turned off. But antialiasing would be 
done by the back end, so they can be written to not do it, this does not 
mean there should be a control to turn it on/off.

All the artifacts you listed reduce to being able to alias the straight 
edges of filled polygons, and only ones that adjoin adjacent polygons, 
so that drawing the adjoining polygons does not produce any partially or 
over-filled pixels.

Aliased diagonal strokes do *not* join without artifacts, all 
algorithims that produce strokes that look constant thickness will 
produce overlapping pixels and/or gaps when drawn parallel and the 
stroke thickness away from each other. Aliased diagonal line strokes 
will also not hide either aliased or antialiased edges of polygons 
unless they are thick enough that antialiased ones would work just as 
well. Therefore I do not believe turning off aliasing for strokes solves 
anything so I don't think it should be supported.

All other requests for aliasing I believe are actually "please draw 
really thin lines nicer". In fact you can draw much *better* thin lines 
if you allow antialiasing on diagonal ones. I don't want to see programs 
turning off antialiasing because some other broken graphic api's have 
made them think that is the only way to get thin lines, and for that 
reason I really *don't* want to see a turn-off-antialiasing interface, 
so they are forced to find another solution. (however Cairo MUST provide 
this solution, in the form of zero-width lines or something).

I also do not want to see any api where textures are not sampled with a 
filter. Some graphics apis "turn off antialiasing" also point-samples 
the textures. If we think emulation of something stupid Microsoft did is 
important this will blow up by requiring emulation of this and many 
other quirks.

>>*discussion of what is essentially a primitive hinting/grid
>>alignment approach snipped*
> 
> I don't think the ideas are bad necessarily, but it seems to me that
> the specific suggestion tries to address them at the wrong level of
> the API.

Yes, Carl pointed out that an interface to get the CTM and set it would 
do the job equally well, and would allow all variations on rounding the 
grid to be done by the program.

> It seems like the sort of thing that a backend should do internally
> in response to some sort of "rendering disposition" call that
> requests optimization of legibility.
> 
> c.f. SVG's optimizeSpeed, optimizeLegibility, and optimizeGeometry

I do not like this, as it makes too many assumptions about 
implementations. If one of these actually turns off antialiasing, then 
people will complain if future implementations do not turn off 
antialiasing. So the abstraction just will not happen, people will just 
say "to turn off antialiasing do this".

Again, I belive about 95% of the people asking for "turn off 
antialiasing" really want "draw 1 pixel lines nicely". About 3% want 
"draw adjoining polygons with no gaps". I have proposed solutions to 
both of these and both are better than "turn off antialiasing". The tiny 
remainder are under the delusion that this will somehow actually solve 
the problems they are encountering which are really being caused by 
drawing on a device with pixels who's centers are not on integers.

If you disagree, please describe a graphic containing anything other 
than adjoining polygons where you believe turning off antialiasing will 
actually improve the output.



More information about the cairo mailing list