A developer is processing a 50-image batch where each image is a photograph of a handwritten form. The images are sent as base64-encoded PNG in the API request. Average image size is 2MB. The team notices response latency is 45 seconds per API call for a batch of 10 images. What is the most effective optimization?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — a is correct because 2MB PNG images of photographs (which contain gradients, shadows, and varied tones) are inefficiently encoded for transmission. JPEG at 85% quality reduces photographic image size by 70-80% (to approximately 400KB) with minimal impact on handwriting legibility — handwritten text is high-contrast and survives JPEG compression well.
Full explanation below image
Full Explanation
A is correct because 2MB PNG images of photographs (which contain gradients, shadows, and varied tones) are inefficiently encoded for transmission. JPEG at 85% quality reduces photographic image size by 70-80% (to approximately 400KB) with minimal impact on handwriting legibility — handwritten text is high-contrast and survives JPEG compression well. This dramatically reduces the base64 payload and transmission time. C is also potentially valid, but A is the most directly effective optimization within the described architecture. B is wrong because the latency issue is transmission and processing overhead from large images, not resolution; increasing resolution makes images larger, worsening latency. C is wrong because URL image references require the images to be accessible at a public URL, which may not be available and introduces a dependency on external hosting; it is architecturally more complex than simple format conversion. D is wrong because parallelizing API calls is a valid throughput strategy but does not reduce per-image processing cost; it also multiplies the number of API connections and may hit rate limits; it addresses throughput, not the root cause of per-call latency.