How to share my sketches in Processing publicly or to save the gifs produced by it using Processing Desktop IDE?

I want to share my sketches with other people or create a link to the sketch to be accessible to anyone. Is it possible to do it?

You could use

1 Like

Thanks, @soegaard for the reply but I want to export the GIF that is processing code output.
As I am creating Earthquake mapping using Processing and I want to show the output to others.
If you know how can I do this that will be a great help.

float rotx = PI/4;
float roty = PI/4;
float rotz = PI/4;

float angle;
float r = 350;
Table table;

PImage earth;
PShape globe;

void setup() {
  size(600, 600, P3D);
  table = loadTable("", "header");
  earth = loadImage("");
  globe = createShape(SPHERE, r);

void draw() {
  translate(width/2, height/2);
  angle += 0.005;
  for (TableRow row : table.rows()) {
    float lat = row.getFloat("latitude");
    float lon = row.getFloat("longitude");
    float mag = row.getFloat("mag");
    float theta = radians(lat) + PI/2;
    float phi = radians(lon) + PI;
    float x = r * sin(theta) * cos(phi);
    float y = -r * sin(theta) * sin(phi);
    float z = r * cos(theta);
    PVector pos = new PVector(x,y,z);
    float h = pow(10, mag);
    float maxh = pow(10, 5);
    h = map(h, 0, maxh, 1, 40);
    PVector xaxis = new PVector(1,0,0);
    float angleb = PVector.angleBetween(xaxis, pos);
    PVector raxis = xaxis.cross(pos);
    if (h <= 10) {
      fill(0, 0, 255); 
    } else if (h > 10 && h <= 20){
      fill(0, 255 , 0);
    } else {
      fill(255, 0 ,0); 
    translate(x, y, z);
    rotate(angleb, raxis.x, raxis.y, raxis.z);
    box(h, 1, 1);


void mouseDragged() {
  float rate = 0.005;    //velocidad de rotacion
  rotx += (pmouseY-mouseY) * rate;
  roty += (mouseX-pmouseX) * rate;

Use saveFrame() to save each frame as tif.
Then use either “Movie Maker” (see the Tools menu in Processing) to convert the tif images into a
QuickTime moive. Then find some tool to convert to gif.

Alternatively, use ImageMagick to convert directly from tiff images to a gif.

There ist also the VideoExport Library.
It requires ffmpeg but works very nice once everything is installed.

You could probably configurate it to save gifs (not tested, not guaranteed).
Or just convert the exported file in the terminal with a command like this.

ffmpeg -i recording.mp4 result.gif


You may run in to this:

I have run in to the same issues.

Creating animated GIFs: