/** Hard cap on input image bytes. >2MB inputs blow the 2s round-trip budget. */
export declare const MAX_IMAGE_BYTES: number;
export interface PaletteResult {
    colors: string[];
}
declare function rgbToHex(r: number, g: number, b: number): string;
declare function hexToRgb(hex: string): {
    r: number;
    g: number;
    b: number;
} | null;
declare function isNearWhite(r: number, g: number, b: number): boolean;
declare function isNearBlack(r: number, g: number, b: number): boolean;
declare function isNearGrey(r: number, g: number, b: number): boolean;
declare function isRasterMime(mime: string): boolean;
/**
 * Run k-means on RGB pixels. Returns final centroids + their pixel counts
 * so callers can sort by dominance.
 */
declare function kmeans(pixels: Uint8Array, k: number): Array<{
    r: number;
    g: number;
    b: number;
    count: number;
}>;
/**
 * Apply brand-color heuristics to the raw k-means output:
 *   1. Drop empty clusters.
 *   2. Dedupe near-identical centroids (within 8 RGB units in every channel).
 *   3. Promote saturated clusters above near-monochrome ones.
 *   4. Sort by cluster size within each tier.
 * Returns hex codes capped at MAX_OUT_COLORS.
 */
declare function rankAndFilterClusters(clusters: Array<{
    r: number;
    g: number;
    b: number;
    count: number;
}>): string[];
/**
 * Extract a dominant-color palette from an image buffer.
 *
 * Returns null when:
 *   - input exceeds MAX_IMAGE_BYTES,
 *   - MIME type is non-raster (SVG, XML),
 *   - sharp fails to decode the buffer,
 *   - quantization produces no surviving clusters.
 *
 * On success: returns ≥1 hex code (best-effort to surface ≥2 when bitmap
 * has multiple distinct regions). Caller decides whether the result is
 * usable; if `colors.length < 2`, caller may choose to set provenance
 * back to 'unknown'.
 */
export declare function extractPaletteFromBuffer(buffer: Buffer, mimeType: string): Promise<PaletteResult | null>;
export declare const __internal: {
    hexToRgb: typeof hexToRgb;
    rgbToHex: typeof rgbToHex;
    isNearWhite: typeof isNearWhite;
    isNearBlack: typeof isNearBlack;
    isNearGrey: typeof isNearGrey;
    isRasterMime: typeof isRasterMime;
    kmeans: typeof kmeans;
    rankAndFilterClusters: typeof rankAndFilterClusters;
};
export {};
//# sourceMappingURL=brand-palette.d.ts.map