<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 10/11/2025 18:32, Andy Goryachev
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CY8PR10MB7265E3B23A8F9B1AAE2102A2E5CEA@CY8PR10MB7265.namprd10.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p dir="auto"
style="text-align: left; text-indent: 0px; background-color: rgb(255, 255, 255); margin-top: 0px; margin-bottom: 16px;">
<span
style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 14px; color: rgb(31, 35, 40);">This
is interesting, similar to
</span><span
style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 11.9px; color: rgb(31, 35, 40); background-color: rgba(129, 139, 152, 0.12);"><code
style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif;">BufferedImage.createGraphics()</code></span><span
style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 14px; color: rgb(31, 35, 40);"> in
AWT.</span></p>
</blockquote>
Yeah, I proposed this a few months ago as I noticed that FX
basically has everything needed; it just needs something to tie the
pieces together. This is why the PR is really not that complicated,
but just translating from user API's to Prism API's for the most
part.<br>
<blockquote type="cite"
cite="mid:CY8PR10MB7265E3B23A8F9B1AAE2102A2E5CEA@CY8PR10MB7265.namprd10.prod.outlook.com">
<p dir="auto"
style="text-align: left; text-indent: 0px; background-color: rgb(255, 255, 255); margin-top: 0px; margin-bottom: 16px;">
<span
style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 14px; color: rgb(31, 35, 40);">Questions:</span></p>
<ul dir="auto"
style="text-align: left; margin-top: 0px; margin-bottom: 0px; padding-left: 0px; background-color: rgb(255, 255, 255);">
<li
style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 14px; color: rgb(31, 35, 40); margin-left: 24px;">
so this will <span style="font-weight: 600;"
role="presentation">aways</span> be slower than Canvas?</li>
</ul>
</blockquote>
<p>Not necessarily.</p>
<p>- If you frequently need to read pixels (with PixelReader) then
WritableImage can be faster, as you avoid the CPU->GPU->CPU
memory copy cycle that you'd get with snapshotting a Canvas. For
example, image scaling may be faster if you need the final
resulting pixels again, as scaling is a relatively simple
operation but involves lots of data that would otherwise need
copying multiple times.<br>
</p>
<p>- If you primarily do operations on small sizes (say icons, or
small images), or only need infrequent changes</p>
<p>- WritableImage can also be used without any kind of Scene (it is
not a Node)</p>
<p>Where it will definitely be slower:</p>
<p>- Using a large working area (>= 500x500), and drawing over
large areas; at what point the GPU wins depends on what you're
doing exactly</p>
<p>- Using gradients/effects over large areas heavily favors GPU's<br>
</p>
<p>- Simulating unsupported blend modes (some blend modes are really
heavy, requiring a division per color channel)</p>
<p>- Font rendering heavily favors GPU's I think as GPU's can cache
glyphs in vector form and render them directly at any size<br>
</p>
<blockquote type="cite"
cite="mid:CY8PR10MB7265E3B23A8F9B1AAE2102A2E5CEA@CY8PR10MB7265.namprd10.prod.outlook.com">
<ul dir="auto"
style="text-align: left; margin-top: 0px; margin-bottom: 0px; padding-left: 0px; background-color: rgb(255, 255, 255);">
<li
style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 14px; color: rgb(31, 35, 40); margin-top: 0.25em; margin-left: 24px;">
<div role="presentation">are the results going to be exactly
the same, or there will be platform-specific differences in
anti-aliasing etc?</div>
</li>
</ul>
</blockquote>
<p>There will be differences, but for supported features you'd have
to know what to look for to spot the differences. The limitations
are very similar to the differences between FX's software
and accelerated pipelines, as the same back-end renderer is used.
<br>
</p>
<p>For example, the offered blend modes are limited (only SRC_OVER
and ADD). Even for supported features (like Image scaling) there
can be slight differences (but the same can be said of different
GPU pipelines, and even different GPU's).</p>
--John<br>
</body>
</html>