fashn-logo
FASHNAI

Image Preprocessing Best Practices

To ensure optimal performance and consistent outputs when using the FASHN API, it’s important to preprocess your images. By following these guidelines, you can prevent issues like large payloads or inconsistent results.


  1. Resize

    • If your image height exceeds 2000px, reduce it to 2000px or less.
    • Maintain aspect ratio to avoid distortion.
    • Use a quality-preserving downsampling technique (e.g., LANCZOS or INTER AREA) for best results.
  2. Convert to JPEG

    • Use a quality setting of around 95 to balance file size and image clarity.
  3. Upload to a CDN

    • Instead of embedding large base64 strings in your request, upload the processed image to a CDN, and provide the image URL in your API request

Following these best practices helps ensure that your requests reach our servers without issues, leading to faster response times and more consistent results with the FASHN Web App.

On this page