Skip to content

Commit

Permalink
Merge pull request #5375 from eltociear/patch-1
Browse files Browse the repository at this point in the history
Fix typo in image.js
  • Loading branch information
limzykenneth authored Aug 13, 2021
2 parents 30728b4 + e7151e1 commit 44983fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ p5.prototype.saveGif = function(pImg, filename) {
let framesUsingGlobalPalette = [];

// Now to build the global palette
// Sort all the unique palettes in descending order of their occurence
// Sort all the unique palettes in descending order of their occurrence
const palettesSortedByFreq = Object.keys(paletteFreqsAndFrames).sort(function(
a,
b
) {
return paletteFreqsAndFrames[b].freq - paletteFreqsAndFrames[a].freq;
});

// The initial global palette is the one with the most occurence
// The initial global palette is the one with the most occurrence
const globalPalette = palettesSortedByFreq[0]
.split(',')
.map(a => parseInt(a));
Expand All @@ -257,7 +257,7 @@ p5.prototype.saveGif = function(pImg, filename) {

// Build a more complete global palette
// Iterate over the remaining palettes in the order of
// their occurence and see if the colors in this palette which are
// their occurrence and see if the colors in this palette which are
// not in the global palette can be added there, while keeping the length
// of the global palette <= 256
for (let i = 1; i < palettesSortedByFreq.length; i++) {
Expand Down

0 comments on commit 44983fc

Please sign in to comment.