Reduce image file size

Hi all,  Is it possible to reduce the image size of a file, through compression, are some kind of quality reduction. Our users upload receipts onto our apps and modern smartphones take huge photos, we have set an upload limit but our users are unable and should not be expected to resize the image themselves.  I’ve used ScaleImage java action in the ImageCrop module, but not sure if I am putting in the correct details as it does not change the size of the image.  In the JPEG compression quality, I’ve tried values from 1 to 100 and from 0.1 to 1
2 answers

Hi, we're using CropImage action to auto-crop images uploaded by users to fit into a 3:2 container and by changing the compression quality from 1.0 down to 0.25 the size of the image does decrease. Example:

- Image with compression quality 1.0 = 197.979 bytes (720x480 pixels)

- Same image with compression quality 0.5 = 55.997 bytes (720x480 pixels)

- With compression quality 0.25 = 38.029 bytes (720x480 pixels)



Yes, you can reduce image file size through compression. However, the ScaleImage Java action may not handle compression directly. You can use libraries like ImageIO or Apache Commons Imaging to compress JPEG images. Adjust the compression quality parameter when saving the image to achieve the desired reduction in file size. On the other hand for manually compress images you can use any online application such as it compress images without losing their quality.