Inflated image size - quality/compression

1. What is the problem? Be very detailed.
I really hope I've missed something simple here, but I can't seem to get reasonable image sizes unless I really reduce the max-pixels value, which isn't practical.

Image quality ex ODK Collect appears to have zero jpg compression and actually inflates image file size.
Resized images (to ~40% area) are similar in size to the original file, unresized images are nearly double the original size.

Image quality ex marked up ODK Collect is dramatically reduced in size however, close to a 75% irfanview jpg. (see 4c vs 4e)

Externally saving a sample image at 100% jpg quality is barely larger than the no resize Collect image (5a vs 1b & 1d) or actually smaller (5b vs 2c)

Externally saving the images at 75% jpg quality results in around a ~5x reduction in size from ODK or ~2.5x reduction from device camera.

Increases data volume & time to upload/download, consumes 2-5x DB space unnecessarily.

2. What app or server are you using and on what device and operating system? Include version numbers.
ODK Central 1.3.3 (client 1.3.2)
ODK Collect 2021.3.2, Android 11, Samsung Galaxy Tab S6

3. What you have you tried to fix the problem?
Reading documentation
Adjusting device settings
Testing different combinations of max-pixels and capture vs select image (see (#5))

4. What steps can we take to reproduce the problem?
Capture a photo and compare file sizes

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

Compression
Previously the default camera could be changed to one that has options for capture resolution and JPG quality (eg Open Camera) but this is not possible anymore and the only options on recent Samsung devices are HEIF (not available in Collect) or JPG, no resolution/quality options. But it doesn't seem that this matters, as even selecting a gallery image (eg 1a) can result in a file size that's similar (with a 60% shrink 1c) or larger (no resize 1d & 1d).

Testing with Galaxy Tab S6, sensor resolution 4128*3096:

  1. 'Choose Image'
    1a. Samsung camera capture outside Collect, original size 4.12mb
    1b. 'choose image' using above photo, max-pixels=4128, 7.1mb
    1c. 'choose image' using above photo, max-pixels=2560, 3.8mb
    1d. 'choose image' using above photo, no max-pixels, 7.1mb
    1e. 'choose image' using above photo, select annotate image but don't markup, just save & close, gives 2134x1600 (1600 screen pixel width) image, 0.5mb

  2. 'Take Picture' of as close to same scene as above photo as possible,
    2a. max-pixels=4128, 5.1mb
    2b. max-pixels=2560, 3.1mb
    2c. no max-pixels, 8.8mb

  3. Open Camera, capture as close to above scenes as possible
    3a 4128x3096Q75: 1.2mb
    3b 4128x3096Q100: 5.6mb
    3c 1440x1080Q75: 0.2mb

  4. Irfanview save as jpg, quality 75:
    4a : 1a 4.12 --> 1.6mb
    4b : 1b 7.1 --> 1.6mb
    4c : 1c 3.8 --> 0.7mb
    4d : 1d 7.1 --> 1.6mb
    4e : 1e 0.5 --> 0.5mb
    4f : 2a 5.1 --> 1.3mb
    4g : 2b 3.7 --> 0.7mb
    4h : 2c 8.8 --> 1.6mb

  5. Irfanview save as jpg, quality 100:
    5a : 1a 4.12 --> 7.5mb
    5b : 2c 8760 --> 8739kb

Annotation

Annotated image resolution appears to be a limit of device screen resolution since at least 2012. I have chosen a high res device to work around this, but if it is eventually resolved it would open up the use of cheaper and physically smaller devices without sacrificing annotated image quality (or having to capture an image without annotation and also capture one that allows annotation).

I don't know if this is even possible or probable, and I can work with a ~2MP annotated image, but thought I'd tack it onto this post as a side note.

1 Like

Hi @ahblake
Thanks for creating this topic and describing the issue. I've never noticed it and I've never heard about it. I will take a look at it when I'm free.

1 Like

Thanks,
It's quite strange, and I would have thought people would notice the very large image sizes before, so I was hoping that it was a simple error on my end.

Let me know if you would like me to provide any further details or testing.

I only have an SM-T865 Tab S6 and an SM-G973 S10 to hand but can ask some other people to complete a test form on other devices.

From the image rotation beta testing on a completely different device with selectable capture resolution, the filesizes are also excessive

Thanks I was able to reproduce the issue.
Now it is reported in our repository and we will try to fix it https://github.com/getodk/collect/issues/4978