<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    Hi Jeremy,<br>
    <br>
    I looked through the comments in the bug and your wiki. If
    Image.getScaledInstance() is not recommended, we may want to do
    something about it: as the bug report suggests, either deprecate the
    method and provide guidelines for the recommended way or fix the
    implementation.<br>
    <br>
    Yet I don't have extensive experience in Java 2D.<br>
    <br>
    You can add this a the comment in JBS and ask for Phil's opinion.<br>
    <br>
    <br>
    Regards,<br>
    Alexey<br>
    <br>
    <div class="moz-cite-prefix">On 23/06/2023 07:06, Jeremy Wood wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:emfcc694dd-35fb-4ee5-803b-ce6dd0986f9a@cf4df73f.com">
      
      <style id="css_styles">blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }a img { border: 0px; }li[style='text-align: center;'], li[style='text-align: center; '], li[style='text-align: right;'], li[style='text-align: right; '] {  list-style-position: inside;}body { font-family: Helvetica; font-size: 9pt; }.quote { margin-left: 1em; margin-right: 1em; border-left: 5px #ebebeb solid; padding-left: 0.3em; }</style>
      The performance of Image.getScaledInstance() has been known to be
      a problem for a long time. (This <a href="https://bugs.openjdk.org/browse/JDK-6196792" moz-do-not-send="true">ticket</a> discusses it well. It has a
      complicated history.)
      <div>
        <div><br>
        </div>
        <div>I have <a href="https://github.com/mickleness/pumpernickel/wiki/Scaling" moz-do-not-send="true">developed code</a> that is much more
          performant. It takes less than 10% of the time the
          AreaAveragingScaleFilter does. There’s nothing especially
          clever about it; it just iterates over the pixels more
          efficiently. Like AreaAveragingScaleFilter: it doesn’t suffer
          degraded appearance (pixelation) at less than 50% scale.</div>
        <div><br>
        </div>
        <div>Is there any interest in me working on a PR to overhaul
          AreaAveragingScaleFilter? (That is: is there interest in
          reviewing/sponsoring such a PR?) It won’t be a trivial task,
          but the results I have now indicate the performance gains
          could be significant.</div>
        <div><br>
        </div>
        <div>(Or in my wildest of pipe dreams: I’d love it if
          Graphics2D.drawImage(..) could scale images past 50% without
          looking pixelated… but that could be an even more difficult
          discussion about RenderingHints and long-established
          interpolation norms. So I assume that’s a non-starter.)</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div> - Jeremy</div>
      </div>
    </blockquote>
    <br>
  </body>
</html>