# Aliasing issue Processing 4

**URL:** <https://discourse.processing.org/t/aliasing-issue-processing-4/47785>\
**Category:** Processing\
**Created:** [January 22, 2026, 5:25pm UTC](https://discourse.processing.org/t/aliasing-issue-processing-4/47785 "2026-01-22T17:25:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [January 23, 2026, 2:50am UTC](https://discourse.processing.org/t/aliasing-issue-processing-4/47785/4 "2026-01-23T02:50:21Z")

</div>

Hello @Chriz96 ,

This is with Processing 4.4.10 and W10 for the JAVA2D renderer (default).

Other versions may behave differently.

Give this a try:

```auto
float a;

//If using Windows scaling add this for 1:1 rendering on some versions:
static
  {
  // JAVA2D: 
  // Forces 1:1 pixel rendering by disabling OS-level DPI scaling
  System.setProperty("sun.java2d.uiScale", "1.0");
  }

void setup() {
  size(600, 600); // JAVA2D is the default
  //size(600, 600, P2D); //Try different renderers
 
  translate(width/2, height/2);
  rectMode(CENTER);
  
  //smooth(4); //See reference and try different values
  
  pixelDensity(1); //Try this if you have a high density display.
}

void draw() {
  // You must have this otherwise it keeps painting over window:
  background(255);   
  
  translate(width/2, height/2);
  rotate(radians(22.5));
  rect(0, 0, 200, 200);
  //a += 0.02;
}

//void mousePressed() {
// saveFrame("any3.png");
//}

```

You will have to experiment and comment \ uncomment lines of code and make changes.

Also look up the references for each.

Reference (this may depend on Processing version used):

> [@DPI Renderer Scaling Override for JAVA2D](https://discourse.processing.org/t/dpi-renderer-scaling-override-for-java2d/47439):
>
> Hello folks! Forcing 1:1 Pixel Rendering for Different Renderers in Processing This topic is for OS-level DPI scaling in Windows such as: This sketch demonstrates how to force 1:1 pixel rendering by overriding DPI scaling for JAVA2D in Processing. The solution was a challenging process that required iterating through multiple approaches with both ChatGPT and Google Gemini to finally arrive at a working solution and comments. The key piece of the solution is this static block at the…

Before (without static block):

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/a/ea2e0ef916d5f9fadb3cce80a66b91055fb01669.png)

After (with static block):

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/4/7/476342304f6f480af5ef190bfb17a94a548fe702.png)

Please report your results.

Additional reference:

- [Renderers (and Windows scaling)](https://discourse.processing.org/t/renderers-and-windows-scaling/47524)
- [Resolution of window scales poorly leading to bad render · Issue #1142 · processing/processing4 · GitHub](https://github.com/processing/processing4/issues/1142#event-18768808340)

_I do not have a solution to upscale it to the windows scaling without aliasing._

`:-)`

---

_[View the full topic](https://discourse.processing.org/t/aliasing-issue-processing-4/47785)._
