I am trying to create a plugin, in which we are displaying the bytes size of the image. We want to match the bytes size of an image to the bytes size when we export an image as PNG at 1x quality.
For example, the size of an image in my Figma design file is 4MB. The size dimensions of this image in the file is 300 x 300px. When I scale it down to 100 x 100px, the quality and bytes size of the image is same. But I want the bytes size to be propotionally reduced with the image size.
When I export this 4MB image at 100 x 100px size at 1x quality, then the size is around 1.5MB. But when I calculate the size of the image at 100 x 100px size within the design file using getBytesAsync, it is showing as 4MB.
Is it possible to match the image bytes size to the bytes size we export at 1x quality.
Please help me get through this.