Processing Programming Language: Examples, Projects & Getting Started
By
Ethan Fahey
•

AI engineers are driving the next wave of innovation, and the companies hiring them are defining what modern AI looks like in production. From startups scaling breakthrough models to global teams deploying AI across real products, these employers offer work that’s both technically challenging and high impact. In this article, we highlight the top companies hiring AI engineers today, with a closer look at remote-first roles and why they’ve become a major advantage for AI talent worldwide.
Key Takeaways
Processing is a user-friendly programming language designed for creative coding and visual arts, making coding accessible to artists and designers.
Core features include the setup() and draw() methods, which manage initialization and real-time rendering of graphics, essential for creating interactive animations.
The Processing IDE supports structured coding through features like object-oriented programming, libraries, and Java integration, enabling the development of complex projects.
Ben Fry, co-founder of Processing, is a leading figure in data visualization and computational design, known for his influential work in visual programming and digital art.
Understanding the Processing Computer Language

Processing is a flexible software sketchbook and programming language designed for learning how to code in a visual context. Launched in 2001, it was initially intended to help teach programming concepts through the visual arts. Processing provides an accessible and user-friendly platform, making coding more approachable for artists and designers. This has fostered a new generation of creative coders.
The primary use cases for Processing include creative coding and visual arts, where it excels in generating and manipulating graphics in real-time. Its simplicity and power have led to widespread adoption in educational settings, art installations, and even in professional design and development projects.
Processing is not just a programming language; it is a vibrant community and a gateway to limitless creative possibilities in web-based visual and interactive design.
Core Concepts of Processing
Processing is built on a simple but powerful programming model designed for creative coding. Its core concepts make it easy to get started while still supporting complex projects:
setup() and draw()
Every sketch revolves around these two methods. setup() runs once to handle initialization, while draw() runs continuously, controlling animation and real-time interaction.
Object-Oriented Structure
Processing supports classes, allowing you to encapsulate data and behavior. Defining your own classes helps organize code, manage complexity, and build reusable components for larger sketches.
Data Types and Custom Structures
Standard data types like int, float, and char are fully supported, along with custom classes you create to model more complex data.
Artist-Friendly Math Functions
Built-in, easy-to-use mathematical functions simplify tasks like movement, rotation, and scaling, making math more intuitive for artists and designers.
Together, these concepts provide a flexible foundation for creating efficient, expressive, and scalable Processing sketches, from simple visuals to advanced interactive systems.
Setup Method
The setup() method is a cornerstone of any Processing sketch. Executed once at the start, it initializes the environment and prepares it for the sketch execution. Common configurations within void setup include defining the window size with the size() function or enabling full-screen mode with fullScreen(). These settings are crucial for setting up the canvas on which your visual elements will be drawn.
By using the size() function, you can specify the dimensions of the display window by setting the width and height parameters, which determine the overall size of the sketch window and influence how shapes are positioned and scaled within the sketch. The fullScreen() function makes the sketch occupy the entire screen. These configurations ensure that your sketch is displayed as intended, providing a consistent starting point for your visual creations.
Draw Method
The draw() method in Processing is where the magic happens. Running in a continuous loop, this method allows for real-time updates and rendering of graphics. Each frame of the animation is drawn within this method, making it ideal for creating dynamic visual effects and animations.
By repeatedly executing the code within the draw() method, Processing can create smooth animations and real-time visual updates. This continuous loop is the backbone of any animated sketch, enabling the creation of interactive and engaging visual experiences.
Using the Processing IDE
The Processing IDE, also known as the Processing Development Environment (PDE), is designed to make coding in Processing as seamless as possible. The main interface includes:
A text editor for writing code
A toolbar with common actions
A message area
A console for displaying output and error messages
This integrated environment simplifies the process of creating and managing written sketches on various platforms, with additional simplifications, including papplet sketch and app.
Running your sketch is straightforward with the Run button in the toolbar or by using the shortcut Ctrl-R (Cmd-R for Mac). The IDE supports multiple file management through tabs, allowing you to organize your code across different files within a single sketch. Saving your sketches in the ‘sketchbook' ensures that your projects are well-organized and easily accessible.
The Processing IDE offers several features:
Debugging tools, such as breakpoints and variable inspection, which are invaluable for troubleshooting and refining your code.
Customization of the appearance and functionality of the IDE through various preferences enhances your coding experience.
Processing libraries that extend the IDE's capabilities, offering tools for graphics, data processing, and more.
Drawing Basics in Processing
Drawing in Processing uses a simple coordinate system where the top-left corner is (0,0), x increases to the right, and y increases downward. With this system, you can easily draw basic 2D shapes like lines, rectangles, and ellipses by specifying their coordinates.
Colors are defined using RGB values (0–255) with functions like fill() and stroke(). Processing also supports interactivity through mouseX and mouseY, which track the cursor’s position and allow sketches to respond dynamically to user input.
Shapes
Drawing shapes in Processing is straightforward and intuitive. To create a rectangle, use the syntax rect(x, y, width, height), where (x, y) specifies the top-left corner of the rectangle. Similarly, an ellipse is drawn using the syntax ellipse(x, y, width, height), which defines the center position and size of the ellipse.
Lines can be drawn using the line function, with the syntax line(x1, y1, x2, y2), where (x1, y1) and (x2, y2) are the endpoints. These basic shapes provide the building blocks for more complex visual elements and images in your sketches and animations.
Text
To display and customize text in Processing:
Use the text() function, which requires the string to be displayed and its (x, y) position on the canvas.
Create a PFont object using the createFont() function before displaying the text.
This approach allows for a wide range of typographic styles and effects in your sketches.
Using the text() function and PFont objects allows you to add informative and decorative text elements to your sketches, enhancing their visual and communicative impact.
Animating with Processing
Creating animations in Processing is done by changing object properties over time to produce motion and interaction. By updating variables that control an object’s position, size, or color, you create the illusion of movement from one frame to the next.
The draw() function is the core of animation, running continuously to refresh the screen. Calling background() at the start of each loop clears the previous frame, preventing unwanted trails and ensuring smooth, clean motion. This real-time rendering model makes Processing especially well-suited for building dynamic, interactive animations.
Variables for Animation
Global variables are essential for tracking the state and position of animated objects within a sketch. Declaring these variables outside of functions ensures they retain their values across multiple frames, resulting in smooth animations.
Reassigning variable values during each frame update allows objects to move, creating the illusion of animation. This method of using global variables is fundamental to creating dynamic visual experiences in Processing.
Managing Backgrounds
Using the background() function within draw() can:
Refresh the screen for each frame, allowing for dynamic visual changes.
Prevent visual trails from previous drawings by redrawing the background at the start of each frame.
Ensure a clear and smooth animation.
This practice is essential for maintaining the visual clarity of your animations, making them more polished and professional, and providing support.
Interactivity in Processing

