Why is iNat's JPEG compression so low?

The JPEG compression used seems ridiculously low (or transversely, the JPEG quality parameter seems high - depending on how the library used handles this parameter).

I just downloaded a “large” image (1024×768) and it was 1384KB. It was of a mushroom in grass, so lots of image detail and hence a fairly large file size. I then saved it again at a JPEG compression of 15 and it was 347KB. [If you’re used to this being called “quality” then just subtract the value from 100.] I ran a few tests with the grassy mushroom and a damselfly with an out of focus background and got the following file sizes (KB):

Compression grass damsel
20 299 120
15 347 148
10 427 167
5 589 227
1 940 337
as downloaded 1384 163

When I was first developing my web sites 20 years ago and we were all on dialup bandwidth was an issue (alright, by 2001 I already got cable internet). I saved images at different compressions and looked at them to see what I could get away with. I found a compression value of 20-25 for scenery was adequate (lots of info but no detail required). For close-ups of insects I used a compression value of 12-15.

Strangely the damselfly file appeared to have been saved with a compression value of 10 - the slightly larger file when I did it obviously due to reprocessing of JPEG artefacts (noise). So is it doing something dynamic? If so, it logic is the wrong way around.

[I had a brief look at github but couldn’t find a way to search it online.]

5 Likes

Compression is often a tradeoff. Quality is sacrificed for image size. It also depends on how the photographer post processes (if they do) the image before uploading. I have some TIFFs that I have taken that are over 100mb for astrophotography. If compressed, what may be a dim star showing up as a single pixel would very likely be washed out in the compression. The same works in landscape phototography. I had a nice picture I took of wind blowing across a lake. Instead of seeing tons of small ripples on the surface after I uploaded the picture to Facebook, it was a grey mush. I compared the download size vs. my original and Facebook had compressed over 95% of the detail out.

If people are using these images for research, they might need to keep as much detail in the images as possible for spotting and fine detail.

4 Likes

Here’s the first possibility that comes to mind: when users are uploading images over a certain resolution (2000x2000 or close to it) iNaturalist resizes them to fit within that size range, and probably applies compression like you’d expect- let’s call that the “damselfy” scenario to fit with your examples.

When users upload images they’ve already resized to a resolution below that threshold, iNaturalist does not resize them. Consequently the file may come through with whatever compression level it was post-processed with- even if they’ve used low compression resulting in a large file. Let’s call that the “grass” scenario.

Many users who use a post-processing workflow do resize their photos in terms of resolution before uploading to avoid dumping that processing onto iNat’s servers- I always resize to within 2000x2000. But it would be easy for someone to mistakenly assume it’s desirable to select the highest-quality compression level while doing that. I set a higher compression to keep filesizes well under 1mb. I remember there was a topic a little while ago about cropping and resizing before upload to preserve detail on the target organism, but I don’t recall compression being brought up as an additional consideration.

1 Like

Just on the Facebook side of things, you can change your FB settings to upload your photos in high resolution and avoid that ridiculous compression it does.

Only applies to photos in your own albums or your own timeline. Ones you post to groups and send in messenger still seem to be compressed.

1 Like

I just noticed the “original” fungi in grass was only posted at 1280×960 (but was 2MB) - The image I was referring to was the “large.jpeg” that is shown on the observation page (before zooming in) so this is one that has been resized by iNat. Still, when I resaved that at the lowest compression my software supports (1) I still couldn’t get a file as large (perhaps its using JPEG2000 parameters?)

And I know there’s a trade-off between quality and size - that’s why I said in the original post that I use higher compression for scenery type photos (a leaf on a tree 20m away is going to just be an indistinct pixel anyway) and lower for insects (where I want to see each ocelli).

In most (probably all) cases images from phones should be compressed more as they don’t have any detail anyway but it would be too hard to determine the sensor size.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.