However, progressive JPEG transmission generally rely on the intermediate server to process the JPEG. With a progressive JPEG, the multiple scans of the image are performed according to a scan script that includes transcoding parameters which define the data that is encoded during each scan. For example, a JPEG typically includes three channels: a luma channel (Y) and two chroma channels (Cr and Cb). Each channel may include 64 coefficients that provide the data for the channel: one DC coefficient and sixty-three AC coefficients. Some of the coefficients for certain channels impact the image more than others, and so progressive JPEGs may send the most important impactful and less data-intensive information in the first scan, then subsequently balance the effect of the remaining data on the image with the amount of data needed to achieve that effect in subsequent scans. To determine which of this data will be included in which scan, the intermediate server analyzes the image, selects appropriate transcoding parameters, and generates or applies a scan script to define the various scans of the image. The image is then scanned multiple times according to the scan script to generate appropriate image data, which can then be streamed to a recipient device in order to allow the recipient device to render the JPEG progressively.
While this works well in conventional communications systems, recently there has been a trend towards end-to-end encrypted (E2EE) environments. In an E2EE environment, the body of a communication is encrypted on the sending client, and decrypted at the receiving client, in a way that ensures that no other actors can view the message. Thus, any intermediate servers that handle the communication cannot view the communication contents. If the message includes an image, the intermediate server cannot determine the transcoding parameters, making it difficult to efficiently transmit the image.