image.convert

Re-encode an image to another format.

Config

type ImageConvertConfig = {
  format: 'png' | 'jpg' | 'webp' | 'gif' | 'avif' | 'tiff'; // default 'jpg'
  quality: number; // 1–100, default 90; ignored by png and gif
};

Example

// pipeline
{
  id: 'convert',
  type: 'image.convert',
  config: {
    format: { value: 'webp' },
    quality: { value: 82 },
  },
}

// queue
tk.runQueue(files, 'image').convert({ format: 'webp', quality: 82 });