W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2006

[whatwg] Canvas draw quality

From: Benjamin Joffe <canvasgame@gmail.com>
Date: Sat, 21 Oct 2006 14:09:26 +1000
Message-ID: <f9ec6ebb0610202109p8a9b9a1l39dd6a97a9458f4a@mail.gmail.com>
I would like to see a property added to the 2d canvas context that would
allow quality to be lowered for drawing functions. Normally any time a shape
is drawn, pixels close to the boundary are made semi transparent to make it
look smooth, this is usually favourable but I have had a need to draw shapes
and lines with pixel sharp boundaries in the same way as Java normally does.
I would imagine that with the setting enabled, only the integer part of
linewidth would be used. This setting would also affect drawing images,
making them have no blurring or approximating when scaled or rotated.

This could easily be implemented without affecting old scripts, making a
property such as lowQuality = true; (default false). Or perhaps allowing
more control: a float from 0 (low quality) to 1 (high quality), and
interperating null as 1 for backwards compatibility.

This property could also be handy in instaces where both fill() and stroke()
are being called. Low quality could be used on the fill() to improve
performace while stroke() could be used with high quality so it still draws
smoothly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20061021/7d06e182/attachment.htm>
Received on Friday, 20 October 2006 21:09:26 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:48 UTC