demo · v134
ImageSmoothingQuality in PaintCanvas
ctx.imageSmoothingQuality is now honoured inside Houdini Paint API canvases. Toggle the quality below — the scaled-bitmap rendering of the paint worklet sharpens or softens; the standard <canvas> alongside is included for comparison.
probing CSS.paintWorklet...
Try it
standard <canvas> (reference)
Paint API tile
The code
// Inside a paint worklet:
class ScaledImage {
paint(ctx, geom, props) {
ctx.imageSmoothingEnabled = true;
ctx.imageSmoothingQuality = "high"; // v134: honoured here
ctx.drawImage(bitmap, 0, 0, geom.width, geom.height);
}
}
registerPaint("scaled-image", ScaledImage);