Index: /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 19640)
+++ /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 19641)
@@ -83,4 +83,5 @@
 import com.github.weisj.jsvg.parser.LoaderContext;
 import com.github.weisj.jsvg.parser.SVGLoader;
+import com.github.weisj.jsvg.renderer.SVGRenderingHints;
 
 /**
@@ -1478,4 +1479,9 @@
         }
         return resizeMode.createBufferedImage(dim, new Dimension((int) sourceWidth, (int) sourceHeight), g -> {
+            // jsvg clips through Graphics2D#clip by default, which is not antialiased (jagged edges, see #18131).
+            // Soft clipping avoids that, but needs accurate mask/clip rendering, otherwise the clip is applied as a
+            // paint that the clipped elements' own paints override and parts of the image go missing.
+            g.setRenderingHint(SVGRenderingHints.KEY_SOFT_CLIPPING, SVGRenderingHints.VALUE_SOFT_CLIPPING_ON);
+            g.setRenderingHint(SVGRenderingHints.KEY_MASK_CLIP_RENDERING, SVGRenderingHints.VALUE_MASK_CLIP_RENDERING_ACCURACY);
             svg.render(null, g);
         }, null);
Index: /trunk/test/functional/org/openstreetmap/josm/tools/ImageProviderTest.java
===================================================================
--- /trunk/test/functional/org/openstreetmap/josm/tools/ImageProviderTest.java	(revision 19640)
+++ /trunk/test/functional/org/openstreetmap/josm/tools/ImageProviderTest.java	(revision 19641)
@@ -6,4 +6,5 @@
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.openstreetmap.josm.testutils.ImageTestUtils.assertImageEquals;
 
@@ -129,4 +130,37 @@
         node.put("amenity", "fuel");
         assertDoesNotThrow(() -> OsmPrimitiveImageProvider.getResource(node, Collections.emptyList()));
+    }
+
+    /**
+     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/18131">#18131</a>
+     * <p>
+     * The JOSM logo is assembled from clipped paths. Unless the SVG renderer clips with antialiasing,
+     * the outline of the logo shows jagged steps.
+     */
+    @Test
+    void testTicket18131() {
+        ImageIcon icon = new ImageProvider("logo").setSize(new Dimension(256, 256)).get();
+        assertNotNull(icon);
+        BufferedImage image = (BufferedImage) icon.getImage();
+        // For every column, look at the topmost visible pixel: a fully opaque one means a hard, aliased edge
+        int opaqueEdges = 0;
+        int blendedEdges = 0;
+        for (int x = 0; x < image.getWidth(); x++) {
+            for (int y = 0; y < image.getHeight(); y++) {
+                int alpha = image.getRGB(x, y) >>> 24;
+                if (alpha == 0) {
+                    continue;
+                }
+                if (alpha == 0xff) {
+                    opaqueEdges++;
+                } else {
+                    blendedEdges++;
+                }
+                break;
+            }
+        }
+        assertTrue(opaqueEdges * 4 < blendedEdges,
+                "expected an antialiased logo outline, but found " + opaqueEdges + " aliased and "
+                        + blendedEdges + " antialiased edge pixels");
     }
 
