Skip to main content
Participant
June 29, 2025
Question

Imaging API photo quality

  • June 29, 2025
  • 1 reply
  • 157 views

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?

1 reply

creative explorer
Community Expert
Community Expert
July 3, 2025

@29015708muqj have you thought of saving the image as Tiffs or PNG as both file formats are lossless compression. Lossless compression refers to saving your image files in a format that preserves every single pixel of original image data. When you open a file that was saved with lossless compression, it will be exactly identical to the image when it was last saved, down to the individual pixel values. No information is thrown away to reduce file size. (Jpegs is the total opposite of this!)

Mediums:
Print: TIFF is often the workhorse for high-quality print, archiving, and flexible professional workflows (with the caveat of ensuring you select a lossless compression option)
Web: PNG is the go-to for web graphics that need transparency and crisp, lossless quality.

m