Comments (13)
Ditto. Pixelated circles on a Retina display with p5 0.6.0, with both @marcrleonard's and @parsoyaarihant's snippets.
from p5.
We manually tessellate a shape before drawing it, this could be causing the issue. Ideally this should be done in OpenGL, but we were already facing many issues with OpenGL so just decided to do it manually.
Two more things:
- I don't understand enough OpenGL myself to take this on, but would love if someone familiar with OpenGL would like to work on this.
- Could someone also try and reproduce this, please?
from p5.
I don't know opengl either... This is the best I got :-)
https://www.opengl.org/discussion_boards/showthread.php/167955-drawing-a-smooth-circle
from p5.
I'm wondering if you couldn't drill into the pygame code to get the opengl pieces for arc/circle/ellipse etc...
from p5.
Could someone also try and reproduce this, please?
Mac OS, retina display, chunky edges:
But I'll give your lib a whirl, it looks fascinating after Pillow and p5.js :–)
Let me know if you need some Mac OS testing.
from p5.
I am also getting the same error. I am using MacBook Pro (without retina display - 1920x1080).
But, I think this behaviour is occurring because the background is not cleared at every frame. This is discussed in Processing forum too:
constantly redrawing the same object over itself means that the pixels with partial alpha, the ones on the edges drawn that way to help smooth out the object, get less and less transparent with each frame. meaning you lose the smoothing.
When the background is cleared at every frame, the circles appear smoother. I have observed this behaviour while rendering SVGs in browser too. Redrawing the same SVG multiple times makes the edges of SVG look chunky in browser.
@illus0r could you try the following code and check if the edges are still chunky?:
from p5 import *
def setup():
size(500, 500)
no_stroke()
background(204)
def draw():
background(204)
fill(random_uniform(255), random_uniform(127), random_uniform(51), 127)
circle((mouse_x, mouse_y), 40)
run()
from p5.
I'm getting the same chunky (aliased) result in Ubuntu. Clearing the background doesn't help.
from p5.
Same here. macOS Mojave and p5==0.5.0. Retina display (MacBook Pro 2018).
from p5.
Hi, is there any follow up to this?
I could it be because smooth()
hasn't been implemented and things are left for default anti-aliasing?
from p5.
Several of these examples actually call mouse_is_pressed multiple times on a single click at 60fps, so they aren't so great for testing because they can write stacked circles (although the randomized width helps. Here is a simpler test:
from p5 import *
def setup():
size(640, 360)
no_stroke()
def draw():
background(204)
fill(192,64,128)
circle((width/2, height/2), 32)
if __name__ == '__main__':
run()
I can confirm on a retina display with p5 0.6.0 that the resulting circle has the correct size -- it is "32x32", and if you drag a desktop screenshot you get a 74x74 png (because retina), in which the circle is made of 2x2 pixels (because that's the size of the underlying pixel buffer in p5). This is all expected -- the "chunky" part that might be unexpected is the no anti-aliasing / smooth.
from p5.
Same problem with stroke
def setup():
size(1280, 720)
def draw():
background(0)
translate(1280/2, 720/2)
stroke(255)
stroke_weight(30)
line((0,0),(1280,720))
if __name__ == '__main__':
run()
Results in:
from p5.
So are there any update for this?
from p5.
from p5.
Related Issues (20)
- Weird jittery behavior when `background()` is not called in `draw()` while using the skia renderer. HOT 12
- Exclude building test files into distribution builds HOT 2
- extend CI tests for windows and mac-os platform HOT 2
- Too many open files error when loading many images HOT 3
- Migrate to poetry HOT 4
- save() throws an error HOT 2
- Errors using "CORNERS" mode HOT 5
- Error installing p5 package: Failed building wheel for PyOpenGL-accelerate HOT 13
- Inconsistency between mouse_is_pressed boolean and mouse_clicked function HOT 1
- Improve installation instructions to account for unuspported Python versions HOT 6
- Setup pre-commit HOT 3
- Optimize skia rendering loop
- KeyError: 'SQAURE' when using stroke_cap(SQUARE) HOT 5
- Fix Code Formatting to Resolve Flake8 Errors in Pre-commit Hook HOT 4
- ModuleNotFoundError: No module named 'npy_tempita' when installing P5. HOT 3
- Not compatible with Python >=3.11 HOT 6
- Unable to install p5 and ml5 in python HOT 2
- pip cant install p5 HOT 3
- Cannot install p5 package with Python 3.12 HOT 5
- Unable to run custom setup and draw HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p5.