private function getSaveOptions($extension, $transform): array
    {
        /** @var ConfigModel $settings */
        $config = ImagerService::getConfig();

        switch (mb_strtolower($extension)) {
            case 'jpg':
            case 'jpeg':
                return ['jpeg_quality' => $config->getSetting('jpegQuality', $transform)];
            case 'gif':
                return ['flatten' => false];
            case 'png':
                return ['png_compression_level' => $config->getSetting('pngCompressionLevel', $transform)];
            case 'webp':
                return ['webp_quality' => $config->getSetting('webpQuality', $transform), 'webp_imagick_options' => $config->getSetting('webpImagickOptions', $transform)];
        }

        return [];
    }