# Glowing ellipse

**URL:** <https://discourse.processing.org/t/glowing-ellipse/15099>\
**Category:** Processing for Android\
**Created:** [November 1, 2019, 3:13am UTC](https://discourse.processing.org/t/glowing-ellipse/15099 "2019-11-01T03:13:49Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://discourse.processing.org/u/Yash)\
**Post date:** [November 1, 2019, 3:13am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/1 "2019-11-01T03:13:49Z")

</div>

![ads](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e65a29e1f6b175fb928780f1b949798e55bcc2bb.png)  
This is how my sketch (game)looks like.How can i make the ellipse glow and look more appealing?  
I tried blendmode and understood that doesn’t fit in the game because  
1.It takes input as pixels  
2.frame rate drops  
3.hard to integrate with my sketch.  
Any suggestions/ideas?

---

<div class="post-metadata">

**Author:** ![benja](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@benja](https://discourse.processing.org/u/benja)\
**Post date:** [November 1, 2019, 6:53am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/2 "2019-11-01T06:53:04Z")

</div>

You could use a PGraphics to draw a custom ellipse and use that.  
One way to achieve a glow-like effect is to draw a few ellipses with different diameter on top of each other. When the outer ellipses are semi-transparent, it looks a little bit like “glowing”.

```auto
PGraphics glowingEllipse;

void setup() {
  size(400, 400);
  glowingEllipse = createGraphics(40, 40);
  glowingEllipse.beginDraw();
  glowingEllipse.noStroke();
  for (int i =0; i< 10; i++) {
    glowingEllipse.fill(0, 255, 0, 1+10*i);
    glowingEllipse.ellipse(20, 20, 40-3*i, 40-3*i);
  }
  glowingEllipse.endDraw();
}

void draw() {
  background(0);
  image(glowingEllipse, mouseX-20, mouseY-20);
}

```

---

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://discourse.processing.org/u/Yash)\
**Post date:** [November 1, 2019, 10:54am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/3 "2019-11-01T10:54:17Z")

</div>

I have a fade effect as u can see the ellipse…ive drawn a rect instead of background (0) to get that affect.  
Acc to my knowledge, with pgraphics we cannot create such things!?

---

<div class="post-metadata">

**Author:** ![benja](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@benja](https://discourse.processing.org/u/benja)\
**Post date:** [November 1, 2019, 11:06am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/4 "2019-11-01T11:06:28Z")

</div>

Did you try?

Just replace the **background(0)** in the example above with these lines:

```auto
  fill(0, 20);
  rect(0,0,width, height);

```

---

<div class="post-metadata">

**Author:** ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)\
**Post date:** [November 1, 2019, 4:06pm UTC](https://discourse.processing.org/t/glowing-ellipse/15099/5 "2019-11-01T16:06:08Z")

</div>

Hi @Yash,

The [PostFX](https://github.com/cansik/processing-postfx) library has bloom filter for a glowing effect.

Below an example with a moderate bloom intensity: `fx.render().bloom(0.5, 100, 4).compose();`

 ![ss211%20(2)](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/de01791d61b65ba7b07abeeeb74abe4b3fcf3e30.png)

---

<div class="post-metadata">

**Author:** ![FilDomInteractive](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/fildominteractive/32/6678_2.png) [@FilDomInteractive](https://discourse.processing.org/u/FilDomInteractive)\
**Post date:** [November 3, 2019, 9:55am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/6 "2019-11-03T09:55:22Z")

</div>

Hello!

I’ve been trying to create something like this, and it doesn’t work.

Can you **please** send source? Thanks!

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [November 3, 2019, 10:12am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/7 "2019-11-03T10:12:43Z")

</div>

![fx_bloom_example](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/7f9721c3cf0d18a39371b91dd462b7adc2666812.png)

please study that picture, you see

- install library
- find example
- run it
- find the bloom code line

---

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://discourse.processing.org/u/Yash)\
**Post date:** [November 5, 2019, 7:32am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/8 "2019-11-05T07:32:22Z")

</div>

i got this error after importing library and running built in example.

> Blockquote  
> AndroidDevice: cannot find process id, console output will be disabled.  
> FATAL EXCEPTION: GLThread 2989  
> Process: processing.test.advancedeffect, PID: 32190  
> java.lang.NoSuchMethodError: No virtual method sketchPath()Ljava/lang/String; in class Lprocessing/core/PApplet; or its super classes (declaration of ‘processing.core.PApplet’ appears in /data/app/processing.test.advancedeffect-xaDK0dN4P43-YxRJ3b7j9Q==/base.apk)  
> at ch.bildspur.postfx.pass.BasePass.getLibPath(BasePass.java:79)  
> at ch.bildspur.postfx.pass.BasePass.(BasePass.java:21)  
> at ch.bildspur.postfx.pass.BrightPass.(BrightPass.java:19)  
> at processing.test.advancedeffect.AdvancedEffect.setup(AdvancedEffect.java:45)  
> at processing.core.PApplet.handleDraw(PApplet.java:1838)  
> at processing.opengl.PSurfaceGLES$RendererGLES.onDrawFrame(PSurfaceGLES.java:264)  
> at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)  
> at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)  
> AndroidDevice: cannot find process id, console output will be disabled.  
> FATAL EXCEPTION: GLThread 3031  
> Process: processing.test.advancedeffect, PID: 32528  
> java.lang.NoSuchMethodError: No virtual method sketchPath()Ljava/lang/String; in class Lprocessing/core/PApplet; or its super classes (declaration of ‘processing.core.PApplet’ appears in /data/app/processing.test.advancedeffect-xaDK0dN4P43-YxRJ3b7j9Q==/base.apk)  
> at ch.bildspur.postfx.pass.BasePass.getLibPath(BasePass.java:79)  
> at ch.bildspur.postfx.pass.BasePass.(BasePass.java:21)  
> at ch.bildspur.postfx.pass.BrightPass.(BrightPass.java:19)  
> at processing.test.advancedeffect.AdvancedEffect.setup(AdvancedEffect.java:45)  
> at processing.core.PApplet.handleDraw(PApplet.java:1838)  
> at processing.opengl.PSurfaceGLES$RendererGLES.onDrawFrame(PSurfaceGLES.java:264)  
> at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)  
> at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)

```auto
type or paste code here

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [November 5, 2019, 7:46am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/9 "2019-11-05T07:46:38Z")

</div>

did you run the example like i did? does it work?

about android can not help ( but it is not in your topic header )

---

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://discourse.processing.org/u/Yash)\
**Post date:** [November 5, 2019, 1:59pm UTC](https://discourse.processing.org/t/glowing-ellipse/15099/10 "2019-11-05T13:59:14Z")

</div>

Ive built it for android.so these methods doesn’t work in android 😕?

---

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://discourse.processing.org/u/Yash)\
**Post date:** [November 7, 2019, 9:28am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/11 "2019-11-07T09:28:28Z")

</div>

Does postfx doesn’t work with android?

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [November 7, 2019, 11:37am UTC](https://discourse.processing.org/t/glowing-ellipse/15099/12 "2019-11-07T11:37:18Z")

</div>

@Yash === no, it does not.

---

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://discourse.processing.org/u/Yash)\
**Post date:** [November 7, 2019, 2:30pm UTC](https://discourse.processing.org/t/glowing-ellipse/15099/13 "2019-11-07T14:30:43Z")

</div>

😪…sad…

---

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://discourse.processing.org/u/Yash)\
**Post date:** [November 23, 2019, 12:40pm UTC](https://discourse.processing.org/t/glowing-ellipse/15099/14 "2019-11-23T12:40:46Z")

</div>

So is it impossible to create such effect in processing android?

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 23, 2019, 3:35pm UTC](https://discourse.processing.org/t/glowing-ellipse/15099/15 "2019-11-23T15:35:19Z")

</div>

You could use Gradient drawables in android but why not using p5 it self?  
For instance using a blur filter.

```auto
PGraphics pg;
int size;
color c;

void setup() {
    background(0);
    size(300, 300);
    noStroke();
    imageMode(CENTER);
    size = 160;
    c = color(0, 0, 255);
    drawCircle();
    image(pg, 100, 100);
    size = 100;
    c = color(0, 255, 0);
    drawCircle();
    image(pg, 200, 200);
    size = 75;
    c = color(255, 255, 0);
    drawCircle();
    image(pg, 120, 230);
}

void drawCircle() {
    pg = createGraphics(200, 200);
    pg.beginDraw();
    pg.fill(c);
    pg.noStroke();
    pg.ellipse(100, 100, size, size);
    pg.filter(BLUR, 10);
    pg.endDraw();    
}

```