Creating animations in Processing involves adjusting object properties over time, allowing for dynamic visual effects. Updating variables that control the position, size, or color of objects creates the illusion of movement and interaction within your sketches.
The draw() method is essential for animations, continuously updating the screen with new frames. This real-time rendering capability makes Processing an ideal tool for creating engaging and interactive animations.
Variables for Animation
Global variables are essential for tracking the state and position of animated objects within a sketch. Declaring these variables outside of functions ensures they retain their values across multiple frames, resulting in smooth animations.
Reassigning variable values during each frame update allows objects to move, creating the illusion of animation. This method of using global variables is fundamental to creating dynamic visual experiences in Processing.
Managing Backgrounds
Using the background() function within draw() can:
Refresh the screen for each frame, allowing for dynamic visual changes.
Prevent visual trails from previous drawings by redrawing the background at the start of each frame.
Ensure a clear and smooth animation.
This practice is essential for maintaining the visual clarity of your animations, making them more polished and professional, and providing support.
Advanced Features in Processing
Processing supports advanced features like object-oriented programming, libraries, and Java integration, making it possible to build more complex and well-structured sketches. Its rich ecosystem of community-contributed libraries extends functionality and enables the creation of interactive visuals, multimedia art, and creative applications, all within a collaborative and innovative environment.
Object-Oriented Programming
Object-oriented programming (OOP) in Processing allows you to create and use custom classes, providing a blueprint for creating objects with specific properties and methods. Each instance of a class is an object that can have its own unique properties and behaviors. Utilizing OOP helps structure your code better, making it easier to manage complex sketches.
Organizing your code into additional classes and objects creates more modular and maintainable programs, facilitating the development of intricate program sketches.
Libraries
Processing libraries extend what your sketches can do by adding powerful, ready-made tools built by the community. They support everything from data visualization and animation to hardware interaction and live data processing. By using libraries, you can quickly build interactive visuals that respond to real-time inputs, such as live weather data or sensor feeds, without writing everything from scratch. This makes Processing especially effective for turning complex datasets into dynamic, engaging visual experiences.
Integrating Java Code
Processing is built on Java, which means you can seamlessly integrate Java code to unlock more advanced functionality. This allows you to tap into the broader Java ecosystem, reuse existing libraries, and build more scalable, feature-rich projects. Whether you’re extending a sketch with advanced logic or developing a more complex application, Java integration gives you the flexibility and power to go beyond Processing’s core features while keeping a creative workflow.
Troubleshooting and Debugging
As Processing sketches grow in complexity, effective troubleshooting and debugging become essential. The Processing IDE includes built-in tools that make identifying and fixing issues easier. The console displays error messages and program output in real time, helping you quickly pinpoint problems as they occur. When a sketch doesn’t behave as expected, begin by reviewing the setup() and draw() functions; these core blocks often contain the most common sources of errors.
The Processing Reference is another invaluable resource, offering detailed explanations and examples for every function in the language. Pay close attention to the coordinate system and interactive variables like mouseX and mouseY, as small mistakes can lead to unexpected visual or interaction issues. By combining systematic code review with the IDE’s tools and documentation, you can resolve errors efficiently and keep your projects running smoothly.
Physical Computing with Raspberry Pi
Pairing Processing with a Raspberry Pi opens the door to interactive, real-world projects. By leveraging the Raspberry Pi’s hardware features, you can build sketches that respond to sensors, control LEDs, or interact with physical environments. Processing can be installed directly on the Raspberry Pi, and with Python mode enabled, you can write code that communicates with the board’s GPIO pins.
Typically, setup() is used to configure pins and initialize hardware, while draw() continuously reads inputs or updates outputs. This structure makes it easy to connect digital visuals with physical actions. With some experimentation, Processing and Raspberry Pi can be used for interactive art installations, IoT prototypes, and hands-on creative computing projects.
Best Practices for Processing Programs
Following best practices helps ensure your Processing programs are clean, efficient, and easy to maintain. Use setup() for initialization and draw() for ongoing logic, and break complex behavior into reusable functions. Choose descriptive variable names and organize your code to improve readability.
Make regular use of the Processing Reference and the IDE’s console to catch errors early. Comment your code where logic may not be immediately obvious, and consider using classes or libraries to keep larger projects modular. By adopting these habits, you’ll create Processing sketches that are robust, scalable, and easy to share. Happy coding!
Contributing to the Processing Community
The Processing community thrives on collaboration and shared creativity. Users are encouraged to contribute libraries, tools, and code that extend the core framework and make it more powerful for everyone. These community-driven contributions continuously expand what’s possible with Processing and help keep the ecosystem vibrant and innovative.
Online collections of contributed libraries and tools offer valuable resources for learning, experimentation, and project development. By contributing your own work, you not only help shape the future of Processing but also inspire others and strengthen the creative coding community.
Overall, Processing is a powerful yet approachable language that has transformed how designers and developers engage with creative coding and visual computation. Its intuitive structure and supportive community make it accessible for beginners while remaining flexible enough for building complex, interactive experiences.
Summary
Processing is a beginner-friendly programming language and creative coding environment designed to make visual programming accessible to artists, designers, and developers. Built around simple core concepts like the setup() and draw() methods, Processing enables real-time graphics, animation, and interactivity with minimal overhead. Its intuitive coordinate system, built-in drawing and animation tools, and support for mouse and keyboard input make it ideal for creating dynamic visual projects.
Beyond the basics, Processing scales to more advanced work through object-oriented programming, a rich ecosystem of community-built libraries, and seamless Java integration. It is widely used in education, digital art, data visualization, physical computing (such as with Raspberry Pi), and interactive installations. Supported by a strong global community, Processing serves as both an entry point into programming and a powerful platform for building complex, expressive, and interactive creative systems.
FAQ
What is Processing used for?
How do I install Processing on my computer?
What are the setup() and draw() methods in Processing?
Can I use Java code in Processing sketches?
How can I contribute to the Processing community?



