code: function convertAnimatedGifsicle(context, callback) {
          var crop = context.crop;
          var imageSizes = context.sizes;
          var baseArgs = [];
          if (crop) {
            baseArgs.push('--crop');
            baseArgs.push(crop.left + ',' + crop.top + '+' + crop.width + 'x' + crop.height);
          }
          baseArgs.push(context.workingPath);
          return async.series([ convertOriginal, convertSizes ], callback);
          function convertOriginal(callback) {
            if (!context.copyOriginal) {
              return setImmediate(callback);
            }
            var path = context.tempFolder + '/original.' + context.extension;
            context.adjustedOriginal = path;
            var args = baseArgs.slice();
            args.push('--optimize');
            args.push('-o');
            args.push(path);
            return spawnThen('gifsicle', args, callback);
          }
          function convertSizes(callback) {
            return async.eachSeries(imageSizes, convertSize, callback);
          }
          function convertSize(size, callback) {
            var args = baseArgs.slice();
            args.push('--resize');
            // "Largest that fits in the box" is not a built-in feature of gifsicle, so we do the math
            var originalWidth = (crop && crop.width) || context.info.width;
            var originalHeight = (crop && crop.height) || context.info.height;
            var width = originalWidth;
            var height = Math.round(size.width * originalHeight / originalWidth);
            if (height > originalHeight) {
              height = size.height;
              width = Math.round(size.height * originalWidth / originalHeight);
            }
            args.push(width + 'x' + height);
            args.push('--optimize');
            args.push('-o');
            var suffix = size.name + '.' + context.extension;
            var tempFile = context.tempFolder + '/' + suffix;
            args.push(tempFile);
            return spawnThen('gifsicle', args, callback);
          }
        }
docs: Animated GIF strategy based on gifsicle. gifsicle doesn't hit RAM limits when confronted with huge animated GIFs, but it does tend to make files bigger and doesn't resize quite as well. Tradeoffs are part of life