Imaging API photo quality

I use imaging API methods

const pixels = await imaging.getPixels({
applyAlpha: true,
});
const arrayBuffer = await imaging.encodeImageData({
imageData: pixels.imageData,

});

I noticed that the quality of the photo after such buffer reading suffers greatly

I read all the documentation and did not find anything that can be responsible for the image quality / compression

There are alternative methods, for example saveAs.jpg() which takes the parameter quality: 0-12

Is there a way to control the quality / compression in the imaging API the same way as it is done in the saveAs methods?

I’m not sure if that would solve your issue, personally I pass a target size to getPixels like getPixels(getPixelsOptions) and the quality is good.

    const getPixelsOptions = {
      applyAlpha: true,
      targetSize: {
        width: 500,
        height: 500,
      },
    }