# Strange aliasing on diagonal lines

**URL:** <https://discourse.processing.org/t/strange-aliasing-on-diagonal-lines/38927>\
**Category:** Coding Questions\
**Created:** [September 21, 2022, 9:50pm UTC](https://discourse.processing.org/t/strange-aliasing-on-diagonal-lines/38927 "2022-09-21T21:50:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [September 21, 2022, 10:27pm UTC](https://discourse.processing.org/t/strange-aliasing-on-diagonal-lines/38927/2 "2022-09-21T22:27:22Z")

</div>

Hello,

Try:

```auto
strokeWeight(2) // In setup()

background(255) // Start of draw()

```

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

References:  
[https://processing.org/reference/draw\_.html](https://processing.org/reference/draw_.html)  
[https://processing.org/reference/background\_.html](https://processing.org/reference/background_.html)

Tutorial:  
[https://processing.org/tutorials/overview](https://processing.org/tutorials/overview)

It should become clear after reading through the above.

Try this with and without `background(255)` at the start of draw:

> [@Circles drawing differently in active and static modes](https://discourse.processing.org/t/circles-drawing-differently-in-active-and-static-modes/37735/4):
>
> Hello, I believe this is due to the smoothing that is applied each frame and is not related to transparency. Code to visualize this: // Smooth and anti- aliasing // v1.0.0 // GLV 2022-06-28 PImage img; void setup() { size(650, 650); background(255); // Try (0) smooth(2); //Default. Try other values! //noSmooth(); // Try it with this! frameRate(1); // Slow things down to visualize } void draw() { noStroke(); fill(255, 0, 0); circle(15, 15, 25); img = get(0, …

I do not have a High-DPI display to test this:  
[https://processing.org/reference/pixelDensity\_.html](https://processing.org/reference/pixelDensity_.html)

`:)`

---

_[View the full topic](https://discourse.processing.org/t/strange-aliasing-on-diagonal-lines/38927)._
