P5.js - not displaying static gif image

Some notes about your posted “index.html” file:

  • You’re loading the same library 2 times: the unmodified & minimized versions.
  • That is, “p5.js” + “p5.min.js”, “p5.gif.js” + “p5.gif.min.js”. Should pick 1 or the other:
  • And a more serious 1: you’re loading p5.js addon libraries before the p5.js main library!
  • Here’s their correct order for each category:
<!-- p5.js main library: -->
<script defer src=https://cdn.JsDelivr.net/npm/p5></script>

<!-- p5.js addon libraries: -->
<script defer src=https://Unpkg.com/p5/lib/addons/p5.sound.min.js></script>
<script defer src=https://cdn.JsDelivr.net/p5.gif.js/latest></script>
<script defer src=https://cdn.JsDelivr.net/gh/processing/p5.accessibility/dist/p5.accessibility.min.js></script>

<!-- p5.js sketch code: -->
<script defer src=sketch.js></script>
  • And below an online example along w/ its source code:

I’ve tested my own online example locally on Firefox under the “file://” scheme and it runs OK.

2 Likes