Function convertImageFile

  • Converts an image file from one format to another and saves to a file

    Parameters

    • inputPath: string

      Path to the source image

    • outputPath: string

      Path where the converted image will be saved

    • options: ConversionOptions = {}

      Additional conversion options

    Returns Promise<string>

    Path to the converted image

    Example

    const { convertImageFile, ImageFormat } = require("kiutils");

    // Convert PNG to JPEG
    convertImageFile("image.png", "converted.jpg", { quality: 90 })
    .then(outputPath => console.log(`Converted image saved to ${outputPath}`));

Generated using TypeDoc