# Beginners

**URL:** https://discourse.processing.org/c/processing/processing-beginners/14.md?page=2

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 3

---

## [Converting decimal number to ternary number](https://discourse.processing.org/t/converting-decimal-number-to-ternary-number/45658)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 2\
**Last updated:** [January 26, 2025, 12:00pm UTC](https://discourse.processing.org/t/converting-decimal-number-to-ternary-number/45658 "2025-01-26T12:00:37Z")

</div>

So here is my attempt (below). Sadly it does not work: Void methods cannot return a value I am trying to use a recursive function. Can it be done? void setup() { noLoop(); } void draw() { for (int i = 0; i \< 34;…

---

## [Which type of PImage is created when LoadImage is used, and how can I ask it what it is?](https://discourse.processing.org/t/which-type-of-pimage-is-created-when-loadimage-is-used-and-how-can-i-ask-it-what-it-is/45639)

<div class="topic-metadata">

**Author:** [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Replies:** 1\
**Last updated:** [January 23, 2025, 2:03pm UTC](https://discourse.processing.org/t/which-type-of-pimage-is-created-when-loadimage-is-used-and-how-can-i-ask-it-what-it-is/45639 "2025-01-23T14:03:38Z")

</div>

When you create a PImage using createImage, you specify the type as RGB, ARGB or ALPHA. When you create a PImage using loadImage, you do not. So, two very closely related questions. What type of PImage is created, R…

---

## [Reference documentation code example glitch for PImage.height](https://discourse.processing.org/t/reference-documentation-code-example-glitch-for-pimage-height/45625)

<div class="topic-metadata">

**Author:** [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Replies:** 1\
**Last updated:** [January 21, 2025, 12:03pm UTC](https://discourse.processing.org/t/reference-documentation-code-example-glitch-for-pimage-height/45625 "2025-01-21T12:03:13Z")

</div>

Strangely enough, the code example given in reference section for Pimage\_height doesn’t have any mention at all of height in it. Should I report this via GitHib? PImage photo; void setup() { size(400, 400); photo …

---

## [Problem with type conversion and color](https://discourse.processing.org/t/problem-with-type-conversion-and-color/45570)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 13\
**Last updated:** [January 12, 2025, 4:18pm UTC](https://discourse.processing.org/t/problem-with-type-conversion-and-color/45570 "2025-01-12T16:18:45Z")

</div>

I have an integer j. I convert it to a character k, with value b. Then I want to fill a rectangle with color b by calling fill(k); It (see below) does not work. Can anyone please tell me why? char k; color b = color(…

---

## [Issues when applying a formula](https://discourse.processing.org/t/issues-when-applying-a-formula/45520)

<div class="topic-metadata">

**Author:** [@Proyecto\_Zeus](https://discourse.processing.org/u/Proyecto_Zeus)\
**Replies:** 19\
**Last updated:** [January 5, 2025, 11:29am UTC](https://discourse.processing.org/t/issues-when-applying-a-formula/45520 "2025-01-05T11:29:04Z")

</div>

Hi there, I am trying to apply the next formulas on my Processing code for my project: In order to do that, I wrote the next code: float a = 6378388.0; float b = 6356911.94613; float e = sqrt(sq(a) - sq(b))/a; pri…

---

## [I cant open Processing on my mac, its showing "Unable To Load Java Runtime Environment"](https://discourse.processing.org/t/i-cant-open-processing-on-my-mac-its-showing-unable-to-load-java-runtime-environment/45524)

<div class="topic-metadata">

**Author:** [@aliathestupid\_1](https://discourse.processing.org/u/aliathestupid_1)\
**Replies:** 1\
**Last updated:** [January 1, 2025, 6:59am UTC](https://discourse.processing.org/t/i-cant-open-processing-on-my-mac-its-showing-unable-to-load-java-runtime-environment/45524 "2025-01-01T06:59:42Z")

</div>

I’m unable to open processing on my Macbook After downloading processing 4.3.1 on my MacBook Air which is a Monterey 12.7.6, it shows unable to load Java Runtime Environment. My Mac is a bit old (13-inch, early 2015) b…

---

## [String Arrays with LTR and RTL languages](https://discourse.processing.org/t/string-arrays-with-ltr-and-rtl-languages/45314)

<div class="topic-metadata">

**Author:** [@Bingo\_dan](https://discourse.processing.org/u/Bingo_dan)\
**Replies:** 13\
**Last updated:** [December 26, 2024, 1:50pm UTC](https://discourse.processing.org/t/string-arrays-with-ltr-and-rtl-languages/45314 "2024-12-26T13:50:58Z")

</div>

myJasonarray.json \[ { "animalsEnglish": \["dog", "cat", "fish", "horse"\] } { "animalsHebrew": \["כלב", "חתול", "דג", "סוס"\] } \] Which is the zero’th index for animalsEnglish? Which is the Zero’th index for animalsHebr…

---

## [Looking for more resources about ArrayLists](https://discourse.processing.org/t/looking-for-more-resources-about-arraylists/21025)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 45\
**Last updated:** [November 12, 2024, 5:42pm UTC](https://discourse.processing.org/t/looking-for-more-resources-about-arraylists/21025 "2024-11-12T17:42:31Z")

</div>

Can someone/anyone direct me to any additional beginner-coder-friendly tutorial(s) on ArrayLists? I am watching the Coding Train tutorials in The Nature of Code playlist. And the explanations ARE indeed clear. I have …

---

## [Run size(800, 600) errors: Exception in thread](https://discourse.processing.org/t/run-size-800-600-errors-exception-in-thread/45261)

<div class="topic-metadata">

**Author:** [@Bingo\_dan](https://discourse.processing.org/u/Bingo_dan)\
**Replies:** 4\
**Last updated:** [November 10, 2024, 12:45pm UTC](https://discourse.processing.org/t/run-size-800-600-errors-exception-in-thread/45261 "2024-11-10T12:45:49Z")

</div>

I’m trying to run Processing 4.3 and I’m receiving errors. Originally, I installed Processing flawlessly. There were no issues. I have since reinstalled my system and tried installing from the location I placed the ori…

---

## [Syntax help with 2D array](https://discourse.processing.org/t/syntax-help-with-2d-array/45242)

<div class="topic-metadata">

**Author:** [@Grumpy\_Mike](https://discourse.processing.org/u/Grumpy_Mike)\
**Replies:** 21\
**Last updated:** [November 1, 2024, 7:32am UTC](https://discourse.processing.org/t/syntax-help-with-2d-array/45242 "2024-11-01T07:32:05Z")

</div>

I am trying to define a 2D array in Processing but I don’t seem to be able to get the syntax right. I have defined the global variable byte\[\]\[\] chordBank2; And in the setup function I have put chordBank2 = new byte\[5…

---

## [Get Vertex Count](https://discourse.processing.org/t/get-vertex-count/45200)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 3\
**Last updated:** [October 19, 2024, 2:19pm UTC](https://discourse.processing.org/t/get-vertex-count/45200 "2024-10-19T14:19:19Z")

</div>

I am trying to use the ‘ShapeVertices’ example in Processing 4.3 (Java mode). The example works fine for the given “uk.svg”. When I try to use my own \*.svg instead of “uk.svg”, I get the error: ‘getVertexCount() only wo…

---

## [Error on parameter or method declaration near 'float'?](https://discourse.processing.org/t/error-on-parameter-or-method-declaration-near-float/45154)

<div class="topic-metadata">

**Author:** [@naoko](https://discourse.processing.org/u/naoko)\
**Replies:** 6\
**Last updated:** [October 10, 2024, 2:18pm UTC](https://discourse.processing.org/t/error-on-parameter-or-method-declaration-near-float/45154 "2024-10-10T14:18:16Z")

</div>

void setup(){ size(200,200); background(255); } void draw(){ stroke(0); strokeWeight(float) float mouseSpeed = abs(mouseX - pmouseX); line(pmouseX,pmouseY,mouseX,mouseY); }

---

## [Type mismatch: cannot convert from element type Object to filename.pde](https://discourse.processing.org/t/type-mismatch-cannot-convert-from-element-type-object-to-filename-pde/45046)

<div class="topic-metadata">

**Author:** [@nedireact](https://discourse.processing.org/u/nedireact)\
**Replies:** 2\
**Last updated:** [September 14, 2024, 12:21pm UTC](https://discourse.processing.org/t/type-mismatch-cannot-convert-from-element-type-object-to-filename-pde/45046 "2024-09-14T12:21:16Z")

</div>

float time = 0.0; void draw() { for (Particle p : particles) { // love/hate vector float lovex = 0.0; float lovey = 0.0; for (Particle o : particles) { // do not compare with yourself if…

---

## [Folder structure?](https://discourse.processing.org/t/folder-structure/44964)

<div class="topic-metadata">

**Author:** [@Erik](https://discourse.processing.org/u/Erik)\
**Replies:** 2\
**Last updated:** [September 1, 2024, 3:21pm UTC](https://discourse.processing.org/t/folder-structure/44964 "2024-09-01T15:21:43Z")

</div>

Is it possible to break down your project to individual files, sorted in folders? I’m aware of the possibility of using tabs, but since I’m using visual studio code, I’m not sure tabs are an option. Also, can I use a ja…

---

## [How do I import Processing libraries in Visual Studio Code?](https://discourse.processing.org/t/how-do-i-import-processing-libraries-in-visual-studio-code/44991)

<div class="topic-metadata">

**Author:** [@Erik](https://discourse.processing.org/u/Erik)\
**Replies:** 3\
**Last updated:** [August 27, 2024, 9:13am UTC](https://discourse.processing.org/t/how-do-i-import-processing-libraries-in-visual-studio-code/44991 "2024-08-27T09:13:15Z")

</div>

I’m using processing in visual studio code, and want to import a library. Since visual studio code lacks the contribution manager found in the processing IDE, I’m not sure how to do it. As far as I understand, libraries…

---

## [Series from For loop (is there a repository for Integer Sequences?)](https://discourse.processing.org/t/series-from-for-loop-is-there-a-repository-for-integer-sequences/44970)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 32\
**Last updated:** [August 24, 2024, 12:58pm UTC](https://discourse.processing.org/t/series-from-for-loop-is-there-a-repository-for-integer-sequences/44970 "2024-08-24T12:58:12Z")

</div>

I often find the need to loop through numbers in a series. For example, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, … or 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, … I don’t think I need help with the code (see below), but…

---

## [Using constants](https://discourse.processing.org/t/using-constants/44955)

<div class="topic-metadata">

**Author:** [@Erik](https://discourse.processing.org/u/Erik)\
**Replies:** 3\
**Last updated:** [August 18, 2024, 8:43pm UTC](https://discourse.processing.org/t/using-constants/44955 "2024-08-18T20:43:21Z")

</div>

I want to use constants in my projects, i.e. final values that never changes throughout the code, that can be accessed anywhere. What is the proper way of using constants in processing?

---

## [The package “processing.core.PSurfaceAWT” does not exist](https://discourse.processing.org/t/the-package-processing-core-psurfaceawt-does-not-exist/44844)

<div class="topic-metadata">

**Author:** [@winterchan](https://discourse.processing.org/u/winterchan)\
**Replies:** 12\
**Last updated:** [July 30, 2024, 12:09pm UTC](https://discourse.processing.org/t/the-package-processing-core-psurfaceawt-does-not-exist/44844 "2024-07-30T12:09:43Z")

</div>

i get this Libraries must be installed in a folder named ‘libraries’ inside the sketchbook folder (see the Preferences window). The package “processing.core.PSurfaceAWT” does not exist. You might be missing a library. …

---

## [How to change font size in Processing IDE?](https://discourse.processing.org/t/how-to-change-font-size-in-processing-ide/44827)

<div class="topic-metadata">

**Author:** [@Elena](https://discourse.processing.org/u/Elena)\
**Replies:** 2\
**Last updated:** [July 25, 2024, 7:52pm UTC](https://discourse.processing.org/t/how-to-change-font-size-in-processing-ide/44827 "2024-07-25T19:52:02Z")

</div>

How to change font size (zoom) in Processing IDE?

---

## [Run code from terminal \[Linux\]](https://discourse.processing.org/t/run-code-from-terminal-linux/44774)

<div class="topic-metadata">

**Author:** [@fra](https://discourse.processing.org/u/fra)\
**Replies:** 6\
**Last updated:** [July 19, 2024, 1:04am UTC](https://discourse.processing.org/t/run-code-from-terminal-linux/44774 "2024-07-19T01:04:47Z")

</div>

Hi, is it possible to run code directly in the terminal? Something like this: :~$ processing\> size(400, 400); rect(120, 80, 50, 50); I read in a previous post that I need to install “processing-java”, but I can’t fin…

---

## [Increase dot size (point())](https://discourse.processing.org/t/increase-dot-size-point/44771)

<div class="topic-metadata">

**Author:** [@fra](https://discourse.processing.org/u/fra)\
**Replies:** 3\
**Last updated:** [July 18, 2024, 5:27pm UTC](https://discourse.processing.org/t/increase-dot-size-point/44771 "2024-07-18T17:27:58Z")

</div>

Hi, with this code I draw some points: size(400, 400); noSmooth(); point(120, 80); point(340, 80); point(340, 300); point(120, 300); So they are drawn with the size of one pixel. Is there a way to increase the dot si…

---

## [How to find the coordinates of a bitmap shape](https://discourse.processing.org/t/how-to-find-the-coordinates-of-a-bitmap-shape/44699)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 13\
**Last updated:** [July 7, 2024, 7:08am UTC](https://discourse.processing.org/t/how-to-find-the-coordinates-of-a-bitmap-shape/44699 "2024-07-07T07:08:11Z")

</div>

I have a sketch that divides a rectangle into three cells (picture 1). Everything is working as it should, but now I want to know the xy coordinates of the start and end of each border/edge. To show what I mean, I have m…

---

## [Sketch canvas does not change](https://discourse.processing.org/t/sketch-canvas-does-not-change/44675)

<div class="topic-metadata">

**Author:** [@Crinqe](https://discourse.processing.org/u/Crinqe)\
**Replies:** 1\
**Last updated:** [July 7, 2024, 1:08am UTC](https://discourse.processing.org/t/sketch-canvas-does-not-change/44675 "2024-07-07T01:08:24Z")

</div>

My sketch runs fine, but when I try to change the canvas size, it does not change. I tried to change the ratio of the sketch ex: 100, 200; 1000, 800; but the sketch only pops up with a canvas size of I would say about 10…

---

## [Data type: very high integer](https://discourse.processing.org/t/data-type-very-high-integer/44680)

<div class="topic-metadata">

**Author:** [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Replies:** 7\
**Last updated:** [July 3, 2024, 3:08pm UTC](https://discourse.processing.org/t/data-type-very-high-integer/44680 "2024-07-03T15:08:15Z")

</div>

simple question: we just try to calculate the length of a lightyear. using int a = 300000 \* // m/s — error ---- km/s 60\*60 \* // to km/h 24 \* // day 365; // year But rounding error occurs Unclear why (I unders…

---

## [Conditions to make a circle grow and shrink](https://discourse.processing.org/t/conditions-to-make-a-circle-grow-and-shrink/43698)

<div class="topic-metadata">

**Author:** [@Karrajo](https://discourse.processing.org/u/Karrajo)\
**Replies:** 5\
**Last updated:** [July 3, 2024, 1:45pm UTC](https://discourse.processing.org/t/conditions-to-make-a-circle-grow-and-shrink/43698 "2024-07-03T13:45:32Z")

</div>

Hello, Sorry because I know this is a very simple question but I’m stuck on this and I need help. I’m trying to create the conditions to grow a circle up to a certain point, and when it reaches that point, make it smal…

---

## [How do i set screen size](https://discourse.processing.org/t/how-do-i-set-screen-size/44683)

<div class="topic-metadata">

**Author:** [@theapplesguy2](https://discourse.processing.org/u/theapplesguy2)\
**Replies:** 2\
**Last updated:** [July 2, 2024, 2:37pm UTC](https://discourse.processing.org/t/how-do-i-set-screen-size/44683 "2024-07-02T14:37:18Z")

</div>

how do i set the screne size of my rendered thing (imagine a square on a 500x500 screen, but theres no set size so the screen gets as small as you can)

---

## [Processing 4.3 Library list is empty](https://discourse.processing.org/t/processing-4-3-library-list-is-empty/44629)

<div class="topic-metadata">

**Author:** [@RaiDerSpb](https://discourse.processing.org/u/RaiDerSpb)\
**Replies:** 1\
**Last updated:** [June 22, 2024, 10:07pm UTC](https://discourse.processing.org/t/processing-4-3-library-list-is-empty/44629 "2024-06-22T22:07:59Z")

</div>

Hello! In Processing 4.3 Library list is empty at my home computer. What problem is it? The Processing 4.3 works well on my work computer on another local network. Maybe it’s the provider or the firewall?

---

## [The function "red(int)" does not exist?](https://discourse.processing.org/t/the-function-red-int-does-not-exist/44567)

<div class="topic-metadata">

**Author:** [@flice](https://discourse.processing.org/u/flice)\
**Replies:** 5\
**Last updated:** [June 10, 2024, 6:47am UTC](https://discourse.processing.org/t/the-function-red-int-does-not-exist/44567 "2024-06-10T06:47:52Z")

</div>

hello! i have the code below to keep sum the rbg values every 16 pixels. However, i’m getting an error saying that red(int), green(int), and blue(int) does not exist?? the argument i passed into the function is a color,…

---

## [Export Application Shows Blank Canvas](https://discourse.processing.org/t/export-application-shows-blank-canvas/44508)

<div class="topic-metadata">

**Author:** [@Thundercat](https://discourse.processing.org/u/Thundercat)\
**Replies:** 8\
**Last updated:** [May 31, 2024, 9:36pm UTC](https://discourse.processing.org/t/export-application-shows-blank-canvas/44508 "2024-05-31T21:36:42Z")

</div>

Hi, I’ve got an app I’ve made over a few months that works fine when launched from Processing, but exporting to Apple Silicone app fails. I’ve googled this a lot but nothing I’ve found has solved this. Here’s what happ…

---

## [Pushing and Popping a PGraphics Grid (pushMatrix / popMatrix in a grid)](https://discourse.processing.org/t/pushing-and-popping-a-pgraphics-grid-pushmatrix-popmatrix-in-a-grid/44403)

<div class="topic-metadata">

**Author:** [@bdon](https://discourse.processing.org/u/bdon)\
**Replies:** 5\
**Last updated:** [May 8, 2024, 10:40am UTC](https://discourse.processing.org/t/pushing-and-popping-a-pgraphics-grid-pushmatrix-popmatrix-in-a-grid/44403 "2024-05-08T10:40:44Z")

</div>

Hi there - I was hoping to draw a basic grid of rectangles with PGraphics, but something I’m doing is wrong here and I’m not sure what it is. Can anyone shed some light? PGraphics img; void setup() { size(100, 10…

[Previous page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=1)

[Next page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=3)
